Replit deployment fails or published app won't load (server must listen on 0.0.0.0)
Replit preview works but publishing fails or the URL won't load? Make your server listen on 0.0.0.0, set production Secrets, check ports.
Last edited October 17, 2026
On this page
What it means in plain English
Replit's published app must accept outside connections. A server listening only on localhost is invisible to the internet.
Deploy Without Errors Pack
Environment variables on Vercel, Netlify and Replit, SPA refresh rewrites, npm peer dependency errors and domain setup.
Secure checkout by Stripe
One-time payment through Stripe. Priced in USD. Local taxes such as UK VAT may be added at checkout.
Likely causes
- Server listens on
localhost/127.0.0.1instead of0.0.0.0. - Ports in
.replitset withoutexternalPort = 80. - Secrets not set for the deployment.
- Slow startup failing the health check.
How to fix it, step by step
- In your server code, listen on host
0.0.0.0(e.g.app.listen(port, '0.0.0.0')). - If
.replitdefines ports, include one withexternalPort = 80. - Add your Secrets to the deployment (production secrets).
- Check the deployment logs for the real error.
- Make sure the run/build commands match what works in Preview.
How to check it worked
- Publishing completes and the public URL loads the main flow.
The rest of the Preview-versus-published checks are in Replit app works in preview but not when published. A domain that stays unverified while .replit.app loads is Replit custom domain not working.
Sources
Related fixes
Tool to consider: Replit.
Deploy Without Errors Pack
Environment variables on Vercel, Netlify and Replit, SPA refresh rewrites, npm peer dependency errors and domain setup.
Secure checkout by Stripe
One-time payment through Stripe. Priced in USD. Local taxes such as UK VAT may be added at checkout.