# Deploy fails its health check: server stuck on port 5000

> Source: <https://dev.to/axonscape/deploy-fails-its-health-check-server-stuck-on-port-5000-401k>
> Published: 2026-11-02 09:40:53+00:00

Replit apps listen on port 5000. Other hosts tell the app which port to use in PORT, so a fixed port is never reached and the deploy fails.

The build succeeds, then the deploy times out or fails its health check, and the logs say the server started on port 5000.

Hosts give each app a port in the `PORT` environment variable and send traffic there. A server hard-coded to 5000 listens somewhere nobody calls.

`Number(process.env.PORT) || 5000`, and deploy again.
Paste this into Lovable, Bolt, v0, Replit or Cursor:

Make the server listen on the port in the PORT environment variable, falling back to 5000: Number(process.env.PORT) || 5000. Don't change anything else.

The full page, with the request ready to copy, is at [launchpad.axonscape.com/fix/server-fixed-port-5000](https://launchpad.axonscape.com/fix/server-fixed-port-5000). I work on Launchpad by Axonscape, which runs a [free launch check](https://launchpad.axonscape.com/check) for apps built with AI tools: it finds this and the other things that break at launch, from a public GitHub repo or a .zip of the code, and keeps nothing.
