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.

See what’s inside

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.1 instead of 0.0.0.0.
  • Ports in .replit set without externalPort = 80.
  • Secrets not set for the deployment.
  • Slow startup failing the health check.

How to fix it, step by step

  1. In your server code, listen on host 0.0.0.0 (e.g. app.listen(port, '0.0.0.0')).
  2. If .replit defines ports, include one with externalPort = 80.
  3. Add your Secrets to the deployment (production secrets).
  4. Check the deployment logs for the real error.
  5. 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

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.

See what’s inside

Secure checkout by Stripe

One-time payment through Stripe. Priced in USD. Local taxes such as UK VAT may be added at checkout.