How to download project from Lovable: code and data
Every way to get your code out of Lovable, what stays behind, and how to run it, edit it and host it yourself.
Last updated
The quickest way to download a project from Lovable on a paid plan is to open the Code tab and click Download codebase at the bottom of the file panel, which saves the whole project as a .zip file. On any plan, including Free, you can instead connect GitHub in Project settings → Git → GitHub: Lovable creates a private repository with all your code, and from GitHub you can clone it or click Code → Download ZIP. Either way you get the source code and the database schema, but not the data in your database, your uploaded files or your secret keys, which you export separately (steps below).
Everything on this page comes from Lovable's own documentation and Supabase's docs, checked on November 30, 2026. Lovable changes quickly (new projects switched to a different framework in May 2026), so if you are reading this much later, check the links in the sources.
Every way to get your code out of Lovable
There are three routes. They all give you the same files; they differ in whether the copy stays up to date.
| Route | Plan needed (as of November 30, 2026) | What you get | Stays in sync? |
|---|---|---|---|
| Git sync to GitHub, GitLab or Bitbucket | All plans, including Free | A new private repository with your full code | Yes, both ways |
| Download codebase (ZIP) | Paid plans (Pro, Business, Enterprise) | A .zip snapshot of the whole project |
No, it is a one-time copy |
| Download a single file | Any plan, anyone with project access | One file | No |
Lovable's paid plans start at $25 a month for Pro and $50 a month for Business, as of November 30, 2026. Viewing the code in Lovable needs edit access to the project; on Free the editor is read-only. On Enterprise workspaces, admins can restrict codebase downloads to admins and owners, so if the button is greyed out, that is probably why.
Lovable itself recommends Git sync over ZIP snapshots for ongoing work, because a ZIP is out of date the moment you make another change.
Option 1: connect GitHub (works on the free plan)
Git sync is Lovable's name for linking your project to a code repository, a folder of code with its full history that lives on GitHub (or GitLab or Bitbucket). The steps, as Lovable documents them:
- Open Project settings → Git → GitHub. You can also use the + button next to the chat box, under Project → GitHub.
- If your workspace has no GitHub connection yet, click Add connection, then Add account. In the GitHub popup, pick your account, choose All repositories or Only select repositories, and click Install & Authorize. Only workspace owners and admins can add the connection.
- Click Connect next to the connection where the repository should be created.
Lovable then creates a new repository, private by default, and starts two-way sync. Changes you make in Lovable are pushed to GitHub, and changes pushed to the synced branch (usually main) come back into Lovable.
Two things catch people out. First, Lovable always creates a new repository; you cannot point it at one you made yourself, so do not create an empty repo first. Second, a project can be linked to only one Git provider at a time.
If you are on Free and want a ZIP anyway, open the new repository on GitHub and use Code → Download ZIP. That is the same code the paid button gives you.
Option 2: download the ZIP (paid plans)
On Pro, Business or Enterprise, anyone with edit access can:
- open the Code tab and click Download codebase at the bottom of the file panel, or
- go to Project settings → Git and use the Download codebase section.
To grab one file, use the Download button in the file toolbar, which works on any plan.
You do not need GitHub for this. The ZIP is a snapshot: later changes in Lovable will not reach it.
Option 3: clone the repository
Once Git sync is on, the project's GitHub settings show HTTPS, SSH and GitHub CLI clone addresses. Cloning means copying the repository to your computer with its history, so you can push changes back. With Git installed:
git clone https://github.com/your-account/your-repo.git
cd your-repo
Use the address Lovable shows you in place of the example.
What you get when you download
Lovable states that you own what you create, can use it commercially and can host it anywhere. The code is built on open-source frameworks, and which one depends on when the project was made:
- Projects created from May 13, 2026 use TanStack Start, a React framework that renders pages on a server. You can tell because
package.jsonlists@tanstack/react-start. It needs a host that runs server code, not just one that serves files. - Older projects use React with Vite, which builds to plain static files that any static host can serve.
The files Lovable's docs point to in a typical project:
| File or folder | What it is |
|---|---|
package.json |
The list of packages and the commands (dev, build) that run the app |
.env |
Public settings that start with VITE_, such as VITE_SUPABASE_URL. This file is in the repository, not hidden |
supabase/migrations/ |
SQL files that recreate your database tables (the schema, not the rows) |
supabase/config.toml |
The backend project ID the code points to |
drizzle/migrations/ |
Schema migrations instead, on projects that use Drizzle |
bun.lock or package-lock.json |
The exact versions of every package |
If you are not sure which stack you have, you can also ask Lovable in the chat: "What stack is this project on?"
What does not come with the code (and how to take it)
This is where most other guides stop. The ZIP or repository contains your source code and the database schema. Lovable lists what does not transfer with it:
| Not in the download | How to take it with you |
|---|---|
| Database rows | Export the database (below) |
| User accounts | Included in the database export, with password hashes |
| Login sessions | Do not transfer; users sign in again |
| Sign-in provider settings (Google login and so on) | Set up again in the new backend and update the redirect URLs |
| Uploaded files (storage) | Download from More → Storage, upload to matching buckets |
| Secrets (API keys) | Re-enter them; Lovable never shows a saved value again |
| Edge functions | The code deploys separately with Supabase's CLI |
| Scheduled jobs | Recreate them |
| Custom domain | Point its DNS at your new host |
| AI features and app connectors | Replace with your own integrations |
Your database and its data
Lovable Cloud, Lovable's built-in backend, is built on Supabase, an open-source database and backend service. To export it, go to More → Database, choose Manage, then Settings, and click Export data under Export project data. Lovable emails you when the file is ready and saves it to More → Storage, where you download it.
What you should know about that file, from Lovable's docs:
- It is a compressed PostgreSQL archive (a
.backupfile), not SQL you can read. Restore it withpg_restore, notpsql, using PostgreSQL 16 or newer tools. - It includes the full structure and data, including users' accounts and password hashes, so people keep their passwords.
- It does not include storage files, edge function code, secrets, sign-in provider settings or API keys.
- You can request one export every 24 hours, for databases up to 200 GB.
- For a single table, you can download a CSV from the Database view instead.
The database must be running to export it, so resume a paused project first. Test the restore on a new, empty Supabase project before you rely on it.
If your project was connected to your own Supabase account instead of Lovable Cloud, the data already lives in your Supabase project, and disconnecting Supabase in Lovable deletes nothing there. You manage it in the Supabase dashboard like any other Supabase project.
Moving to your own Supabase project
Lovable documents the move in this order:
- Create a Supabase project and note its project ID, URL and publishable key.
- Apply the schema from
supabase/migrations/with the Supabase CLI:
npx supabase link --project-ref your-project-id
npx supabase db push
- Restore the data from the
.backupexport withpg_restore. - Set up each sign-in provider again and add your new site's address to the allowed redirect URLs.
- Upload your storage files to buckets with the same names. (Supabase's own restore guide confirms that only storage metadata is copied with the database, not the files themselves.)
- Add your secrets in the Supabase dashboard or with
supabase secrets set. - Deploy edge functions:
npx supabase functions deploy
- Point a test deployment at the new backend, check it, then update
.env(VITE_SUPABASE_URL,VITE_SUPABASE_PUBLISHABLE_KEY,VITE_SUPABASE_PROJECT_ID, plus theSUPABASE_*versions on TanStack Start) andproject_idinsupabase/config.toml.
Lovable notes that moving only the PostgreSQL database does not move authentication, storage, realtime or edge functions, and it does not support migrating to plain PostgreSQL or another database provider. If you want that, you rebuild those parts yourself.
Secrets and environment variables
Lovable splits these in two. VITE_ variables are public values baked into the site when it is built; they sit in .env and come with the code. Secrets (your Stripe key, an OpenAI key) live in More → Settings → Secrets, are used only by backend code, and are never in the frontend code. They are write-only: Lovable will never show you a saved value again. Before you leave, make a list of every secret name, then copy each value from the service that issued it (or generate a new key there).
Custom domain, AI features and connectors
A domain you bought elsewhere just needs its DNS records changed at your provider to point to the new host. A domain bought through Lovable stays registered when you disconnect it from a project; its card has a Transfer out option if you want it at another registrar. Lovable's AI features and connectors run through Lovable and use your workspace credits, so in the new setup you call those services with your own API keys.
How to run your Lovable project on your computer
You need Node.js (Lovable's hosting guide builds with Node 22) and a terminal. Lovable's docs say to check the project's README and package.json for the exact commands. Both Lovable stacks use the standard ones:
cd your-repo
npm ci
npm run dev
npm ci installs the exact package versions from the lock file (use npm install if there is no package-lock.json, and Lovable's hosting guide says to use Bun if the project has only a bun.lock). npm run dev starts a local server and prints the address to open in your browser, usually something like http://localhost:5173 for Vite or http://localhost:3000 for TanStack Start.
One warning from Lovable's docs that is easy to miss: because .env is in the code, your local copy talks to the same backend as your live app. Anything you create or delete locally happens to your real data. Use test records.
How to keep editing it with a coding agent
Once the code is on your computer, you can keep building with a coding agent, a tool that reads your project and makes changes from plain-language instructions in your terminal or editor. Claude Code and Codex both work in any folder of code; our guides on how to use Claude Code and how to use Codex walk through the setup. A short CLAUDE.md file that explains the stack and the commands helps either agent a lot.
You do not have to choose between Lovable and an agent. With Git sync on, you can push from your computer and the changes appear in Lovable, then keep prompting there. Lovable edits one branch at a time; if both sides changed the same branch, Lovable pushes its version to a lovable-sync branch rather than overwriting yours. To make Lovable pick up your pushes right away, its docs give:
git commit --allow-empty -m "Trigger Lovable sync"
git push
Files over 10 MB sync into Lovable but cannot be edited there.
How to host it somewhere else
Lovable's hosting guide covers this per stack.
Older React + Vite projects build to static files:
npm ci
npm run build
The site lands in dist/. Any static host works; Lovable names Netlify, Cloudflare Pages, Vercel, AWS Amplify, Azure Static Web Apps, Firebase Hosting and plain Nginx or Apache servers among others. Two settings matter: add the three VITE_SUPABASE_* variables in your host's settings (they are baked in at build time, so rebuild after any change), and make every route fall back to /index.html. On Nginx that is try_files $uri $uri/ /index.html;; on Netlify or Cloudflare a _redirects file; on Vercel a vercel.json.
TanStack Start projects need a server. Hosts that Nitro (the server layer in package.json) detects, such as Vercel, Netlify and Cloudflare Pages, need no extra setup. For your own server or a container:
NITRO_PRESET=node-server npm run build
node .output/server/index.mjs
It listens on port 3000 unless you set PORT. Put a proxy such as Nginx in front for HTTPS, and set SUPABASE_URL, SUPABASE_PUBLISHABLE_KEY and any secrets your server code reads.
Before switching your domain, Lovable suggests checking three things: refresh a page deep in the site directly, sign in and out, and test saving data and uploading a file. When it all works, pause writes, take a final export, restore it, switch the domain, then unpublish on Lovable. Your Lovable subscription keeps billing until you change it.
Can you go back to Lovable afterwards?
Yes, in two ways. If you keep Git sync connected, nothing changes: Lovable keeps editing the same repository while another host serves the live app, which Lovable calls the hybrid setup. If you disconnect, Lovable deletes no code on either side and the project keeps working in Lovable. Be careful about disconnecting casually, though: Lovable's GitHub page says reconnecting creates a new repository rather than reusing the old one.
What you cannot do is link Git sync to a repository Lovable did not create. To bring outside code in, Lovable's import feature takes a ZIP of up to 250 MB (Import project to Lovable, then Upload code), rebuilds it on TanStack Start and moves the data to Lovable Cloud. Imported users keep their records but set a new password. Migrating from your own Supabase back into Lovable Cloud is not supported.
Common problems and fixes
The ZIP button is missing or greyed out. Download codebase needs a paid plan and edit access, and Enterprise admins can restrict it. Connect GitHub instead; it works on Free.
Blank page or 404 when you refresh a page on your new host. On a React + Vite project the host is not sending every route to /index.html. Add the fallback rule above. On TanStack Start, check that you are running the server and not serving files.
The app loads but shows no data, or sign-in fails. The VITE_SUPABASE_* (or SUPABASE_*) variables are missing on the host, or you changed them without rebuilding. If sign-in redirects fail, add the new address to the allowed redirect URLs in your backend.
Features that called an API stopped working. Secrets do not travel with the code. Add each one to the new backend.
The build fails. Use Node 22 and install with npm ci so the versions match the lock file. If only bun.lock exists, build with Bun. If the error appears inside Lovable, its docs suggest Try to fix once or twice, then investigating. If Lovable itself is misbehaving, check Lovable's status and Supabase's status.
GitHub stopped syncing. Deleting the repository breaks the link; renaming it does not. Transferring it to another account keeps sync only if your workspace has a GitHub connection for the new owner.
When to keep the exported code, and when to rebuild
Keep the export if the app works, your users are on it and what you want is ownership, cheaper hosting or a coding agent. The code is standard React on open-source tools, and the steps above get it running anywhere.
Rebuilding is worth considering when the app keeps breaking as it grows, when you need things the backend was not designed for, or when you want an app an agent can extend safely with tests and clear conventions. That is the case we built RailsFast for: a starter app on Ruby on Rails, a long-established web framework, with login, payments, email and deploys already set up for a coding agent to build on. Either way, export your database first; the data is the part you cannot rebuild.
Frequently asked questions
How do I export a Lovable project?
Connect the project to GitHub in Project settings → Git → GitHub, which works on every plan and keeps a synced copy of the code in a private repository. On a paid plan you can also click Download codebase in the Code tab to get a ZIP. Export the database separately from More → Database.
How do I download Lovable project code for free?
Connect GitHub, which Lovable allows on the free plan, then open the repository on GitHub and use Code → Download ZIP. The Download codebase button inside Lovable needs a paid plan, but the files are the same.
Does downloading a Lovable project include the database?
The code includes the database structure in supabase/migrations/, not the data. To take the rows and user accounts, export the database from More → Database → Manage → Settings, which produces a .backup file you restore with pg_restore. Uploaded files and secrets need to be moved separately.
Can I run a Lovable project locally?
Yes. Clone or unzip the project, install Node.js, run npm ci and then npm run dev, and open the address it prints. Your local copy uses the same backend as the live app unless you change .env, so test with fake data.
Do I own the code Lovable generates?
Lovable's docs say you own the apps, code and content you create, subject to the licenses of the open-source packages inside it. You can change it, use it commercially and host it anywhere.
Can I connect Lovable to an existing GitHub repository?
No. Git sync always creates a new repository and cannot link to one that already exists. To bring existing code into Lovable, download it as a ZIP and use the import feature's Upload code option, then connect Git sync to the new project.
What happens to my app on Lovable after I export it?
Nothing. Downloading or syncing does not remove anything, and your published app keeps running on Lovable until you unpublish it. Your subscription also keeps billing until you change it.
How do I remove "Edit with Lovable" from my site?
On a paid plan, turn it off per project in Project settings → Publishing. Lovable says the badge disappears from the live site right away, with no republish needed.
Sources
All pages fetched on November 30, 2026.
- Lovable docs index: https://docs.lovable.dev/llms.txt
- View and edit your project's code (Download codebase): https://docs.lovable.dev/features/code-mode
- Sync your Lovable project with GitHub: https://docs.lovable.dev/integrations/github
- Git sync overview (GitHub, GitLab, Bitbucket): https://docs.lovable.dev/integrations/git-sync-overview
- Deployment, hosting and ownership options: https://docs.lovable.dev/tips-tricks/deployment-hosting-ownership
- Deploying and hosting outside Lovable: https://docs.lovable.dev/tips-tricks/external-deployment-hosting
- Back up, restore and export your database: https://docs.lovable.dev/features/database-backups
- Built-in backend (Lovable Cloud): https://docs.lovable.dev/features/cloud
- Connect to Supabase: https://docs.lovable.dev/integrations/supabase
- Secrets: https://docs.lovable.dev/features/secrets
- Edge functions: https://docs.lovable.dev/features/edge-functions
- Custom domains: https://docs.lovable.dev/features/custom-domain
- Subscription plans: https://docs.lovable.dev/introduction/subscription-plans
- Import a project: https://docs.lovable.dev/features/projects/import-project
- Upgrade to TanStack Start: https://docs.lovable.dev/features/upgrade-to-tanstack-start
- Lovable FAQ: https://docs.lovable.dev/introduction/faq
- Supabase backup and restore: https://supabase.com/docs/guides/platform/migrating-within-supabase/backup-restore
- Supabase deploy Edge Functions: https://supabase.com/docs/guides/functions/deploy
- Vite getting started: https://vite.dev/guide/
- TanStack Start build from scratch: https://tanstack.com/start/latest/docs/framework/react/build-from-scratch