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.
What you see
The build succeeds, then the deploy times out or fails its health check, and the logs say the server started on port 5000.
Why it happens
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.
How to fix it
- Change the server to listen on
Number(process.env.PORT) || 5000, and deploy again.
Or ask your AI tool to fix it
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. I work on Launchpad by Axonscape, which runs a free launch 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.



