Replit deploy: app not reachable / port not open
The error
Your app is not listening on the expected port / deployment health check failed
Why it happens
The server listens on localhost/127.0.0.1 or a hard-coded port. Deployments need it bound to 0.0.0.0 on the port the platform gives you (process.env.PORT), and the health check expects a quick 200 on /.
How to fix it
- Listen on 0.0.0.0 and process.env.PORT (with a fallback).
- Make sure / responds quickly with 200.
- Check the run command in the deployment config starts the production server.
- Move secrets into Replit Secrets, which deployments read too.
Fix prompt (paste into Lovable, Bolt, Cursor, Replit or v0)
My Replit deployment fails its health check. Make the server listen on host 0.0.0.0 and port process.env.PORT (fallback 3000), make GET / return 200 fast, set the deployment run command to the production start script, and list any secrets I need to add.
FAQ
Why does it work in the workspace?
The workspace preview is more forgiving about host and port.
Where do env vars go?
Replit Secrets.
Related fixes
- Vercel build fails: Type error / ESLint errors (works locally)
- 404 NOT_FOUND when refreshing a page (React/Vite SPA)
- CORS error: blocked by CORS policy: No 'Access-Control-Allow-Origin' header
- Hydration failed because the server rendered HTML didn't match the client
Want the full checklist for this area? Get a Fix Kit ($29)
Featured slot available: reach thousands of vibe coders. Sponsor this week →
Get one new fix a week
Free newsletter: the newest breakages in Lovable, Bolt, Cursor, Replit and v0 apps, with paste-in fixes.
We only use your email to send the newsletter. Unsubscribe any time. See privacy.