Published on
How to move a Replit app to other hosting, with a custom domain and servers in Brazil
An app built on Replit can run outside Replit without a rewrite. The code goes to a GitHub repository you own through Replit’s own Git tool, and almost everything the new host asks for is already written in the .replit file: the runtime, the build and start commands, the port, and the variables. What does not move on its own are the Secrets, which never leave Replit, and the production PostgreSQL database, which you copy with pg_dump and pg_restore. Older apps still use the @neondatabase/serverless driver, which only works with Neon and has to be swapped for pg. Today, publishing permanently on Replit takes the Core plan, at US$ 20 per month, or R$ 114.74 with the PTAX rate of November 27, 2026 and the 3.5% IOF on international card purchases, and the production database is billed per active hour. Outside Replit, the same app runs on Render, Railway, Vercel, or Zenifra, where an app with managed PostgreSQL costs R$ 42.00 per month, billed in Brazilian reais, on servers in São Paulo. This guide covers what is tied to Replit, what each option costs, how to turn .replit into configuration, how to move the database, what to do with Replit Auth and App Storage, how to switch the domain, and the errors that come up most.
Can you take an app off Replit and host it somewhere else?
Yes. An app built by Replit Agent is a regular Node.js or Python project, with a package.json and lockfile or a requirements.txt, and the code is yours. To host it elsewhere, you link the project to a GitHub repository, connect that repository to a hosting platform, and copy over the settings that are already in the .replit file. The real work shows up in three places: Secrets, the production database, and the services that only exist inside Replit, such as Replit Auth.
People leave Replit for a few recurring reasons. The app became a product and the dollar bill, plus IOF, got hard to predict, because the plan’s monthly credit is shared between Agent and hosting. The production database is billed per active hour and grows with traffic. The company wants the code in a repository the team controls, with pull request reviews, or wants the app next to other services on a single platform. Paying in Brazilian reais, through PIX or boleto, without exchange rate swings also matters.
The path has four parts. First, the code goes to GitHub. Next, the new host receives the .replit settings and publishes the app on a test URL. Then, the production data is copied into a managed PostgreSQL database. Finally, your custom domain points to the new address. Until that last step, the app on Replit stays online, so you can test calmly and roll back if something does not work.
Prices in this guide were read on the official Replit, Vercel, Render, and Railway pages on November 28, 2026. The conversion uses the PTAX selling rate of November 27, 2026, published by the Central Bank of Brazil, at R$ 5.5430 per dollar, plus the 3.5% IOF on international card purchases. Zenifra’s prices come from its public plans API, checked on the same day. If you came from another AI app builder, the sister guide on moving a Lovable app follows the same route.
What does Replit create, and what stays tied to it?
The code is yours, but part of the infrastructure the app uses belongs to Replit and does not travel with the repository. Knowing what each piece is before you start avoids the most common migration surprise: the app comes up on the new host, the home page opens, and the first screen that reads from the database or asks for a sign-in fails.
The database deserves special attention, because Replit has two. The development database is the one the editor uses while you build, and since December 4, 2025 new development databases run on Replit’s own infrastructure, called Helium, with PostgreSQL 16. The production database is the one the published app uses, and for most apps it runs on Neon: the connection string contains neon.tech and an endpoint that starts with ep-. The production database is where your customers’ real data lives, so that is the one you copy.
Another point people forget is who applies schema changes. On Replit, when you publish, Replit compares the development and production databases, generates the SQL, and applies it before the new version goes live. Its docs say this only applies to databases Replit manages. Once the database moves out, that job becomes yours, as explained further down.
| Item | Where it lives on Replit | What happens in the migration |
|---|---|---|
| App code, front end and server | The Replit project | Goes to GitHub and runs on any platform with Node.js or Python |
The .replit file | Project root | Travels along and works as a map for runtime, commands, port, and variables |
| Secrets, such as API keys | The Secrets tool | Not pushed to GitHub; add them one by one on the new host |
| Development database | Replit’s own infrastructure (Helium) | Stays on Replit; it does not hold production data |
| Production database | Neon, for most apps | Copy with pg_dump and pg_restore into a managed PostgreSQL database |
| Migrations applied on Publish | Replit’s publishing flow | Become the responsibility of whoever deploys |
| Replit Auth | Visitors’ Replit accounts | Confirm whether it works outside Replit or switch to your own sign-in |
| App Storage | Replit’s file storage | Copy the files to S3-compatible storage |
| Scheduled Deployments | Replit | Recreate them as scheduled tasks on the new platform |
If your app uses Clerk Auth instead of Replit Auth, the situation is similar. Replit’s docs explain that Agent creates a Clerk tenant managed by Replit itself, with no Clerk account on your side, and ask you not to replace the keys by hand. Before migrating, check with Replit support how to take that tenant with you, or plan your own sign-in.
How much does it cost to publish an app on Replit today?
For an app with a custom domain that stays online permanently, the starting point is the Core plan, at US$ 20 per month, or US$ 18 per month billed annually. In November 2026, Replit closed the Starter plan to new builders, and people still on it get a single published app that goes down after 30 days and carries the Made with Replit badge. The former Teams plan is gone too, replaced by Pro, starting at US$ 100 per month for up to 15 builders.
The Core subscription includes a monthly credit, and publishing costs come out of it. The detail that weighs on the bill is that the same credit pays for Agent and the more powerful AI models. If you spend credit editing the app through chat, less is left for hosting, and anything beyond the credit is billed separately. On Core, unused credit does not roll over to the next month.
The app itself runs on one of four deployment types. Autoscale is the default: it charges a base fee plus usage while it serves requests, and it goes idle after 15 minutes without traffic, which makes the next first visit slower. Reserved VM is an always-on machine at a fixed price. Static only serves files and, according to Replit, is not compatible with apps built by Agent. Scheduled runs tasks at set times.
The production database has its own billing, per active hour and per storage. Replit counts the database as active while it receives queries and for 5 more minutes after the last one, then suspends it when idle. An app with few visits pays for few hours; an app queried all day gets close to the 730 hours in a month, and each hour costs US$ 0.16.
| Replit item | Official price | In BRL, with PTAX and 3.5% IOF | How it is billed |
|---|---|---|---|
| Core, monthly | US$ 20 per month | R$ 114.74 per month | Includes a monthly credit shared between AI and hosting |
| Core, annual | US$ 18 per month, billed yearly | R$ 103.27 per month | Same plan, up to 10% off |
| Pro | From US$ 100 per month, or US$ 90 billed annually | R$ 573.70 per month | Up to 15 builders; unused credit lasts two months |
| Autoscale | US$ 2 per month base fee, plus US$ 0.60 per million compute units and US$ 0.40 per million requests | R$ 11.47 per month base fee, plus usage | Bills while serving requests; goes idle after 15 minutes |
| Shared Reserved VM | 0.5 vCPU and 2 GB for US$ 15 per month | R$ 86.06 per month | Fixed price, always on |
| Dedicated Reserved VM | 1 vCPU and 4 GB for US$ 35 per month | R$ 200.80 per month | Fixed price, always on |
| Production PostgreSQL | US$ 0.16 per active hour and US$ 0.35 per GiB per month | R$ 0.92 per hour and R$ 2.01 per GiB | Suspends after 5 minutes without queries |
| Outbound data transfer | US$ 0.05 per GiB, with 100 GiB included on Core | R$ 0.29 per GiB | Only traffic leaving the app counts |
| Custom domain | No Replit charge; you pay your domain registrar | Depends on the registrar | HTTPS certificate issued by Replit |
A point in Replit’s favor: Autoscale, App Storage, data transfer, and database storage prices dropped in August 2026, and the publishing costs page has an interactive calculator. If your app has little traffic and you already pay for Core to use Agent, hosting may fit entirely in the credit.
How much does the same app cost outside Replit?
For a small app that already has customers, with an always-on Node.js server, a small PostgreSQL database, and a custom domain, the bill starts at US$ 5 to US$ 20 per month on the US platforms, before extra usage, or R$ 28.69 to R$ 114.74 with PTAX and IOF. On Zenifra, the same setup costs R$ 42.00 per month, in Brazilian reais. The table uses the cheapest plan on each platform that allows commercial use with a custom domain.
The billing models differ, and that changes how to read the table. Render charges a fixed amount per instance and per database. Railway charges a subscription that already includes a usage credit, and anything beyond it is billed per second of CPU and memory. Vercel runs the server as functions and has no PostgreSQL of its own in the plan, so the database comes from another vendor. On Replit, everything comes out of the same Core credit. On Zenifra, the app and the database have fixed prices per month, per hour, or per year.
Region matters too. Replit lets you choose South America as the publishing region on paid plans, but its docs warn that the choice is permanent: an app already published to North America cannot be moved. Render and Railway have no South America region. Vercel runs functions in Washington by default and offers São Paulo (gru1) as an option. Zenifra runs in São Paulo.
| Platform | Setup used | Price in US dollars | In BRL, with PTAX and 3.5% IOF | Note |
|---|---|---|---|---|
| Replit | Core, a 0.5 vCPU Reserved VM, and a production PostgreSQL database | US$ 20 per month while usage fits in the credit | From R$ 114.74 per month | The VM uses US$ 15 of the credit; each active database hour adds US$ 0.16 |
| Vercel | Pro, 1 seat, with a database from another vendor | US$ 20 per month, with US$ 20 of usage credit | R$ 114.74 per month, plus the database | Hobby is for personal or non-commercial use only |
| Render | 512 MB instance and 256 MB Postgres | US$ 13 per month, plus US$ 0.30 per GB of disk | R$ 74.58 per month, plus disk | Free Hobby workspace with 2 domains included; no South America region |
| Railway | Hobby, with US$ 5 of usage included | US$ 5 per month, plus usage above US$ 5 | R$ 28.69 per month, plus usage | 512 MB of RAM running all month costs about US$ 5 on its own; 2 domains on Hobby |
| Zenifra | Basic with DB-Starter and 1 GB of disk | Not applicable | R$ 42.00 per month, no IOF | São Paulo; the app costs R$ 0.05 per hour if you prefer to pay only while it runs |
The Replit figure is a floor, not a ceiling. If you spend credit on Agent, if the database stays active for many hours a day, or if traffic grows, the bill goes up. Railway follows the same logic: the US$ 5 subscription is also the usage credit, and an app with a database running all month tends to go past it. On Render and Zenifra, the table amount is the invoice amount, except for extra disk.
On Zenifra, Basic has 0.5 vCPU, 512 MB of memory, HTTPS, DDoS protection, CDN, and real-time logs. DB-Starter costs R$ 11.90 per month, with a 256 MB PostgreSQL instance and automatic backups every 24 hours, and database disk is billed separately at R$ 0.20 per GB per month. If the app grows, Premium, with 1 vCPU and 1 GB, costs R$ 62.90 per month and adds metrics and health checks.
How do you export a Replit project to GitHub?
Through Replit’s own Git tool. First, link your GitHub account in the connected services of your Replit account. Then, in the project, open Tools and choose Git, under Setup. If the project has no repository yet, use Initialize Git Repository; next, connect a GitHub repository from the same pane. To send changes, commit and click Push.
To stop depending on clicks, turn on auto-sync in the Git pane. It syncs both ways: what Agent changes becomes a commit on GitHub, and what someone pushes flows back into Replit. If sync stops, reconnect GitHub in connected services; Replit recommends a fine-grained personal access token for a more reliable connection. If you prefer the command line, you can use git and gh in Replit’s Shell, and the Git pane picks up what you do there.
Before the first push, check what is going along. The .replit file should go, because that is where you copy the settings from. The lockfile too, because the new host installs exactly the versions it lists. Files with secrets should not go, and they usually are not in the project, since Replit keeps secrets in the Secrets tool, outside the code. Check .gitignore if you ever pasted a key into a file while testing.
# After cloning the repository Replit synced
git clone git@github.com:your-account/your-app.git
cd your-app
# The settings the new host will ask for
cat .replit
# Variables the code reads, which must exist on the new host
grep -rhoE "process\.env\.[A-Z_]+" server shared 2>/dev/null | sort -u
# Dependencies that only work inside Replit
grep -rnE "@neondatabase/serverless|REPLIT_DOMAINS|@replit/object-storage" --include=*.ts --include=*.js . | grep -v node_modulesThe search command at the end is a shortcut to find, in a few seconds, the three things that break most often outside Replit: the Neon driver, sign-in that depends on Replit’s domains, and the App Storage SDK. If it finds nothing, the migration is likely to be configuration only.
How do you turn the .replit file into settings for the new host?
By copying it field by field, because .replit already describes how the app runs in production. It sits at the repository root, and a Node.js app built by Agent usually has a modules block with the runtime and the database, a [deployment] block with the build and start commands, a [[ports]] block with the port, and an [env] block with variables that are not secret.
Commands in .replit appear as lists, and on the new host they become a single line, with the parts joined by spaces: ["npm", "run", "build"] becomes npm run build. If [deployment] has no build, leave the build command empty. If run uses sh -c, such as ["sh", "-c", "cd main && python app.py"], use cd main && python app.py as the start command, or set the project’s root directory to main and use just python app.py.
The port that matters is localPort, not externalPort. The externalPort 80 is Replit’s public port, while localPort is where the server actually listens. The app must also listen on 0.0.0.0, not localhost, or the platform cannot deliver requests to it. Agent apps already read the PORT variable, so add PORT with the same value as the project port.
modules = ["nodejs-20", "web", "postgresql-16"]
[deployment]
deploymentTarget = "autoscale"
build = ["npm", "run", "build"]
run = ["npm", "run", "start"]
[[ports]]
localPort = 5000
externalPort = 80
[env]
PORT = "5000"| In `.replit` | In the Zenifra Console | In the example above |
|---|---|---|
modules, such as nodejs-20 or python-3.11 | Runtime and Version | Node.js, version 20 |
[deployment] › build | Build Command, with the parts joined by spaces | npm run build |
[deployment] › run | Start Command | npm run start |
[[ports]] › localPort | Port | 5000 |
[env] | Environment Variables | PORT=5000 |
modules with postgresql-16 | A managed PostgreSQL database, created separately | DATABASE_URL |
Zenifra offers Node.js 20, 22, 24, and 26 and Python 3.11, 3.12, 3.13, and 3.14. Pick the same version as in modules, or a newer one your code supports, because on GitHub projects created in the Console the runtime and version cannot be changed later from the Console. On Node.js, install runs npm ci, which needs an up-to-date package-lock.json; Replit apps usually already have it. On Python, install reads requirements.txt, and if your project only has pyproject.toml, generate the file in Replit’s Shell with pip freeze > requirements.txt and commit it.
Replit Secrets are not in the repository or in .replit. Open the Secrets tool, copy each value, and add it under Environment Variables on the new host. The DATABASE_URL of Replit’s database does not show up in Secrets, and on the new host it should point to the new database, not the old one.
How do you deploy a Replit app on Zenifra, step by step?
The steps below follow Zenifra’s public guide for Replit apps. Before you start, connect your GitHub account in the Console and install the Zenifra GitHub App on the account or organization that holds the repository, including that repository in the installation, or it will not show up in the list.
In the Console, click Create project, choose HTTP Application and the plan. In Source and port, set Project Source to Git repository, Git provider to GitHub, and pick the repository and branch. Fill in Runtime, Version, Build Command, Start Command, and Port with the values from .replit, as in the table in the previous section, and add PORT and the Secrets you copied from Replit under Environment Variables.
If the app uses a database, also create a managed PostgreSQL database in the same organization, copy its connection URI, and add it as DATABASE_URL in the application project. Do this before the first build finishes, or run a new deploy afterward, because an Agent app without DATABASE_URL usually exits as soon as it starts. Copying the data comes in the next section.
The first build starts as soon as the project is created. Follow it in the Deploys tab of the project page and, when it finishes, open the project URL. Test a screen that reads from the database and one that writes. If both work, the app is ready for the production data and, after that, the domain.
# Project environment variables on Zenifra (example)
PORT=5000
DATABASE_URL=<managed PostgreSQL URI, copied from the Console>
SESSION_SECRET=<value copied from Replit Secrets>
# To test the same build on your machine before deploying
npm ci
npm run build
PORT=5000 DATABASE_URL="<test URI>" npm run startNot sure which plan to pick? A small Node.js app, like the ones Agent usually builds, tends to run well on Basic, with 0.5 vCPU and 512 MB. If pages slow down under many simultaneous visits, move to Premium. With hourly billing, you can test the whole setup for a few cents before committing to monthly billing.
How do you move the Replit PostgreSQL database to a managed database?
With pg_dump against Replit’s production database and pg_restore into the new one. To get the source URI, open the Database tool on Replit, pick the production database, and copy the Connection string from the Settings tab. Do not use the development database, which is the one the editor uses and does not hold your customers’ real data.
Use a pg_dump version equal to or newer than the source database, which is PostgreSQL 16. The custom format with --no-owner and --no-acl avoids permission errors from users that exist on Neon but not on the new database. The Zenifra database URI already requires TLS. On Zenifra, PostgreSQL can be created on versions 15, 16, 17, or 18; picking 16 keeps the same version as Replit, and 18 works as long as pg_restore is also version 18.
Copy twice. The first copy is a rehearsal, to measure the time and validate the app against the new database. The second is the final copy, done with writes paused on Replit, because the app published there keeps writing data while you test. For a small app, the copy takes a few minutes.
# Source: production database Connection string (Database › Settings, on Replit)
export REPLIT_URL="postgresql://...neon.tech/...?sslmode=require"
# Target: managed PostgreSQL URI, copied from the Zenifra Console
export ZENIFRA_URL="postgresql://user:password@host:port/database?sslmode=require"
pg_dump --format=custom --no-owner --no-acl "$REPLIT_URL" > dump.pgdump
pg_restore --no-owner --no-acl --jobs=4 --dbname="$ZENIFRA_URL" dump.pgdump
# Compare the row count of an important table on both sides
psql "$REPLIT_URL" -c "select count(*) from users"
psql "$ZENIFRA_URL" -c "select count(*) from users"After the copy, check the app’s connection file, usually server/db.ts. Older Replit apps use the @neondatabase/serverless driver, which connects over WebSocket to Neon’s proxy and does not work with a regular PostgreSQL database. The symptom is a WebSocket error on the first query. The fix is small: the pg driver with Drizzle in node-postgres mode, as in the code below.
How do you swap the @neondatabase/serverless driver for pg?
By replacing the contents of the connection file and installing the pg package. The old code usually imports Pool and neonConfig from @neondatabase/serverless, sets a WebSocket constructor, and uses drizzle-orm/neon-serverless. The new code uses the Pool from pg and Drizzle from drizzle-orm/node-postgres, and the rest of the app, with its queries and schema, stays the same.
After replacing the file, run npm install pg and commit package.json and package-lock.json together. If the two get out of sync, the npm ci install fails during the build. If the project type-checks during the build, also install @types/pg as a dev dependency. The ws package the old driver used can stay or go; the database no longer needs it.
This change does not get in the way of anyone still building on Replit. Replit’s current development database is a regular PostgreSQL database, and the pg driver connects to it normally through the same DATABASE_URL variable. If your development database is still the legacy Neon one, with neon.tech in the URL, pg works with it too, because Neon accepts direct PostgreSQL connections.
import pg from 'pg'
import { drizzle } from 'drizzle-orm/node-postgres'
import * as schema from '@shared/schema'
export const pool = new pg.Pool({ connectionString: process.env.DATABASE_URL })
export const db = drizzle({ client: pool, schema })Who applies schema changes once the database leaves Replit?
You do, or a command in your deploy. On Replit, Publish compares the development and production databases, generates the SQL, asks about ambiguous changes such as a renamed column, and applies it before the new version goes live. Replit’s docs say this flow only covers databases Replit manages, and that an external database follows its own provider’s migration workflow.
In practice, when Agent creates a new table or column, it shows up in Replit’s development database but not in the production database on the new host. The published app tries to use the column and breaks. To avoid that, run migrations against the production database on every schema change. In apps with Drizzle, the command is usually drizzle-kit push, often exposed as a db:push script in package.json; check the name in your project.
There are two common ways to organize this. The simplest is to run the command on your machine, with DATABASE_URL pointing to the production database, before merging the change. The other is to put the command at the start of the start command, such as npm run db:push && npm run start, so every deploy applies the schema before starting the server. The second is automatic, but it calls for care with destructive changes, such as dropping a column that holds data.
If you would rather not deal with this yet, make schema changes less often and always in pairs: first add the new column, deploy, and only then remove the old one. It is the same care Replit’s Publish asks for when it checks whether a column was renamed or recreated, and it prevents the most common kind of data loss.
What should you do with Replit Auth, App Storage, and scheduled tasks?
These are Replit’s own services that your app may be using, and each one needs a replacement or a confirmation before you switch the domain. The first step is finding out which ones your app uses, and the grep from the GitHub section answers that in seconds.
Replit Auth signs visitors in with a Replit account, on a Replit-branded screen. Its docs say it works on replit.dev, replit.app, and custom domains connected to Replit, and it uses the REPLIT_DOMAINS variable, which Replit fills with the published app’s domains. They do not mention apps hosted on another platform. Before switching the domain, check Replit’s docs on whether your app’s sign-in works outside Replit, or move to your own sign-in, with sessions in your database or an identity provider you control.
App Storage holds files uploaded by users, and Replit states it runs on Google Cloud Storage under the hood, accessed through Replit’s SDK. To store files elsewhere, copy the objects to S3-compatible storage and replace the SDK with an S3 client. On Zenifra, that is Armazém, in the São Paulo region. Scheduled tasks, which are Scheduled Deployments on Replit, become Scheduled Jobs on Zenifra, using the same repository with their own command.
| Replit service | What the app loses outside Replit | Replacement on Zenifra or elsewhere |
|---|---|---|
| Replit Auth | Sign-in depends on Replit accounts and REPLIT_DOMAINS | Your own sign-in or an identity provider you control |
| Replit-managed Clerk Auth | The Clerk tenant was created and is managed by Replit | Check with Replit how to take the tenant, or build your own sign-in |
| App Storage | Replit’s SDK and the project buckets | Armazém, S3-compatible, or another S3 bucket |
| Scheduled Deployments | Replit’s scheduler | Scheduled Jobs, with a cron expression |
| Replit PostgreSQL | The production database and Publish migrations | Managed PostgreSQL and migrations in the deploy |
| Secrets | The values stored in the Secrets tool | Project Environment Variables |
How do you connect your custom domain without taking the app down?
Only after the app works on the new platform’s URL, with the database copied and sign-in tested. A day before the switch, lower the TTL of your domain records to 300 seconds, so the change reaches visitors quickly. At the planned time, pause writes on Replit, run the final database copy, add the domain on the new host, and update the DNS records.
On Replit, a custom domain uses an A record and a TXT record with replit-verify, and each subdomain, including www, has its own. On Zenifra, open the project, click Edit, and add the domain under Custom Domains. For a subdomain such as www or app, the Console shows a CNAME plus the validation TXT records; for the apex domain, a single A record. Delete the old Replit A and AAAA records on the same name, because two different targets send some visitors to the old app.
The HTTPS certificate is issued automatically once DNS is validated, usually within a few minutes. If the domain uses Cloudflare, keep the apex domain on the gray cloud, DNS only. Each Zenifra project accepts up to 20 custom domains, and they work on public HTTP projects.
Keep the Replit app running for a few days after the switch, with no writes, so you have somewhere to go back to if something goes wrong. Remember to update external webhooks, such as payment and email ones, that may still point to the replit.app address. Once everything is stable, you can shut down the deployment on Replit and stop paying for it.
Can you keep editing on Replit after migrating?
Yes, and it is the most comfortable way to migrate. With auto-sync on, every change Agent makes becomes a commit on GitHub, and the host that follows the branch publishes the new version on its own. On Zenifra, the Automatic by branch mode does this: every push to the chosen branch starts a build, and the app is only swapped once the release finishes successfully. The reverse also works, and a commit made in your editor flows back into Replit.
What stays the same is the way you work: you ask Agent for changes, test in Replit’s preview, and every push publishes. What changes is that Replit’s preview uses the development database, not production, and that schema changes need to reach the new database, as explained above. Always test on the new host’s URL before treating a change as done.
If you do not want every message to Agent going straight to production, work on a separate branch in Replit and merge into the main branch only when ready, or change the Deploy mode to Manual, By Tag, or By Release in the Git repository card under Edit project, in the Zenifra Console. You can also use Preview environments to review a change on its own URL before merging.
What are the most common errors when moving an app off Replit?
Almost all of them share one root: something Replit did on its own that, outside Replit, someone has to configure. The port, the variables, the database, and the schema top the list. The table lists the symptom, the likely cause, and the fix, in the order they usually show up.
| Symptom | Likely cause | How to fix it |
|---|---|---|
| The build fails while installing dependencies | No package-lock.json in the repository, or the file is out of sync | Run npm install on your machine and commit package-lock.json |
| The app fails the health check | The project port differs from the port the app listens on | Use the .replit localPort as the Port and in PORT |
The app exits with DATABASE_URL must be set | The database variable is missing | Add DATABASE_URL with the managed PostgreSQL URI |
| WebSocket error when connecting to the database | The @neondatabase/serverless driver | Switch to pg with drizzle-orm/node-postgres |
| A screen breaks with a missing column or table | The schema changed on Replit and was not applied to the new database | Run migrations, such as drizzle-kit push, against the production database |
| A feature that uses an API key returns a 500 error | The Replit Secret was not added on the new host | Add the value under Environment Variables and redeploy |
| Sign-in sends visitors to Replit or fails | The app uses Replit Auth or Replit-managed Clerk | Confirm support outside Replit or switch to your own sign-in |
| Images uploaded by users do not show up | The files are still in Replit’s App Storage | Copy them to an S3 bucket and replace the SDK |
| A Python app installs nothing | The project only has pyproject.toml, no requirements.txt | Generate requirements.txt and commit it |
One error missing from the table, but expensive, is copying the development database thinking it is production. Replit shows both in the Database tool. Check that the URI has neon.tech and an ep- endpoint, which is the case for the production database in most apps, and compare row counts with what you see in the published app.
When is it better to stay on Replit?
When the app is still an idea or a prototype and you use Agent every day. In that case, Core is already paid for by your Agent usage, hosting comes out of the same credit, and you maintain no configuration: database, migrations, domain, and HTTPS are handled by Replit. For a launch page, an internal tool, or a test with a few users, publishing on Replit itself is the shortest path.
Staying also makes sense when the app leans heavily on Replit services. An app with Replit Auth, App Storage, and several scheduled tasks takes more work to move, and that work only pays off if the app already has customers. And if your only concern is latency, Replit lets you publish to South America on paid plans, as long as you choose it on the first publish.
Leaving pays off when the app has become a product. Arguments for migrating include a hosting cost that does not share credit with Agent, a database with a fixed price instead of per-active-hour billing, the code in a repository the company controls, the server close to Brazilian users, and an invoice in Brazilian reais, through PIX or boleto, with no IOF. Putting the app next to other services on the same platform, such as a database, a cron job, or an API, counts too.
In short
A Replit app runs on any platform with Node.js or Python. Link GitHub through the Git tool, copy runtime, commands, port, and variables from .replit, add the Secrets again, and move the production database with pg_dump and pg_restore, swapping the Neon driver for pg if the app is older. From then on, schema changes are yours to apply, and services such as Replit Auth and App Storage need a replacement. On Replit, publishing permanently takes Core, at US$ 20 per month, or R$ 114.74 with PTAX and IOF, with the database billed per active hour; Render, Railway, and Vercel charge US$ 5 to US$ 20 before extra usage.
If your users are in Brazil, Zenifra puts the app and PostgreSQL in São Paulo for R$ 42.00 per month, in Brazilian reais, and you keep building on Replit as before.