ERR_CONNECTION_REFUSED Explained
ERR_CONNECTION_REFUSED is a browser error meaning the target server actively rejected the connection, usually because nothing is listening on the requested port or a firewall blocked it. It is different from a timeout, where the request gets no answer at all. Fixing it means checking that the right service is running and reachable on that port.
What the error means
When a browser tries to open a TCP connection to a server and port, the operating system on the other end can respond in a few ways. If a program is listening on that port and accepts the connection, the page loads. If nothing is listening, the operating system immediately sends back a reset response, and the browser reports it as ERR_CONNECTION_REFUSED. This is an active rejection, not silence, which is why it usually appears quickly instead of after a long wait.
Common causes
- The web server (Apache, Nginx or similar) is stopped or crashed on the target machine.
- The URL points to the wrong port, for example a database or application port instead of 80 or 443.
- A firewall on the server or network actively rejects the connection instead of silently dropping it.
- The server is still starting up, rebooting or mid-deployment.
- DNS is pointing to an IP address that no longer runs your service, such as after switching hosts without updating records.
- A local proxy, VPN or browser extension is misconfigured.
How to diagnose and fix it
- Check the service is running on the server, for example with
systemctl status nginxor the equivalent for your web server. - Confirm the port in the URL matches what the service listens on (80 for HTTP, 443 for HTTPS, or a custom port for applications).
- Test from the server itself with a local request to rule out an external network or firewall issue.
- Check firewall rules for the port, both on the server (iptables, ufw, firewalld) and any cloud provider security group.
- Verify DNS points to the correct current IP address.
- Try another network or device to rule out a local VPN, proxy or extension.
# Check whether a port is open and listening on a Linux server
sudo ss -tlnp | grep :443
# Test connectivity to a host and port from outside
curl -v https://example.com:443/
telnet example.com 443
ERR_CONNECTION_REFUSED vs. similar errors
| Error | What it means |
|---|---|
| ERR_CONNECTION_REFUSED | Server actively rejected the connection; something answered "no" |
| ERR_CONNECTION_TIMED_OUT | No response at all within the wait period; often a firewall silently dropping packets |
| DNS_PROBE_FINISHED_NXDOMAIN | The domain name itself did not resolve to any IP address |
| 502 Bad Gateway | A proxy or load balancer reached a backend, but that backend sent an invalid or no response |
Frequently asked questions
What does ERR_CONNECTION_REFUSED mean?
It means the browser reached the server's network address, but the server actively rejected the connection attempt, usually because no program is listening on the requested port. It differs from a timeout, where there is no response at all.
Why am I getting ERR_CONNECTION_REFUSED on my own website?
The most common reason is that your web server process has stopped or crashed. Log in to your server and check the service status, then check firewall rules and that DNS points to the right IP address.
Is ERR_CONNECTION_REFUSED caused by my computer or the server?
It is almost always on the server or network side, since the rejection comes from whatever is at the destination address and port. Local causes are rarer but include a misconfigured VPN, proxy or hosts file entry.
How do I fix ERR_CONNECTION_REFUSED after moving to a new host?
Check that your domain's DNS records were updated to point to the new server's IP address and that enough time has passed for the change to propagate, then confirm the web server is running on the new host.
Can a firewall cause ERR_CONNECTION_REFUSED?
Yes. Some firewalls send an active rejection for blocked ports, which produces this error, while others silently drop the traffic, which produces a timeout instead. The exact behavior depends on the firewall's configuration.
Does ERR_CONNECTION_REFUSED mean the website is hacked?
Not by itself. It is a connectivity error, most often caused by a stopped service, wrong port or firewall rule. It is worth checking server logs for other signs if the cause is not obviously one of these.
Related topics
- What Is a Firewall? Security & SSL
- What Is a Web Server? Web Servers
- What Is Apache (Apache HTTP Server)? Web Servers
- What Is Nginx? Web Servers
- What Is a Database? Databases