Error Reference › Browser / Network
Browser / Network
ERR_CONNECTION_REFUSED
Nothing is listening at the address/port you tried to reach, so the connection was refused.
What it looks like
This site can’t be reached
localhost refused to connect.
ERR_CONNECTION_REFUSED
What does "ERR_CONNECTION_REFUSED" mean?
Shown by the browser (and by curl as “Connection refused”) when the machine answered but nothing was listening on that port. It is different from a timeout: a refusal is immediate, which tells you the host is reachable but the service is not running there.
What causes "ERR_CONNECTION_REFUSED"?
- The server/dev server isn't running.
- Wrong host or port.
- A firewall is blocking the port.
How do I confirm the cause?
- Run curl -v http://host:port — an instant “Connection refused” confirms nothing is listening; a long hang points to a firewall instead.
- On the server, list listening ports (ss -ltnp or netstat -ano) and check your app is bound to the port you think it is.
- Check the bind address: a server listening on 127.0.0.1 refuses connections from other machines; 0.0.0.0 accepts them.
How do I fix "ERR_CONNECTION_REFUSED"?
- Start the server and confirm it's listening on that port.
- Double-check the host and port in your URL/config.
- Try curl/telnet to the host:port to confirm reachability.
How do I stop it happening again?
- Run the service under a process manager (systemd, PM2, Docker restart policies) so it comes back after a crash.
- Keep the host and port in one config value shared by the server and its clients, so they cannot drift apart.