How to export your Replit code and move off Replit
Last reviewed 25 November 2026
A developer is taking over, you want your own hosting, or you just want a copy you control. Getting the code out of Replit is quick. Your secrets, database, uploaded files, sign-in and domain are what take the real work.
Download the project as a zip from the three-dot menu above the file tree, or push it to GitHub from the Git tool. The code doesn’t bring your secrets, database, App Storage files, deployment or domain with it, and Replit’s own sign-in and connectors are tied to Replit. Export the production database separately, then set the rest up again at the new host before you move the domain.
Rather talk it through with someone? Tell us about your app →
First: protect what you have
Before you change anything, take copies you control. Even if you never leave Replit, these are worth having:
- A copy of the code, as a zip or on GitHub (both below).
- A copy of the live data. Your published app uses a separate production database, and that’s usually where the real customer data is.
- A list of everything the app uses on Replit: secrets, sign-in, connectors such as Stripe, App Storage files and your domain.
One security warning first. Replit keeps a hidden .cache folder in your project. Replit’s guide to copying projects says it holds internal Replit state, including cached secret values. If you ever make a zip yourself, always leave .cache out.
Step 1: get the code out
- Zip download. Open the three-dot menu at the top of the file tree and choose Download as zip. If that fails, Replit’s projects and files help suggests opening a Shell, running
zip -r project.zip ., then downloadingproject.zipfrom the file tree. That’s a zip you make yourself, so ask a developer to leave.cacheout of it. Replit’s copying guide calls a zip a one-time snapshot of everything on disk, including changes you haven’t saved to Git. - GitHub. Open Tools, then Git. If the project has no Git repository yet, choose Initialize Git Repository. A developer can then connect it from the Shell with
git remote add originandgit push origin. GitHub only gets the files you commit and push. See Replit’s Git guide.
For GitHub, Replit says to use a personal access token (a password-like key you create in GitHub) instead of your password. Be careful where you keep it. Replit warns that if you store Git credentials as a secret, anyone with access to your Replit App can potentially see them. Replit’s docs don’t cover creating the GitHub repository or choosing public or private, so make it private unless you have a reason not to.
Replit’s help text mentions an auto-sync option in the Git pane, but the Git guide doesn’t document it. Don’t rely on it as your backup. Push changes yourself and check they arrived.
If your zip is over 200 MB, it still downloads. The 200 MB limit only matters if you import the zip back into Replit.
What comes with the code, and what doesn’t
Replit says that when you copy a project, you have to set up secrets, the database and deployment settings again, because they aren’t included. The same goes for moving to another host.
| Part of your app | In the code? | What to do |
|---|---|---|
| App code | Yes | Zip or GitHub, as above |
| Start and build commands | Yes, in .replit | Copy them into the new host’s settings |
| Secrets and API keys | No | Set them again at the new host. Check both lists: the editor’s secrets and the published app’s Production app secrets |
| Settings Replit fills in | No | Replace values Replit sets for you, such as REPLIT_DOMAINS and DATABASE_URL |
| Database contents | No | Export the production database (Step 2) |
| App Storage files | No | Download them and upload them to new storage |
| Sign-in (Replit Auth or Clerk Auth) | No | Plan a new sign-in setup (see below) |
| Connectors such as Stripe | No | Use your own accounts and API keys |
| Live deployment and domain | No | Set up hosting again, then move the domain last |
Step 2: export the database
Replit gives your app two separate PostgreSQL databases. According to Replit’s production database guide, the published app uses the production database, while the editor keeps using the development one. This catches people out. Replit’s copying guide warns that its standard export command copies the development database, and your live data is usually in production.
Replit’s guide to working with your data gives three ways to export production:
- Database tool. Choose the production database, open My Data, pick a table and export it as CSV, JSON or XLSX. You repeat this for each table. It’s a good backup you can open yourself.
- Ask Agent. Replit gives a prompt that has Agent save each table as a CSV file, without changing the data.
- Shell. A developer copies the production connection string (the address and password the app uses to reach the database) from the database’s Settings tab and runs
pg_dump. This gives one SQL file with all tables that can be restored into another PostgreSQL database. This is the one to use for a move.
- The connection string includes your database password. Don’t paste it into a chat, ticket or screenshot.
- Exports are saved inside your project first. Replit says to download the file, then delete it. Very large databases can run out of space, so check the size under Database → Settings → Storage.
- Anything written after the export won’t be in the copy, so plan a quiet moment for the final export.
- Never commit the export to GitHub. Treat it like customer data.
Older apps may be set up differently. Until 4 December 2025, Replit hosted development databases on Neon. If an app’s DATABASE_URL contains neon.tech, it’s on the old setup. Replit’s docs don’t say where production databases run, so have a developer check which database your live app actually uses before exporting.
Sign-in, files and connectors
- Replit Auth. Replit’s Replit Auth page says that when someone signs in to your app, they are creating or using a Replit account. The docs don’t describe exporting those users or using Replit Auth anywhere else. Treat it as tied to Replit and plan a new sign-in setup.
- Clerk Auth on Replit. According to Replit’s Clerk page, your users live in a Clerk tenant (your app’s own user account space) that Replit manages and your app owns. Replit says you can replace its managed Clerk app with your own Clerk account. The docs don’t say whether existing users come with you, so ask Replit Support before you plan around it. Replit also has an Agent-led move from Replit Auth to Clerk Auth, but that still runs on Replit.
- App Storage (called Object Storage before). In the Objects view, you download files one at a time, or a developer fetches them in code. We found no bulk export in the docs. Replit’s copying guide says buckets (the storage containers) don’t move, so the files have to be downloaded and uploaded to new storage. See Replit’s App Storage guide.
- Connectors and built-in services. Replit’s integrations page says connections such as Stripe and GitHub are tied to your Replit account. Services Agent adds, such as image generation or voice, are paid from your Replit credits. Away from Replit, you need your own accounts and keys for each one.
Step 3: move without breaking things
Replit has no guide to moving to another host, so we’ve put this order together from its docs:
- Keep the Replit version running until the new one is proven.
- Copy the start and build commands. In
.replit, the deployment settings hold theruncommand (what starts the app) and thebuildcommand (what runs before it).replit.nixlists the system software the app needs. See Replit’s configuration guide. - Create a new PostgreSQL database and restore the export into it. Use a new, empty database so nothing old gets mixed in.
- Set every secret again, and replace the settings Replit filled in for you, such as
REPLIT_DOMAINS,REPLIT_DEPLOYMENT,REPLIT_DEV_DOMAIN,REPLIT_USERandDATABASE_URL. They’re listed in Replit’s secrets guide, and they won’t exist on the new host. - Replace sign-in and connectors with your own accounts.
- Upload your App Storage files to the new storage.
- Test everything on a temporary address: sign-up, sign-in, payments, emails and file uploads.
- Only then move your domain. Disconnect it in Replit under Publishing → Domains, link it at the new host and update your DNS records (the settings that point your domain at a server). Replit says a new address can take a few minutes to a few hours to work for everyone.
If you bought the domain through Replit, you can move it to another registrar (domain seller) by contacting Replit Support. ICANN rules mean you have to wait 60 days after purchase first. Replit renews purchased domains automatically unless you switch off Auto renewal in the Domains tool. See Replit’s domain guide.
Can’t export? Check your workspace settings
On Enterprise accounts, an admin can turn on a setting that stops members exporting source code as a zip. See Replit’s enterprise settings. If the zip option is missing in a company workspace, ask your admin.
When to get help
Downloading the code is the easy part. Moving live customer data, sign-in, payments and the domain without anyone noticing is where moves go wrong. Replit sign-in adds an extra step, because your users are Replit accounts. If real customers depend on the app, have a developer plan the move and check it first. If it’s already misbehaving on Replit, start with fixing Replit preview and publishing problems, or see how we fix AI-built apps. If you want someone to take the app over completely, see app rescue.
Questions founders ask
Can I download my Replit project as a zip?
Yes. Open the three-dot menu at the top of the file tree and choose Download as zip. If that fails, Replit suggests making the zip from the Shell and downloading it from the file tree. Leave the .cache folder out of any zip you make yourself. On Enterprise accounts, an admin can block zip exports.
Does the export include my secrets and data?
No. Secret values stay in the old project. The database, App Storage files and deployment settings have to be set up again. Export the production database separately, because that’s usually where your live data is.
Will my users’ logins move with the app?
Not automatically. With Replit Auth, your users sign in with Replit accounts, and Replit’s docs don’t describe exporting them. With Clerk Auth on Replit, the users sit in a Clerk tenant that Replit manages, and the docs don’t say whether they can be moved. Plan the sign-in move with a developer before you switch.
Should I use a zip or GitHub?
Use both if you can. A zip is a one-time snapshot of everything on disk. GitHub holds only what you commit and push, but gives you an ongoing copy a developer can work from. Whichever you use, never include the .cache folder or a database export.