How to Move Your App Off Lovable: Code, Hosting and Database, in the Right Order
Maybe you want your own hosting, your own database account, or you’re just nervous having everything in one place. Whatever the reason, you can move a Lovable app out. The trick is knowing which parts move, because the code is the easy bit.
This guide follows Lovable’s own docs on deploying and hosting outside Lovable. You don’t have to move everything: lots of people move only the frontend and keep Lovable’s backend.
First: which kind of Lovable app do you have?
Lovable builds on two different stacks, and they need different hosting:
| Your app | What you host | Where it can go |
|---|---|---|
| Older React + Vite app | Static files from dist/ | Any static host: Vercel, Netlify, Cloudflare, and so on |
| TanStack Start app (projects created from May 13, 2026) | A server part plus static files | A host that runs server code. Static-only hosting won’t work |
Open package.json in the Code tab. If it lists @tanstack/react-start, it’s TanStack Start. If not, it’s the older React + Vite kind.
Step 1: Get your code out
- Git sync (all plans): connect the project to GitHub, GitLab or Bitbucket. Lovable keeps the repo and the project in sync both ways, and hosts can deploy from that repo.
- Download codebase (paid plans): a one-time
.zipfrom the code editor or Project settings → Git.
Either way you get the app’s code, config files and database migration files. You don’t get the rows in your database or the files in storage. Those move separately (step 3).
Lovable recommends running the app on your own computer from the repo before deploying anywhere, so you find missing settings early.
Step 2: Move the frontend (the easy part)
For an older React + Vite app on a Git-based host:
- Build command:
npm run build - Output directory:
dist - Node version: 22
- Environment variables: copy these from the project’s
.envfile:VITE_SUPABASE_URL,VITE_SUPABASE_PUBLISHABLE_KEY,VITE_SUPABASE_PROJECT_ID. - Refresh 404s: add a rewrite so every route serves
index.html. Our 404 on refresh guide has the exact file for each host.
For a TanStack Start app, Lovable’s docs say it also needs server copies of the values without the VITE_ prefix (SUPABASE_URL, SUPABASE_PUBLISHABLE_KEY, SUPABASE_PROJECT_ID) and a host that runs its server part.
Then add your new address to your sign-in settings: Supabase’s Site URL / Redirect URLs and any Google or GitHub login app. Skip that and login breaks on the new domain. See Supabase auth redirects to localhost and Google login breaks on a custom domain.
If the site loads blank, it’s almost always missing environment variables or a build that ran before you added them: blank page in production.
At this point many people stop. Your app runs on your hosting, and Lovable’s backend keeps working behind it.
Step 3: Move the backend (only if you need to)
If your project used Lovable’s built-in backend and you want the data in your own Supabase project, Lovable documents this order. Keep the old app running the whole time:
- Create a new Supabase project. Note its URL, project ID and publishable key.
- Move the structure. Apply the migration files from
supabase/migrations/in order. These bring tables, Row Level Security policies, functions, triggers and storage buckets. - Move the data. In Lovable, go to More → Database → Manage → Settings → Export data. Lovable emails you when the export is ready, and you download it from More → Storage. It’s a PostgreSQL
.backupfile, not SQL you paste, and it includes user accounts with their password hashes, so users keep their passwords. - Set up sign-in again. Turn on each login provider in the new project and update redirect URLs, including the callback URL in Google or GitHub.
- Copy storage files (images, uploads) into the matching buckets by hand.
- Set secrets and deploy Edge Functions. Secrets stored in Lovable (Stripe keys, etc.) are not in the export. Add them in the new project, then deploy the functions in
supabase/functions/. Recreate any scheduled jobs. - Point a test copy of the app at the new backend and check: it loads, you can create and read records, a migrated user can sign in, uploads work, functions respond.
- Switch. Restore a final, fresh export, update
.envandsupabase/config.tomlin the project to the new values, then move traffic. People who were signed in will need to sign in again.
Two things that don’t come with you automatically: AI features and app connectors run through Lovable while you’re on the built-in backend. Once the backend moves, you replace those calls with your own provider accounts.
If your app already used your own Supabase project (the Supabase integration), there’s nothing to move on the backend. It already lives in your account.
Before you remove Lovable Cloud, download your database export and storage files. Lovable warns that exports saved in Cloud storage can’t be reached afterwards.
A prompt for your AI tool
I'm moving this app off Lovable. Tell me:
1. Whether it's a React + Vite app or TanStack Start (check package.json).
2. Every environment variable and secret the app and its Edge Functions read.
3. Every Edge Function, scheduled job, storage bucket, login provider,
AI call and Lovable connector the app depends on.
4. Any hard-coded Lovable or Supabase URLs, project IDs or redirect URLs.
Give me a checklist. Don't change any files and never print secret values.
The short version
- Check your stack in
package.json. - Connect GitHub (or download the code).
- Deploy the frontend with the right env vars, rewrite rule and redirect URLs.
- Only if needed: new Supabase project → migrations → data export → sign-in → storage → secrets and functions → test → switch.
- Replace AI and connector calls, and save your exports before removing Cloud.
Then run the pre-launch security checklist on the new setup. A move is a good moment to catch a key that ended up in the wrong place.
Official sources used: Lovable: Deploying and hosting outside Lovable · Lovable: Deployment, hosting, and ownership options. Checked November 2026.
Ready to ship without guessing the next fix?
The Ship It Kit puts the prompts, deploy steps and pre-launch checklist in one place for Lovable, Bolt, Cursor and Replit apps. One-time $19. Launch price: $19 $17 until November 14, 2026.