ERR_CONNECTION_REFUSED
ERR_CONNECTION_REFUSED: what it means and how to fix it
ERR_CONNECTION_REFUSED means your browser reached the server’s address, and the server answered that it will not accept the connection on that port. Usually no program is listening on the port, or a firewall rule rejects the connection.
You may also see
- “refused to connect” (Chrome)
- “Unable to connect” (Firefox)
- “Safari can’t connect to the server” (Safari)
Common causes
- 1
The web server or the application is not running. It stopped, it crashed, or a deploy did not start it again.
- 2
The port is wrong. The site runs on another port than the one in the address.
- 3
A firewall or a cloud security group rejects the connection.
- 4
The program listens only on 127.0.0.1, so it accepts connections from the same machine only.
- 5
The domain still points to an old server that has no web server any more.
If you are visiting the site: how to fix it
- 1
Reload after a minute. A site that is restarting is often back soon.
- 2
Check the address and the port number.
- 3
Try another network and another device, to see if only your connection is refused.
- 4
Turn off a proxy or VPN, and check that the hosts file has no line for this site.
If you run the site: what to check
- 1
Check that the service is running, for example with systemctl status on Linux, and read its log for a crash.
- 2
Check which ports listen and on which address. On Linux, ss -ltnp shows them. A service on 127.0.0.1 is not reachable from outside.
- 3
Check the firewall and the cloud security group. A reject rule gives a refused connection; a drop rule gives a timeout instead.
- 4
Check that the DNS record of the site points to the right server.
- 5
If a reverse proxy sits in front, check that the proxy itself is running and listens on the port.
Frequently asked questions
- What does ERR_CONNECTION_REFUSED mean?
- The browser reached the server’s address, but the server did not accept the connection on that port. It usually means that no program listens on the port, or that a firewall rejects the connection.
- What is the difference between ERR_CONNECTION_REFUSED and ERR_CONNECTION_TIMED_OUT?
- With a refused connection the other side answers at once that it will not accept the connection. With a timeout nothing answers at all, which often means that a firewall silently drops the packets or that the server is unreachable.
- Why do I get ERR_CONNECTION_REFUSED on localhost?
- No program listens on that port on your machine. Start your development server, and check the port number in the address and in the server’s settings.
- How do I fix ERR_CONNECTION_REFUSED on my server?
- Check that the service runs, that it listens on the right port and on an address that outside machines can reach, and that the firewall and the security group allow the port. Then check that the DNS record points to this server.
Know about it before your visitors do
Uptrack checks your site on a schedule from several locations and alerts you when it stops answering, so you hear about it from an alert and not from a customer.
from $3/mo · 30-day money-back guarantee