How to export a Replit project gets a one-line answer in Replit’s docs: open the three-dot menu at the top of the file tree and choose Download as zip. That gets the code. The production database, the files in App Storage and the values in Secrets come out other ways, and a project copy carries none of them.
How to export a Replit project: four parts, four ways out
A Replit export is four jobs, because the app lives in four places: the code in the file tree, the data in a Postgres database, uploaded files in App Storage, and keys in Secrets. To export a Replit project whole, take each part out its own way and leave the code for last.
Moving a project into another Replit account, or deciding whether to leave Replit at all, is a separate decision, set out in moving a Replit project to accounts you own. What follows is the export itself: what comes out, by which route, and what to check before anything on Replit is switched off.
| Part | Where it lives on Replit | The documented way out | What that way leaves behind |
|---|---|---|---|
| Code and project files | The file tree in the Project Editor | The three-dot menu at the top of the file tree, then Download as zip; zip -r in the Shell if that download fails | Secrets, the database and the deployment configuration |
| Database | A development database for building, and a production database Replit creates when you publish | Production: any PostgreSQL-compatible client, using the connection string from the production database’s Settings tab | The development database, which is only accessible from within the app |
| Uploaded files | App Storage (formerly Object Storage), powered by Google Cloud Storage | The download icon to the right of each file in the Objects view; the App Storage SDK or a Google Cloud Storage client library for many files | A bulk download button: not stated in Replit’s docs |
| Secrets | The Secrets tool in the project, plus linked Account Secrets | Edit as JSON or Edit as .env, from the menu in the Secrets header | Production app secrets, which sit in the Publishing settings |
A Replit export of an app is those four jobs, and the order changes how safe it is. We’d take the code last. The other three lean on the project still being there: a script that copies the bucket runs inside the app, the production database’s connection string sits in the Database tool, and the secret values sit in the Secrets tool and the Publishing settings. The zip can be taken again at any point while the project exists, so a final download or push picks up whatever changed during the move.
Why the zip alone is not the app
A zip is the project’s files on the day you took it. The people using the app wrote their records to the production database and their uploads to App Storage, and the keys that connect the app to payments, email or AI providers sit in Secrets. Replit’s own help page, on copying a project to another account, says to “set up secrets, the database, and deployment configuration in the new project” because “those aren’t included in the copy.”
Replit’s recovery tools don’t close that gap, because every restore they offer happens inside Replit. Replit’s data recovery page gives the development database checkpoint rollback with up to 7 days of history on all plans, and the production database point-in-time restore with up to 7 days on Core and up to 28 days on Pro and Enterprise, 7 days by default (read 20 October 2026). The same page warns that restoring your database doesn’t restore your app’s code, and rolling back your app doesn’t restore your database.
When the export is for a moment that cannot go wrong, such as a developer leaving, a buyer or investor asking for the code, or a move with real users’ data in it, start with a free audit: a 30-minute video call with nothing to prepare, where we weigh up with you which parts your app depends on and the order to take them out. In our Production Hardening Sprint, the application ends up in a version-controlled repository and on a hosting account the founder controls, deployable through a documented pipeline, independent of the tool that generated it.
Export code from Replit: Download as zip
Code comes out of Replit as a zip: Download as zip sits in the three-dot menu above the file tree. If that download fails on a large project, run zip in the Shell and download the archive from the file tree.
How to export Replit code from a large project is where the Shell command earns its place. Replit’s projects and files page gives the short form, zip -r project.zip ., and Replit’s guide to copying a project by hand adds exclusions, because the .cache folder holds internal Replit state, including cached secret values, and Replit says to always exclude it from zip files you create manually.
zip -r project.zip . -x ".cache/*" "node_modules/*" ".venv/*" "venv/*" ".pythonlibs/*" "build/*" "target/*" ".next/*" "__pycache__/*"
The other folders in that list are ones Replit can rebuild on its own, and leaving them out makes the archive smaller, which matters if it goes back into Replit, because ZIP import rejects files over 200 MB. The file appears in the tree as project.zip; open the three-dot menu next to it and select Download.
To export an app from Replit, you download its project: Replit’s help page asks “How do I download or export a Replit project?” and gives the same zip for both. The zip holds everything on disk, uncommitted changes included, and it carries the commit history only when the .git folder is inside it. In a team workspace, an admin setting called Ban source code export blocks the zip download, so ask the workspace admin before you plan around it.
To export every app from Replit in one go, check your account settings before you count on it: an export of all your apps at once is not stated in Replit’s current docs, and the changelog page from 2024 that announced account-level bulk exports now returns a 404. Plan on one project at a time. A mobile app is the one case with a different end point: Expo is what Agent uses to build mobile apps on Replit, Replit’s mobile docs say “EAS CLI and EAS Build are not supported on Replit”, and the store side has its own route, set out in what Replit does for a mobile app.
Connect Replit to GitHub with the Git pane
A GitHub connection keeps the exported code current, where a zip is a copy from one day. Replit’s Git pane initializes the repository, connects it to GitHub, and stages, commits and pushes changes; a token saved in Secrets for pushes can potentially be reached by anyone with access to the app.
How to connect Replit to GitHub comes down to two links, per Replit’s help page: your GitHub account to your Replit account’s connected services, then the project to a repository through the Git tool, with auto-sync turned on in the Git pane for two-way syncing. Replit’s Git interface documentation describes the pane in stages rather than as a full set of button labels, so treat the list below as the shape of the flow and follow the pane’s own wording where it differs.
- 01 In the Project Editor, select Tools, then Git under Setup.
- 02 Select Initialize Git Repository if the project has none, then connect it to GitHub as the Git provider.
- 03 Review the edited files in the Review Changes section.
- 04 Stage the files for the next commit and commit them with a message that says what changed.
- 05 Push the commits to the remote repository.
For pushes from the Shell to a GitHub.com repository, Replit says to use a personal access token instead of your password; to avoid re-entering it, you can store it as a secret with the key GIT_URL and the value https://<username>:<token>@<git-host>/<owner>/<repository>, then run git push $GIT_URL. The same page warns that when using credential secrets, anyone with access to your Replit App can potentially access your Git credentials. We’d use a fine-grained token that can reach only the one repository, and retire it once the move is done.
Before the first push, look for keys in the code itself. We audited 21 third-party apps in June and July 2026, and three of them had a real secret permanently in git history: a webhook signing secret, a live AI-provider key, and a Stripe test key with its webhook secret. Those 21 were a selected set of apps, not a random sample, so read the three as a pattern to look for in your own repository rather than as a rate for AI-built apps. A key written into a source file goes to GitHub with the push that includes it and stays in the history after the line is deleted, which is why the fourth check below searches the history as well as the current files.
A GitHub repository you own is where independent hosting starts, and a release path for a small team is the layer that goes on top of it.
How to export a database from Replit: dump the production one
The Replit database to export is the production one, which stores the live data. It usually exists once the app is published, and any PostgreSQL-compatible client, pg_dump included, connects to it from outside Replit with the connection string from its Settings tab; the development database is only accessible from within the app.
Replit’s development and production databases page says every Replit App works with two databases: the development database, where you and Agent experiment while building, and the production database, which stores the live data that powers your published app. On current infrastructure, Replit automatically creates the production database when you publish, provided the development database contains data; apps on a legacy Neon development database create it from the publish settings. An app that has never been published has no production database to dump, so confirm that one exists before anything else.
Inside Replit’s Shell, $DATABASE_URL points at the development database, and Replit’s copy guide notes that the live data is usually in the production database instead. From your own machine, open the Database tool, select the production database and copy the connection string from its Settings tab; Replit’s connection details page says any PostgreSQL-compatible SQL client can connect with it.
pg_dump "<production connection string>" -Fc -f replit-production.dump
In pg_dump’s documentation, -Fc outputs a custom-format archive suitable for input into pg_restore, and -f sends the output to the named file. The same page says pg_dump cannot dump from a server newer than its own major version, and Replit’s docs give PostgreSQL 16 for its databases, so use a local pg_dump of version 16 or later. Keep the connection string exactly as Replit gives it; the example in Replit’s docs ends in ?sslmode=require. The string works like a password, and if it leaks during the move, Replit’s docs say to regenerate the production database credentials, after which existing connection strings stop working immediately.
The same split between the two databases decides more than the export, and where a Replit app’s data actually sits looks at it as a launch question.
Restore the dump before you trust it
A dump that has never been restored is an assumption. Load it into an empty Postgres database with pg_restore --no-owner --no-privileges -d "<new database connection string>" replit-production.dump. In PostgreSQL’s docs, --no-owner skips the commands that set ownership of objects to match the original database, --no-privileges prevents restoration of access privileges, and for a custom-format archive the ownership option belongs on the restore, since pg_dump ignores it when it writes an archive. Then compare the row counts of every table and a few representative rows with production.
The file holds a full copy of your users’ data. Replit’s copy guide says never to commit database dumps to the repository, and to remove the dump from your device once the new copy has proved itself. The routine that keeps the new home’s data safe from then on is in a database backup checklist for startups, which also explains how backups work in general. The same question on another builder is answered in exporting a Lovable Cloud database.
Download files from Replit App Storage
App Storage files leave Replit one at a time through the download icon in the Objects view. For a whole bucket the route is code: the App Storage SDK for JavaScript or Python, or the Google Cloud Storage client library, run from the Replit app while it still exists.
Replit’s App Storage documentation still sits at an object-storage address, because the product was called Object Storage before the rename, and it is powered by Google Cloud Storage. The tool lets an app share data between its development and production environments, so the files your users uploaded can sit in a bucket the workspace shows. The Objects view has Upload folder for getting files in, but downloads go file by file.
For anything beyond a handful of files, start from the tool’s Commands view, which shows ready-to-use code for uploading, downloading, listing and deleting objects, in JavaScript, Python or other languages. A short script that lists every object and downloads each one has to run inside the app, because the App Storage libraries authenticate from there, so run it before anything is unpublished or deleted. Count the files and add up their sizes on both sides before you call it done. Across accounts, Replit’s copy guide is plain that buckets don’t move: download the objects and upload them to a new bucket.
Export the Secrets from Replit, then rotate them
Secrets come out of Replit as one list: the menu in the Secrets header offers Edit as JSON or Edit as .env, which shows the project’s secrets together. Production app secrets and Account Secrets are kept elsewhere, so check both, then rotate every value once the move is done.
Replit’s Secrets documentation puts the project’s list under Tools, then Secrets under Setup, and warns that bulk editing replaces the project’s existing secrets, so copy from that view and close it without saving. Two other places can hold keys the app depends on. Production app secrets sit in Publishing, under Adjust settings, and Replit keeps the development and deployment sets separate by design. Account Secrets live in Account Settings and are linked to a project with Link Account Secrets, so a key the app relies on may come from there.
Every value you paste into a file now lives in a second place, often a laptop folder that syncs to the cloud. Rotate each one once the move settles. Values that belong to Replit-managed services, such as the DATABASE_URL that Replit created for its own database, are not worth copying at all: they get replaced at the destination. The provider accounts behind the other keys (database, email, payments, AI) should be in the business’s name, which is the subject of moving provider accounts into your name, and what Replit secures for your app is a question of its own.
What still will not run once the four parts are out
Files, a dump, a bucket and a list of keys do not start the app. Four pieces of a Replit app only work on Replit, and each needs a replacement at the new host.
| Piece | What it does on Replit | What replaces it elsewhere |
|---|---|---|
The .replit file, with replit.nix | Sets the command the Run button executes and, under [deployment], the command that starts the app when published; replit.nix lists system packages through Nix | A start command and system packages written for the new host |
| Deployment configuration | Publishing settings, which a copy of the project does not include | The new host’s own build and deploy settings |
| Replit Auth | Signs users in through Replit’s own login system, on a Replit-branded page | A sign-in provider in your own accounts, plus a plan for moving existing users |
DATABASE_URL in Secrets | Points the app at Replit’s database | The connection string of the restored database at the new host |
Replit’s docs on the .replit file say it and replit.nix are hidden in the Project Editor by default, so they are easy to miss before the export. Code that reads Replit’s predefined variables, such as REPLIT_DEPLOYMENT or REPLIT_DOMAINS, gets nothing on another host, because Replit sets them automatically. Replit’s Auth page says that someone signing in to a Replit Auth app is creating or using a Replit account, so each user’s login sits with Replit rather than with your app. Integrations added under Tools, then Connectors save their API keys as secrets, and each one is reconnected at the destination.
Getting all of that running on your own repository and hosting, with a fresh-clone test, is the job of self-hosting an exported app. If the destination is Vercel, moving a Replit app to Vercel covers that route, and which AI builders let you export your code sets this export beside the other builders.
How to check the export is complete
A Replit export is complete when six checks pass: a fresh clone starts with no Replit step, the restored database matches production’s counts, the file count matches the bucket, no key sits in git history, every secret has a home, and a test user sees only their own data.
The checks draw on Replit’s, PostgreSQL’s and Stripe’s documentation and are written for your own export; none of them was run for this article. Each one names the evidence to keep, so the result can be shown to someone else later.
- 01 Clone the GitHub repository into an empty folder, install the dependencies and start the app with no Replit step. Keep the commands and the start log.
- 02 Restore the dump into an empty database and compare the row counts of every table with production. Keep both sets of counts with the date.
- 03 Compare the number and total size of the App Storage files you copied with the bucket. Keep both figures.
- 04 Search the repository and its full history for key prefixes such as sk_live_ and expect no match. Keep the search output.
- 05 Confirm every name in the Secrets list exists at the destination and every Replit-managed key has a replacement. Keep the list of names, without values.
- 06 Sign in to the new copy with a test account and confirm it sees only its own data. Keep a screenshot and the date.
A takeover with more than one builder or developer involved needs a longer list, kept in taking over an app someone else built.
The first two checks are how our Production Hardening Sprint verifies two of its deliverables. Deliverable 7.11, Independent repository and hosting, is verified by deploying a fresh clone to staging through the pipeline with no step that depends on the generating tool. Deliverable 4.7, Verified backups and restore, is verified by restoring a backup into an isolated environment and checking representative data integrity.
Common questions about getting an app out of Replit
Which database is used by Replit?
Replit uses PostgreSQL. Every Replit App works with two databases, a development database for building and a production database that stores the live data of the published app; since December 4, 2025, new development databases run on Helium, Replit’s own infrastructure on PostgreSQL 16, while production databases are billed through Neon, a serverless database provider.
Can Replit be self-hosted?
No, not Replit itself: Replit’s docs say Full BYOC, in private preview, “does not mean an air-gapped or entirely self-hosted Replit installation.” An app built on Replit is different: once its code, database, files and secrets are exported, it can run on your own hosting after its start command, database connection and secrets are set up there, and Replit’s Image Exports, in early access for enterprise customers, produce a Docker image, a Terraform file and a software bill of materials when you publish.
How do I export a Replit file?
Open the three-dot menu next to the file in the file tree and select Download; Replit’s guide to copying a project uses that control to download a zip and a database dump. To take every file at once, choose Download as zip from the three-dot menu at the top of the file tree.
When should I get help moving an app and its data off Replit?
Get help when the production database or App Storage holds real users’ data, when the export is for a developer handover or a buyer, or when Replit Auth signs your users in and has to be replaced. AxonBuild can talk the move through with you on a free audit, a 30-minute video call with no code access needed, and help you set the order for taking each part out.
Moving your app off Replit soon?
Leaving Replit goes wrong when the database, uploaded files or keys get left behind, and your users notice first. On the audit, we go through what your app depends on and where each part lives today. You leave with an order for the move and the gaps to close before you switch.
Book a free audit →
Free · 30 minutes · No code access needed