Troubleshooting · Networking
Running but unreachable? Check the port.
If your app starts but its URL times out or returns an error, it's almost always listening on the wrong address or port. Bind to 0.0.0.0 and read the port from the PORT environment variable.
- Bind 0.0.0.0
- Read PORT
- Match EXPOSE
# ✗ only reachable inside the container app.listen(3000, "127.0.0.1") # ✓ reachable by Runex app.listen(process.env.PORT, "0.0.0.0")
Cause
Why is my app running but not reachable?
Because Runex can't connect to the address your server listens on. Runex sets the port in the PORT variable; environment variables explains how runtime variables work.
127.0.0.1 (localhost) only accepts connections from inside the same container. Runex routes traffic from outside, so the server must listen on 0.0.0.0 (all interfaces).
The port matters too. If the app listens on a fixed port that doesn't match what Runex expects, traffic never arrives. Read it from the PORT variable instead.
Fix
How do you bind to the right port in each language?
One line per stack. Using Docker? The Docker hosting guide shows the same fix in a Dockerfile.
| Correct listen line | |
|---|---|
| Node.js | app.listen(process.env.PORT, "0.0.0.0") |
| Next.js | next start: reads PORT automatically |
| Python | uvicorn main:app --host 0.0.0.0 --port $PORT |
| Go | http.ListenAndServe(":"+os.Getenv("PORT"), nil) |
| Dockerfile | EXPOSE the same port your CMD listens on |
FAQ
Port questions
Addresses, ports, and containers.
What does binding to 0.0.0.0 mean?
It tells your server to accept connections on every network interface, not just localhost, so traffic from outside the container can reach it. The Node.js hosting guide shows it in a real server.
Which port should my app listen on for Runex?
Read the port from the PORT environment variable and fall back to a default like 3000 or 8080 for local development.
Does EXPOSE in a Dockerfile open the port?
EXPOSE documents which port the container uses. Your server still has to listen on that port and on 0.0.0.0.
Next step
One line. Fixed.
Change the listen address, push, and your URL responds.
