Move from Lovable to Codex, step by step
Move your Lovable code to your own GitHub repository and continue building with OpenAI Codex, in the Codex app or in the terminal. The steps follow your app, including hosting and database changes if needed.
What you'll do during the migration
Your migration is split into four stages, with step-by-step instructions, detailed explanations and practical examples.
Your setup
Tell us what your app uses and where you want it to run.
Preparation
Get GitHub, Node.js and Codex ready, plus anything else your app needs.
Migration
Follow 6 to 19 steps, depending on your app. Each shows you what to do and how to check it worked.
- Push the project to GitHubConnect the Lovable project to GitHub and let Lovable create the repository.
- Get your code onto your computerCopy the private repository to a folder on your computer.
- Open the project in the Codex appAdd the project folder to the Codex app and start a thread in it.
- Run your app on your computerInstall what the app needs and start it on your computer.
- Open the project in CodexStart Codex in the project folder in a terminal.
- Back up your databaseMake a copy of your Supabase database before you change anything.
- Check where your backend runsFind out if the app uses its own Supabase project or Lovable Cloud.
- Set up your own Supabase projectCreate a Supabase project you own for the backend that leaves Lovable Cloud.
- Move your databaseCreate your tables in the new project and copy the data from Lovable Cloud.
- Move user accountsUser accounts move with the database. Users keep their passwords and only sign in again.
- Copy uploaded filesCreate the same storage buckets and copy the uploaded files into them.
- Point the app at your new Supabase projectChange the address and the public key in the .env file to the new project.
- Set up your Supabase Edge FunctionsDeploy your edge functions with the Supabase CLI and add their secrets.
- Set up your AI and payment keysAdd the AI and payment keys your edge functions need. If the backend moves, move the payment webhook too.
- Keep secret keys out of .envCheck that the .env file holds only public values before you push it to GitHub.
- Tell Codex about your projectCodex writes an AGENTS.md, a short note it reads at the start of every session.
- Send your changes to GitHubPush your changes so the new host builds the latest code.
- Deploy to VercelImport the GitHub repository in Vercel and deploy it.
- Deploy to CloudflareCreate a Cloudflare Pages project from the GitHub repository and deploy it.
- Run your app on your own serverCodex deploys the app on your VPS through PanelAlpha Engine, with HTTPS.
- Deploy every push automaticallyAdd a GitHub webhook so every push deploys the app on your VPS.
- Make logins work on your new addressAdd the new address to the login settings, so logins do not send people back to Lovable.
- Make logins work on your computerAdd your local address to the login settings, so links in login emails work on your computer.
- Point your domain to the new hostChange your domain's DNS records so the domain opens the new host.
- Keep your code in sync with LovablePull before you work and push when you finish, so Lovable and Codex stay in sync.
- Disconnect LovableTurn off the GitHub sync in Lovable so it cannot overwrite your work.
Final check
Test everything before switching. Your Lovable app stays online until you're ready.
What the steps look like








What you can and can't migrate from Lovable
Comes with your code
- Your frontend code
- Supabase migrations and Edge Functions saved in your repo
- Images and other static files
You'll set this up
- Your app settings and API keys in a .env file
- An AGENTS.md file to help Codex understand your project
Stays with Lovable
- The visual editor and AI chat
- Lovable hosting (your app stays online until you move it)
- Lovable's one-click publishing
How is Codex different from Lovable?
Full comparisonPrices checked on 15 October 2026. Both change often, so check the pricing pages before you decide.
| Lovable | Codex | |
|---|---|---|
| What it is | An app builder in the browser | A coding agent from OpenAI |
| Where it runs | In the browser | The Codex app, the terminal or your code editor |
| Where the code lives | In Lovable, synced to GitHub | In a folder on your computer and in your GitHub repo |
| Hosting | Included, at a lovable.app address | Not included. You pick a host |
| Backend | Lovable Cloud (built on Supabase) or your own Supabase | None. You keep the backend you have |
| Notes for the AI | Project knowledge in the settings, or AGENTS.md in the repo | AGENTS.md |
| Price | Free plan with daily credits. Pro $25 a month, or $21 billed yearly | Included in every ChatGPT plan, also the free one. Plus is $20 a month. Or an OpenAI API key |
Common problems
The app loads but cannot reach Supabase
Fix: The .env file is missing or the variable names are wrong. Compare them with the ones in the Supabase dashboard under Project Settings, API Keys. Restart the dev server after changing .env.
Login redirects back to the Lovable URL
Fix: Supabase still has the Lovable address as Site URL. Add your local address (the one the dev server prints) to Redirect URLs in Authentication, URL Configuration.
npm install fails
Fix: Check the Node version. Lovable projects expect a current LTS. Delete node_modules and the lock file, then install again.
Codex stops and asks for approval
Fix: Codex asks before it works outside the project folder or goes online, for example for npm install. Read what it wants to run, then approve it.
Lovable overwrites your local changes
Fix: The GitHub sync is still on. Either pull before each session and push after, or disconnect GitHub in Lovable when you are done with it.
Questions
Do I need to code?
No. In the Codex app you only paste prompts. In the terminal you also run a few commands. Codex writes the code.
Does the app go offline during the move?
No. It keeps running on Lovable until you turn hosting off yourself.
Should I use Codex or stay on Lovable?
Stay on Lovable if the visual editor does what you need. Move to Codex when you want the code in your own GitHub repository and an AI that edits it on your computer, in the Codex app or the terminal. You can also use both: Lovable and Codex edit the same code through GitHub.
Will I lose my data?
No. Nothing in the guide deletes data. If your plan moves the database, you copy it and the original stays where it is. Export a backup first anyway.
How many steps will I have?
It depends on your app. A simple site that stays on Lovable has 6. An app that leaves Lovable with its data, logins and domain has up to 19. Your plan only shows the steps that apply to you.
Can I go back to Lovable?
Yes. As long as the GitHub sync is connected, Lovable pulls your commits. If you disconnected it, Lovable cannot connect to the same repository again. It creates a new repository, and you move your newer code into it.
What do I need to use Codex?
A ChatGPT plan that includes Codex, or an OpenAI API key. The preparation steps show how to sign in.
Is Codex free?
Codex is included in every ChatGPT plan, also the free one. Plus is $20 a month. You can also use an OpenAI API key. Prices checked on 14 October 2026.
Where do I tell Codex how my project works?
In an AGENTS.md file in the project folder. Codex reads it before it starts work. The steps help you write one.