Deploy a Lovable app

Sync your Lovable project to GitHub, check which kind of app it is, and have ComputeSphere build it from the repository. What's public, what's secret, and what stays on Lovable's backend.

At a glance

Start from
A Lovable project
Time
About 25 min
Ends with
A live URL on ComputeSphere
Steps last run
1 October 2026

Key idea

Lovable can sync your project to a GitHub repository, and ComputeSphere builds from GitHub. So the route is: connect the project to GitHub in Lovable, check which kind of app it is, and create a ComputeSphere service from that repository. Lovable keeps working as your editor, and its backend can stay where it is.

1. Sync the project to GitHub

Lovable's GitHub integration creates a repository for your project and keeps the two in sync both ways. In Lovable, open Project settings → Git → GitHub (or, from the chat, +, then Project → GitHub), and choose Connect next to the GitHub account or organization where the repository should go.

Things Lovable's documentation says to know:

  • The repository it creates is private by default.
  • It syncs one branch at a time, normally main. Changes pushed to that branch sync back into Lovable.
  • Don't delete the repository: that stops the sync. Renaming it keeps it running.
  • Only workspace or project admins and owners can connect a project.

If you'd rather not connect GitHub, Lovable also offers Download codebase. Then create a repository yourself and push the folder, as in Deploy a vibe-coded app. You lose the sync, so prefer the connection.

2. Check which kind of app it is

Lovable's documentation describes two kinds of project, and they deploy differently:

Your projectHow to tellOn ComputeSphere
React + Vite (projects created before 13 May 2026)vite.config.ts and an index.html in the root; the build writes a dist folderA static site: files served from the edge, no spherelet running
TanStack Start (created from 13 May 2026, or upgraded)@tanstack/react-start in package.jsonA web service: it renders pages and runs server functions, so it needs a server

3. Know what's public and what's secret

A Lovable project keeps browser settings in a committed .env file. Lovable's documentation is explicit: values starting with VITE_, such as VITE_SUPABASE_URL and VITE_SUPABASE_PUBLISHABLE_KEY, are built into the page and visible to anyone. They're meant to be public, and the build reads them from that file, so you don't need to set them on ComputeSphere. Lovable also says not to add .env to .gitignore, because its previews need it.

What must stay private, such as a payment or AI provider key, belongs in Lovable's Secrets, used by its Edge Functions on Lovable's backend. Before you deploy, check that no private key has a VITE_ name or sits in the code: anything there is shipped to every visitor.

If your app uses Lovable's built-in backend (Cloud), it keeps using it from ComputeSphere: the frontend calls the same address with the same publishable key. ComputeSphere doesn't host databases, so moving your data is a separate job; Lovable documents it under deploying outside Lovable.

4. Create the service

A React + Vite project: a static site

  1. Connect GitHub to ComputeSphere

    Your repository is private, so ComputeSphere needs read access to it. Follow lesson 5.3.1: add a GitHub connection and give the ComputeSphere app access to only this repository.

    You should seeYour GitHub connection listed under Connections.

  2. Start a static site

    In your project, choose New service, then Static Site. Name it and choose or create an Environment.

    You should seeThe New service form with Service information, Environment, Configuration and Build settings.

  3. Point it at the repository

    Under Configuration, choose Private (Connections), your connection, your repository and the branch Lovable syncs (usually main). For a public repository, Public and its URL work too.

    You should seeYour repository and branch filled in.

  4. Set the build

    Wait a moment after choosing the repository, then fill in Build settings: Build command npm run build, Publish directory dist, Install command npm ci. These match Lovable's own instructions for building outside Lovable.

    You should seeBuild command npm run build and Publish directory dist.

  5. Deploy

    Choose Deploy. When the service shows Running, open its URL and click through a few pages, then reload one: deep links serve your app too, so client-side routes work.

    You should seeRunning, and a URL ending in computesphere.app that shows your app.

A TanStack Start project: a web service

This needs a running server. TanStack Start's hosting guide covers a Node.js server: the build produces .output/server/index.mjs, started with node .output/server/index.mjs. Lovable's documentation says that outside Vercel, Netlify and Cloudflare you choose the target with nitro: { preset: "<name>" } in vite.config.ts; follow TanStack's guide for the Node.js preset.

Then create a Web Service from the repository as in Deploy a vibe-coded app: Managed build, runtime Node.js, Build command npm ci && npm run build, Start command node .output/server/index.mjs, and Port set to the port the server prints at start-up, which you'll see in the service's runtime log. The static path above is the one we ran on ComputeSphere for this guide; for this one, read the runtime log on your first deploy.

5. Keep shipping

You keep editing in Lovable; each change syncs to the branch. Pushing doesn't deploy on its own here: when you're ready, open the service, choose Redeploy, keep Build & deploy, and confirm. ComputeSphere builds the latest commit.

What can go wrong

What you seeUsual causeFix
The repository isn't in the listThe ComputeSphere app can't see itIn GitHub, add the repository to the ComputeSphere app's access (lesson 5.3.1)
The build fails at installThe lockfile doesn't match package.json, or the project uses another package managerRead the first error under Builds; set Install command to match (for example npm install)
A blank pageThe build ran, but the browser can't reach the backendOpen the browser console; check .env is committed with the VITE_ values
A TanStack Start app deployed as a static site loads, then its features failServer code isn't runningDeploy it as a web service
A private key turns up in the page's sourceIt has a VITE_ name or sits in frontend codeRotate it at the provider, then move it to Lovable's Secrets and an Edge Function
Pages work in the Lovable preview but not hereThe preview injects settings the deployed build doesn't getCompare what the code reads with what's in .env

Learn the why

These lessons teach what each step above assumes. Free to read, no account needed.

  1. Already built it? Start hereVibe coding to production, lesson 4.2.1Reading, 6 min
  2. Static sites, server-rendered apps and APIsApplication foundations, lesson 2.1.2Reading, 6 min
  3. What counts as a secretApplication foundations, lesson 2.6.1Reading, 5 min
  4. Service types: web service, background worker, cron job, static siteDeploy on ComputeSphere, lesson 5.2.2Reading, 6 min
  5. How builds work: Dockerfile or runtime buildDeploy on ComputeSphere, lesson 5.3.2Reading, 6 min
  6. Connecting to a databaseDeploy on ComputeSphere, lesson 5.5.3Reading, 6 min

Ship it on ComputeSphere.

Build from your repository, keep secrets out of your code, and roll back from the console or the CLI. Start a 14-day trial. A card is required at signup, and you're charged from day 15 unless you cancel.