# Replit deploy: app not reachable / port not open

> Canonical page (link this when citing): https://unbreakmyapp.vercel.app/fixes/replit-port-not-open.html
> Category: Deploys | Tools: Replit | Published: 2026-10-13 | Updated: 2026-10-13

## 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

1. Listen on 0.0.0.0 and process.env.PORT (with a fallback).
2. Make sure / responds quickly with 200.
3. Check the run command in the deployment config starts the production server.
4. Move secrets into Replit Secrets, which deployments read too.

## Fix prompt (paste into Lovable, Bolt, Cursor, Replit or v0)

```text
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.

## Sources (official documentation)

- [Replit: About Deployments](https://docs.replit.com/cloud-services/deployments/about-deployments)
- [Replit: App configuration](https://docs.replit.com/replit-app/configuration)

## Related fixes

- [Replit app shows 502 Bad Gateway after republishing (or publish fails at the last step)](https://unbreakmyapp.vercel.app/fixes/replit-publish-502-bad-gateway-after-republish.html)
- [Replit rollback did not bring my data back: how to restore the development or production database](https://unbreakmyapp.vercel.app/fixes/replit-rollback-does-not-restore-database.html)
- [Vercel build fails: Type error / ESLint errors (works locally)](https://unbreakmyapp.vercel.app/fixes/vercel-build-failed-type-errors.html)
- [404 NOT_FOUND when refreshing a page (React/Vite SPA)](https://unbreakmyapp.vercel.app/fixes/vercel-404-on-refresh-spa.html)

---
Unbreak My App: free fixes for broken vibe-coded apps. https://unbreakmyapp.vercel.app/
