November 22, 2026 · 9 min read · Thomas Osayi
How to move a Replit app to Vercel: code, env vars, database and build settings
A step by step guide to moving an app built with Replit Agent to Vercel: exporting the code, moving secrets, getting data out of the Replit database and fixing the build.
Replit is a fast way to get an app running. Replit Agent writes the code, the workspace runs it, and publishing puts it online without touching a terminal. Then the app starts to matter, and people want things Replit makes less obvious: a normal GitHub workflow, preview links for every change, a host their next developer already knows, or simply having all of their app in places they control.
Moving to Vercel is very doable, but it is more than uploading files. A Replit app usually depends on its database, its secrets and a long-running server in ways that only show up after the move. Here is the full process, in the order I would do it.
Can I move a Replit app to Vercel?
Yes, if the app is a web frontend with an API that answers requests and finishes, which describes most apps built with Replit Agent.
Vercel runs your frontend as static files on its network and your backend as serverless functions. A function starts when a request arrives, handles it and stops. That model fits dashboards, booking tools, internal tools, AI wrappers and most SaaS MVPs.
It does not fit everything. These kinds of apps are better on a host that keeps a server running all the time, such as Railway, Render or Fly.io, or on Replit itself:
- Discord or Telegram bots that hold a connection open.
- Apps built around WebSockets for live chat or multiplayer features.
- Background workers that loop forever, poll a queue or run long jobs.
- Apps that write files to local disk and read them back later.
If your app is mostly in the first group with one exception, like a nightly job, you can still move it and use Vercel Cron Jobs for the job. If the server's main purpose is staying connected, stay put or pick a different host.
How do I get my code out of Replit?
Download the project as a zip, or connect it to GitHub through Replit's Git tool, and push it to a repository Vercel can read.
Replit's documentation describes both. For a zip, open the three-dot menu at the top of the file tree and choose Download as zip. If the download fails on a large project, the docs suggest opening the Shell, running zip -r project.zip . and downloading that file from the file tree.
For GitHub, link your GitHub account in your Replit account's connected services, open the Git tool in the project and connect a repository. Auto-sync in the Git pane keeps both sides in step, which is useful if you want to keep editing on Replit for a while after the move.
I prefer GitHub, because Vercel deploys from a repository anyway, and the history shows exactly what changed.
Before the first push, clean up:
- Make sure .env files and anything holding secrets are in .gitignore.
- Leave node_modules out of the repository.
- Note the files that only make sense on Replit, such as .replit and replit.nix. They do no harm on Vercel, but they describe how the app runs, so read them before deleting. The run command in .replit tells you how the app starts.
What does a typical Replit app need changed?
Expect to adjust how the server starts, how static files are served, and any Replit specific packages.
A common shape for a full stack app from Replit Agent is a React frontend built with Vite in one folder, an Express server in another, shared types between them, and an ORM such as Drizzle talking to Postgres. In development the Express server often serves the Vite app too, all on one port.
On Vercel, these are the changes that come up:
- Express entry point. Vercel's Express docs say it detects a file that imports express at locations such as app.ts, index.ts, server.ts, src/index.ts or src/server.ts. The file must export the app as a default export or use app.listen. If your server lives at server/index.ts, you may need to point to it or move it.
- Static files. Vercel's docs state that express.static is ignored on Vercel. Static assets go in a public folder, or you deploy the Vite build as the frontend and let Express handle only the API routes.
- Replit specific Vite plugins. Some projects include development plugins from Replit in vite.config.ts. Remove them, or load them only when running on Replit, if the build fails on them.
- Port and host. Hard-coded ports and 0.0.0.0 bindings matter less on Vercel, but check nothing depends on them.
For apps where the frontend and backend are tangled together, it is often cleaner to split them: the Vite frontend on Vercel and the API as Vercel functions under an api folder.
Which build settings do I use on Vercel?
Import the repository in Vercel, choose the framework preset that matches your frontend, and confirm the build command and output folder.
For a Vite frontend the usual values are:
- Framework preset: Vite.
- Build command: npm run build, or whatever the build script in package.json says.
- Output directory: dist, unless vite.config.ts sets a different outDir. Some Replit templates build into dist/public, so check.
- Root directory: the repository root, or the client folder if the frontend lives in a subfolder with its own package.json.
- Node.js version: set it in project settings to match what ran on Replit.
Run npm run build on your own computer first. If it fails locally, it will fail on Vercel, and the local error is easier to read. Type errors are a common surprise, because the Replit dev server runs code without a strict type check while a production build may stop on the first error. "Vercel build failed? The most common Next.js deploy errors and fixes" covers many of the same errors for Next.js projects.
If your app uses client-side routing, add a rewrite so deep links do not 404 on refresh. Vercel's Vite docs give the vercel.json rewrite for that.
How do I move my secrets and environment variables?
Copy every value from Replit's Secrets into Vercel's Environment Variables, check which ones the browser needs, and redeploy.
Open the Secrets tool on Replit and list every key. Then in Vercel go to Project Settings, Environment Variables and add each one. Decide for each whether it applies to Production, Preview, Development or all of them. Live Stripe keys usually belong only in Production, with test keys in Preview.
Three rules prevent most problems:
- In a Vite frontend, only variables prefixed with VITE_ are available in browser code, and anything with that prefix is visible to every visitor. Secret keys must never carry it.
- Some values were set by Replit automatically and never appeared in your Secrets list. DATABASE_URL on current Replit databases is the main one. You will create a new one for the new database.
- Environment variable changes apply to new deployments, so redeploy after adding or changing values.
What do I do about the database?
Plan the database move first, because it is the part you cannot redo easily, and current Replit databases are not reachable from outside the app.
Replit's documentation describes the current setup. New development databases run on Replit's own PostgreSQL infrastructure, called Helium, on PostgreSQL 16, and are only accessible from within your app. Older databases ran on Neon, and Replit's upgrade moved them to Helium, keeping the old connection string as NEON_DATABASE_URL in Secrets. Published apps get a separate production database with its own DATABASE_URL.
So the usual path is:
- Create a database with a hosted Postgres provider such as Neon or Supabase, or one from the Vercel Marketplace.
- Recreate the schema. If the app uses Drizzle or Prisma, running its migrations or schema push against the new DATABASE_URL does this.
- Export the data from inside Replit. From the Replit Shell, where DATABASE_URL is already set, pg_dump can write a dump file if it is available. If not, a small script that reads each table and writes it out does the job. Remember the production database is separate from development, so export the one with real customer data.
- Import into the new database, check row counts table by table, then set the new DATABASE_URL in Vercel.
Replit's upgrade notes say Helium does not use SSL, while most hosted providers require it. If your code turns SSL off because it was needed on Replit, change that or the new connection will fail.
Older projects may also use the Replit key value store. That data needs a script that reads each key and writes it into a proper table.
What else breaks after the move?
Anything that relied on a server staying alive between requests, and anything tied to Replit itself.
- Sessions in memory. Express apps often use the default memory store for sessions. On serverless functions memory does not persist, so users get logged out at random. Store sessions in the database or use token based auth.
- File uploads. Files saved to a local uploads folder vanish. Use object storage such as Vercel Blob, Supabase Storage or S3.
- Scheduled work. A setInterval in the server never runs reliably. Use Vercel Cron Jobs calling an API route.
- Replit Auth and other Replit services. Anything that depends on the Replit platform needs a replacement, such as Supabase Auth, Clerk or Firebase Authentication.
- Error handling. Vercel's Express docs warn that unhandled errors can leave the function in a bad state, so add a proper error handler.
A worked example
Here is an illustration with a made-up app. A property manager built a maintenance request tracker with Replit Agent: tenants submit requests with photos, staff update statuses, and a daily email lists open jobs. It has a Vite React frontend, an Express API, Drizzle and a Replit Postgres database.
The move takes five steps. The project goes to GitHub through the Git tool. Photos move from a local uploads folder to object storage, and the existing ones are copied over. The production data is exported from the Replit Shell and imported into Neon, with row counts checked. The daily email moves from setInterval to a Vercel Cron Job. Sessions move from memory to the database. Secrets are recreated in Vercel, the build output folder is corrected to dist/public, and a rewrite fixes deep links. The old Replit app stays live until the new one has run cleanly for a week.
When is it worth hiring help?
When the app has real users and real data, because a broken migration loses customer records, not just time.
If the app is small and has no users yet, the steps above are a good weekend project. Once there are paying customers, I would rather run the export, test the import, and switch over on a quiet evening with a rollback plan. My Finish and Launch package, from $600 over ten days, covers moving a working app to production hosting with its database, environment variables and domain. If you only need one or two parts sorted, Fix Plus Features from $200 covers up to three fixes plus a small feature. "How to hand off your AI-built app to a developer" lists what to prepare.
The bottom line
Moving a Replit app to Vercel takes five jobs: get the code into GitHub, set the right build settings, recreate every secret as a Vercel environment variable, move the data out of the Replit database to a hosted Postgres provider, and replace anything that depended on a long-running server or on Replit itself. Do the database first, test the build locally, and keep the Replit version running until the Vercel one has proved itself. If the app is a bot or a WebSocket server, choose a host that keeps servers running instead.
Questions, answered in one line
How do I download my code from Replit?
Open the three-dot menu at the top of the file tree and choose Download as zip, or connect the project to a GitHub repository through the Git tool.
Can I keep using the Replit database after moving to Vercel?
Not reliably, because current Replit development databases are only reachable from inside the Replit app, so the usual path is to move the data to a hosted Postgres provider.
Will my Express server work on Vercel?
Usually yes, since Vercel detects Express entry files such as server.ts or src/index.ts and runs the app as one function, but express.static is ignored and in-memory state does not persist.
Do I need to change my code to move from Replit?
Usually a little: remove Replit specific plugins and config files, replace Replit Auth if you used it, and move file uploads and sessions to external services.
Is Vercel cheaper than Replit?
It depends on traffic and plan, so compare both pricing pages for your usage, but most people move for a custom setup, preview deployments and a standard Git workflow rather than price alone.
Can someone move my Replit app for me?
Thomas Osayi moves AI-built apps to production hosting through his Finish and Launch package, from $600 for apps whose core features already work.
Sources
- Projects and files: download as zip and Git Replit
- Database upgrade: from Neon to Helium Replit
- Production databases Replit
- Express on Vercel Vercel
- Vite on Vercel Vercel
Related articles
- Supabase auth redirect URL not working? Fix localhost, preview and production redirects
- Environment variables undefined on Vercel? Every cause and fix
- How to fix a CORS error on a Next.js API route
- Firestore "Missing or insufficient permissions": what triggers it and how to fix it
Fix, finish and launch your AI-built app
Built your app with Lovable, Bolt, v0, Replit or Cursor and got stuck? I fix the bugs, connect auth and payments, clean up the code and deploy it to production.
See the service