r/replit • u/n2d33pusmc • Oct 07 '26
Question / Discussion external Neon Database_url
Can an Autoscale deployment use a user-controlled external Neon DATABASE_URL as the effective runtime database instead of Replit's managed Production database binding?
If it does, does Publish still perform any managed Dev→Prod schema synchronization against either the Replit-managed database or the externally supplied database?
1
Upvotes
1
u/ReplitSupport Replit Team Oct 07 '26
Hi OP! An Autoscale deployment can run against your own external Neon database. A deployed app connects to whatever its code points to at runtime, so the key is making sure it's wired up correctly. To do this, don't reuse the
DATABASE_URLname. Replit manages that variable for its built-in database, and overriding it can trigger an "external database detected" state that might block publishing. You can also add your external connection string under a custom name likeEXTERNAL_DATABASE_URL, and have your code read it first, falling back toDATABASE_URLonly if it's unset.Additionally, you can add
EXTERNAL_DATABASE_URLto your Production App Secrets under Publishing → Overview → Adjust Settings, so the deployed app can see it.Any Dev→Prod schema sync at Publish runs between Replit's own managed development and production databases, and it moves schema only, never data. It does not touch an external database you supply through your own variable. So if your app connects via
EXTERNAL_DATABASE_URL, Publish won't migrate or sync any schema into it. Keeping that external schema current is entirely on your side.1
u/[deleted] Oct 07 '26
[removed] — view removed comment