Replit

How to Export a Replit App and Deploy It on Vercel

Replit's hosting is fine for hobby projects but breaks down for real apps. Here is the exact migration path to Vercel.

TL;DR

Use Replit's Git integration to push your project to GitHub, then deploy from GitHub to Vercel. The hardest part is replacing Replit-specific environment hooks (Replit DB, Replit Auth) with real services like Postgres and Auth0 or Supabase.

What is actually happening

Replit projects often depend on Replit-specific services: Replit DB (a key-value store), Replit Auth (their hosted auth), Replit Secrets (their env var store). All of these have to be replaced with real services before the app can run anywhere else. Migration is about half code change, half service swap.

The fix, in order

Try these in sequence. Most apps are fixed by the first or second step.

  1. 1

    Connect Replit to GitHub and push

    In your Replit, click the Git icon in the left sidebar, then click 'Connect to GitHub'. Authorize, create a new repo, and click 'Commit & Push'. Once the repo is on GitHub, you have a real export.

  2. 2

    Replace Replit DB with a real database

    If your code uses '@replit/database', that is Replit DB and it does not exist outside Replit. Replace it with Supabase, Postgres, or even SQLite for small apps. You will need to write a small migration script to copy data out: install @replit/database in your local env, connect to your Replit DB with the connection URL, dump everything to JSON, then write the JSON to your new database.

  3. 3

    Replace Replit Auth with a real auth provider

    If your code calls 'Replit.auth' or relies on the X-Replit-User-Id header, that breaks the moment you leave Replit. Pick a real auth provider: Supabase Auth, Clerk, Auth0, or NextAuth. Each has good docs for migrating from a custom auth setup. Plan to spend half a day on this.

  4. 4

    Move env vars from Replit Secrets to a .env file

    In Replit, open the Secrets panel and copy each secret. Create a .env.local file in your local clone of the repo (do NOT commit it). Add the same secrets there for local dev. Add the same secrets to Vercel under Project Settings then Environment Variables for production.

  5. 5

    Deploy from GitHub to Vercel

    Go to vercel.com and import the GitHub repo. Vercel auto-detects most frameworks. Click Deploy. With env vars and the database connection updated, the build should succeed. Your app is now on Vercel with a real URL.

  6. 6

    Update DNS if you had a custom domain on Replit

    If your app was on a custom domain via Replit, you need to update DNS. In Vercel, go to your project, click Domains, and add the domain. Vercel gives you the DNS records to set. Update them at your registrar (Namecheap, Cloudflare, etc). Propagation usually takes under an hour.

When to stop debugging and get help

Replit Auth migrations are where most projects get stuck. The auth code is usually woven through every page, and replacing it cleanly requires knowing how to do auth properly. If you cannot get auth working in 4 hours, it is faster to hand it off than to keep fighting.

Stuck after trying these?

We do a $100 Quick Audit that pinpoints exactly what is wrong, why, and what it will take to fix. No sales call gating, no fluff.

Start a $100 Audit

Related fixes

Not sure exactly what is broken? Run a free scan and get a diagnosis in under 2 minutes.