Deploying and hosting outside Lovable - Lovable Documentation
Documentation Index Fetch the complete documentation index at: /llms.txt Use this file to discover all available pages before exploring further. Skip to main content Assistant Responses are generated using AI and may contain mistakes. This guide gives practical steps for running a Lovable app outside Lovable’s own hosting and built-in backend. It builds on How Lovable hosts your app and Deployment, hosting, and ownership options with Lovable , which explain what you own and what changes when you move.
You can adopt any scenario here on its own and in any order. In this guide, hosting refers to where your application runs, while deployment refers to how your code is built and delivered to that environment. Before you migrate Lovable runs the whole app for you: hosting with custom domains and HTTPS, deployments and preview environments, the built-in backend with authentication, a database, and file storage, and AI and connector access at runtime.
Most teams keep that setup and never need this guide. Move part of your app outside Lovable when you have a requirement that this setup does not cover: a deployment pipeline of your own, a compliance or data residency rule that specifies where the app must run, or an organizational policy on hosting. Each part you move becomes yours to run, update, and secure. Each section below lists what that includes for its part of the app.
Pick the path that matches your situation: Situation Go to You deploy the frontend through your own pipeline or host, and the app keeps using the built-in backend Get your source code , then Deploy a TanStack Start app or Deploy an older React + Vite app , depending on your stack You need the database and backend services under your own account or on your own infrastructure Host backend and data on a managed provider or on your own infrastructure You are leaving Lovable entirely The sections above in order, then Complete a move away from Lovable Whichever path you take, verify the deployment before switching traffic .
Check how your project is built Lovable builds apps on one of two stacks, and each needs different hosting: Project type What you deploy What the host needs TanStack Start apps (created from May 13, 2026) The server output and static assets for the deployment target you build for A host that runs the server part: server-side rendering, server functions, and API routes. A host that receives only the static files does not run those features Older React + Vite apps The static build output in dist/ A static file host, a content delivery network (CDN), or a web server such as Nginx, with a fallback to index.html for client-side routes To tell which stack your project uses, open package.json in the Code tab.
A TanStack Start project lists @tanstack/react-start under its dependencies. An older React + Vite project does not. You can also ask Lovable in the project chat: Which stack does this project use, older React + Vite or TanStack Start? The frontend sections below are split by stack: Deploy a TanStack Start app and Deploy an older React + Vite app . Read the one for your project and skip the other. The backend migration sections apply to projects that use the built-in backend or a connected Supabase project.
Before you deploy anywhere, run the app on your own computer from a clone of the repository. A working local run confirms what the app needs installed, its dependencies, and the environment variables it reads, before a host adds its own settings. See Work locally in your IDE . Get your source code Every scenario in this guide starts from a copy of your project’s code outside Lovable. You have two ways to get one: Git sync , available on all plans.
Connect the project to a repository on GitHub, GitLab, or Bitbucket, and Lovable keeps the two in sync both ways. Use this for any ongoing deployment: hosting platforms deploy from the repository, and Lovable continues to manage development and previews. The examples on this page use GitHub. The same steps apply to a GitLab or Bitbucket repository on platforms that deploy from those providers. Download codebase , available on paid plans, for a one-time snapshot as a .zip file.
Open the code editor and click Download codebase at the bottom of the file panel, or use the Download codebase section in Project settings → Git . On Enterprise workspaces, admins can limit downloads to workspace admins and owners. See Download your project’s codebase . Both paths give you the application source, including the configuration files and the database migration files stored in the project. Neither includes the records in your database or the files in storage.
Those move separately, as described under What migrates and how . The npm examples assume your repository includes package-lock.json . If it only has bun.lock , use Bun for installation or run npm install locally and commit the generated package-lock.json before using npm ci in CI or Docker. Keep the install command and lockfile consistent on your host. The Docker and virtual machine examples on this page work from an extracted download as well as from a clone.
Platforms that build from a repository need the code in a repository you control, which Git sync gives you. From here on, this guide assumes your project is connected to a repository. Deploy a TanStack Start app TanStack Start apps run server code, so the host has to run a server, not only serve files. For an older React + Vite app, see Deploy an older React + Vite app . Your project’s build configuration, the @lovable.dev/vite-tanstack-config package in package.json , prepares the server output for the host through Nitro , a build tool that adapts a server app to the platform it runs on.
Nitro calls each platform a preset and has presets for most cloud platforms and server runtimes, which is what makes a TanStack Start app portable: you can deploy the same code to any of them. Inside Lovable the preset is fixed. Outside Lovable, the build picks the preset for the platform it detects, or the one you name. Nitro’s deployment guide lists every supported platform. When the frontend runs outside Lovable, you take on its deployment pipeline, environment variables, availability, logs, and preview environments, and Lovable cannot monitor or debug infrastructure it does not control.
Check that package.json lists nitro . Without it, the build does not package the app for a hosting platform. Setting the nitro option in vite.config.ts without installing the package produces an error asking you to add it. Older build configurations can skip Nitro outside Lovable or write a different output directory, even when Nitro is installed. Update an older project’s build configuration before following these examples, and verify both the Lovable preview and the generated server entry point.
Deploy from your repository to a platform Nitro detects On the platforms Nitro detects automatically, including Vercel, Netlify, and Cloudflare Pages, a build from your repository picks the matching preset with no configuration. Nitro’s deployment guide lists all of them. 1 Connect your repository Connect the repository to the platform and select the branch you deploy production from. That can be the branch Lovable syncs, or a release branch you merge into after review.
2 Configure the build Set the build command to npm run build and use Node.js 22. On Netlify and Cloudflare Pages, set the publish or build output directory to dist . Vercel needs no output directory setting. 3 Configure environment variables Set the variables your app reads. A project that uses the built-in backend needs both sets of values from the repository’s .env file: VITE_SUPABASE_URL and VITE_SUPABASE_PUBLISHABLE_KEY for the browser, and SUPABASE_URL and SUPABASE_PUBLISHABLE_KEY for the server.
Add the secrets your server functions read as well. Those are not in the repository. 4 Update sign-in redirect URLs Add the new URL to your authentication provider’s allowed redirect
The rest of this page is on the live site.