← Resources

How to Deploy a Lovable Project Outside Lovable Hosting

Rob29 August 2026
How to Deploy a Lovable Project Outside Lovable Hosting

To deploy a Lovable project outside Lovable hosting, connect the project to GitHub (available on all plans), then deploy the repository from your own hosting provider. Identify your stack first: TanStack Start projects need a host that runs server code, while older React + Vite projects can use static hosting.

Before you begin

  • A Lovable project you want to own the hosting for.
  • A GitHub, GitLab or Bitbucket account, and a hosting provider such as Netlify or Vercel — or your own server for self-hosting.
  • If you are starting a project for this, join Lovable and build it first.

Get the code out

  1. In your project, connect Git sync under project settings and link your GitHub, GitLab or Bitbucket repository. Lovable keeps the repository synchronised while you continue building in Lovable.

  2. Alternatively, on paid plans use Download codebase to get a .zip from the Code editor or Project settings → Git. The export contains source code and migration files — not database records or uploaded storage files, which you export separately.

Identify your stack

Open package.json and look at the dependencies:

  • TanStack Start projects list @tanstack/react-start. They need server-capable hosting — static hosting alone will not run their server rendering, server functions or API routes.
  • Older React + Vite projects build to static files and can be hosted anywhere static files are served.

Deploy to Netlify or Vercel

  1. Connect the repository to your provider and select the deployment branch.

  2. Set the build command to npm run build with Node.js 22.

  3. Configure the settings for your stack:

    • Older React + Vite: set the output directory to dist and add a fallback so unmatched routes serve index.html (a Netlify _redirects file or a Vercel vercel.json).
    • TanStack Start: Netlify and Vercel detect the app’s Nitro preset automatically. Netlify needs dist as its output directory; Vercel needs no output-directory setting.
  4. Set the environment variables, including VITE_SUPABASE_URL, VITE_SUPABASE_PUBLISHABLE_KEY, SUPABASE_URL and SUPABASE_PUBLISHABLE_KEY when using the built-in backend, plus any secrets your server functions need. Add your new production URL to any authentication provider’s allowed redirect URLs.

Self-host instead

For a container or your own server, build with Nitro’s Node.js server preset and run node .output/server/index.mjs on Node.js 22 (port 3000 by default). For older React + Vite projects, build the static dist/ output and serve it with Nginx or similar, configured to return index.html for client-side routes. You manage deployment, HTTPS, logs and security yourself.

How to verify it works

  • Open and refresh a nested route directly — a 404 on refresh usually means a missing fallback.
  • Test sign-in and sign-out end to end.
  • Verify the reads, writes and uploads your app depends on.
  • For TanStack Start, load a server-rendered page and exercise a server function.

Common errors and fixes

  • 404 on refresh or deep links. The SPA fallback is missing on static hosting.
  • Blank pages or failed server functions. Environment variables are missing on the host — set both browser (VITE_) and server variables.
  • Sign-in redirects fail. Add the new production URL to your auth provider’s allowed redirect URLs.
  • Static host cannot run TanStack Start. Move to server-capable hosting.

Frequently asked questions

Can I keep building in Lovable after moving hosting? Yes — Git sync keeps the repository updated, and your Lovable Publish button continues publishing to Lovable hosting; the external deployment is driven by your repository.

Is my database included in the export? No — source code and migrations only. Data and uploaded files need separate export.

What does this cost? Lovable Git sync is on all plans; codebase download needs a paid plan. Your hosting provider bills separately.

Which Node version? Node.js 22 for the build on both stacks.

Official sources and next steps

Next: decide whether hybrid hosting or a full move fits you before switching traffic. If you are starting a project you plan to self-host, join Lovable and build it there first.

Keep learning

Get the next write-up

New builds and articles, straight to your inbox.

I've got thousands of ideas. 
Maybe one of them could change your life

Explore what I've built, pick something that interests you, and see where you can take it.

Get new project drops by email