You type a web address, press Enter, and Chrome answers with a sad little face and the words “This site can’t be reached – refused to connect.” Underneath, in small grey letters: ERR_CONNECTION_REFUSED.
The short explanation is this: your browser found the server, knocked on the door, and the server (or something in front of it) actively said no. That makes this error different from a slow site or a missing page. The connection was rejected before any web page could be sent.
The cause can sit on your side (a proxy, a firewall, a DNS problem) or on the website’s side (a crashed web server, a closed port, a firewall rule). This guide covers both, plus fixes for developers who see the error on localhost.
Quick answer: how to fix ERR_CONNECTION_REFUSED
If you’re a visitor, try these in order:
- Check whether the site is down for everyone
- Reload the page and restart your browser
- Try another device or network (mobile data is a quick test)
- Turn off VPN, proxy and extensions
- Clear browser cache and flush DNS
- Check your antivirus and firewall
- Reset network settings and switch DNS servers
If you own the website or server, try these:
- Make sure the web server is running
- Confirm the server is listening on the right ports
- Open the port in your firewall and security groups
- Check for an IP block, a wrong DNS record or a bad site URL
- Fix localhost and Docker port problems (for developers)
What does ERR_CONNECTION_REFUSED mean?
When your browser opens a website, it first creates a connection to the server’s IP address on a specific port. Websites normally use port 80 for HTTP and port 443 for HTTPS. This setup step is called a TCP handshake.
ERR_CONNECTION_REFUSED appears when that handshake is rejected. In most cases one of three things happened:
- Nothing is listening on that port (the web server is stopped, crashed or set to a different port)
- A firewall rejected the connection on purpose
- Something between you and the server, such as a proxy, VPN or router, refused to pass it along
The key point is that this is not an HTTP status code. The error you get from a 404 or a 503 means the server received your request and answered it. With a refused connection, no web page request was ever completed, so there is no status code at all. That’s why this error needs different troubleshooting from the ones in our HTTP errors guide.
How the error looks in different browsers
The wording changes, but the meaning doesn’t:
| Browser | What you see |
|---|---|
| Google Chrome | “This site can’t be reached – example.com refused to connect. ERR_CONNECTION_REFUSED” |
| Microsoft Edge | “Hmm… can’t reach this page – example.com refused to connect” |
| Firefox | “Unable to connect – Firefox can’t establish a connection to the server” |
| Safari | “Safari Can’t Connect to the Server” |
| Localhost in Chrome | “localhost refused to connect” |
ERR_CONNECTION_REFUSED vs similar connection errors
It’s easy to mix these up, and they have different fixes:
| Error | What happened | Typical cause |
|---|---|---|
| ERR_CONNECTION_REFUSED | The server or a firewall actively rejected the connection | Server stopped, port closed, firewall rule |
| ERR_CONNECTION_TIMED_OUT | No answer came back at all | Server overloaded, packets dropped, firewall silently blocking |
| ERR_CONNECTION_RESET | The connection started, then was cut off | Network interruption, security software, server crash mid-request |
| ERR_NAME_NOT_RESOLVED | The domain name couldn’t be turned into an IP address | DNS problem (see our DNS errors guide) |
| ERR_SSL_PROTOCOL_ERROR | The secure handshake failed | Certificate or protocol problem (see our SSL errors guide) |
A simple way to remember it: refused means someone said no, timed out means nobody answered, and reset means someone hung up.
What causes ERR_CONNECTION_REFUSED?
Causes on the visitor’s side
- A proxy or VPN that is misconfigured or has dropped
- Browser extensions that interfere with requests
- Cached or corrupted DNS data pointing to the wrong place
- Antivirus or firewall software blocking the browser
- Wrong network or proxy settings in Windows, macOS or the browser
- A wrong entry in your computer’s hosts file
Causes on the website or server side
- The web server software (Nginx, Apache, LiteSpeed, IIS) has stopped or crashed
- The server is listening on a different port from the one the browser is using
- A firewall, security group or host firewall is blocking ports 80 or 443
- The server ran out of memory and the system shut the web service down
- Your IP address was blocked by a security tool such as Fail2ban or CSF
- The domain points to the wrong IP address after a migration
- A CMS site (like WordPress) has its site URL set to a wrong address or port
- In development, the app isn’t running or is bound to the wrong address
Before you start
Two quick checks will tell you where to focus:
- Open the site on your phone using mobile data (Wi-Fi off). If it loads, the problem is on your computer or home network.
- Use a “down for everyone or just me” checker. If the site is down for everyone, the problem is on the server, and you can only wait (or contact the owner).
If you own the site and it’s down for everyone, skip ahead to Fix 8.
Fixes for visitors
Fix 1: Check whether the site is down for everyone
A site that refuses connections from every location is almost certainly a server problem. In that case nothing you do on your own device will help. Wait a few minutes, check the site’s social media or status page, and try again later.
If other websites open fine and just this one fails, continue below.
Fix 2: Reload the page and restart your browser
It sounds basic, but a short-lived hiccup, such as a server restart, a deploy or a brief network drop, can trigger this error. Wait 30 to 60 seconds, reload with Ctrl+Shift+R (Cmd+Shift+R on Mac), and fully close and reopen your browser if needed.
Fix 3: Try another device or network
Open the site on your phone with mobile data, or connect your computer to a different network.
- Works elsewhere: the issue is local to your device, router or ISP. Keep going through Fix 4 to Fix 7.
- Fails everywhere: the server is refusing connections. Jump to the site owner fixes or contact the owner.
Fix 4: Turn off your VPN, proxy and browser extensions
A VPN or proxy sits between you and the website. If it is misconfigured or its server is down, it can refuse the connection for you.
- Disconnect your VPN.
- Check your proxy settings. On Windows go to Settings > Network & internet > Proxy and turn off any proxy you didn’t set up yourself. On Mac go to System Settings > Network > your connection > Details > Proxies.
- Open the site in a private or incognito window, which disables most extensions. If the site loads, turn extensions back on one at a time to find the culprit. Ad blockers, privacy tools and security extensions are the usual suspects.
Fix 5: Clear your browser cache and flush DNS
Old cached data can send your browser to an address that no longer works.
Clear the browser cache (Chrome): Settings > Privacy and security > Delete browsing data > select Cached images and files > Delete data.
Clear Chrome’s internal DNS cache: type chrome://net-internals/#dns into the address bar and click Clear host cache.
Flush your operating system’s DNS cache:
On Windows, open Command Prompt as administrator and run:
ipconfig /flushdns
On macOS, open Terminal and run:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder
On Linux with systemd-resolved:
sudo resolvectl flush-caches
Then reload the site.
Fix 6: Check your antivirus and firewall
Security software sometimes blocks a site or a port by mistake, especially after an update.
- Temporarily disable your antivirus web shield or third-party firewall and reload the site.
- On Windows, check Windows Security > Firewall & network protection and make sure your browser is allowed through.
- If the site loads, add an exception for your browser or that website, then turn protection back on.
Only do this for sites you trust, and don’t leave protection off.
Fix 7: Reset your network settings and change DNS servers
If the earlier steps didn’t work, the problem may be in your network stack or DNS provider.
Reset Windows network components. In an administrator Command Prompt run these, then restart your computer:
netsh winsock reset
netsh int ip reset
ipconfig /release
ipconfig /renew
Restart your router and modem. Unplug them for 30 seconds, plug them back in and wait for the lights to settle.
Switch to a public DNS server. In your network adapter settings, set DNS to Google (8.8.8.8 and 8.8.4.4) or Cloudflare (1.1.1.1 and 1.0.0.1) and test again.
Check your hosts file. A leftover entry can send a domain to the wrong address, which is common after a developer or migration tester edits it. On Windows the file is at C:\Windows\System32\drivers\etc\hosts, and on Mac and Linux it’s at /etc/hosts. Remove any line that points the domain to an old IP or to 127.0.0.1.
Fixes for website owners and server admins
If your site is down for everyone, the problem is on your server. Work through these in order. You’ll need SSH access or your hosting control panel.
Fix 8: Make sure the web server is running
The most common cause by far is a web server that stopped or crashed.
On a Linux VPS or dedicated server, check the service status:
sudo systemctl status nginx
sudo systemctl status apache2
If it isn’t running, start it and check the logs for the reason it stopped:
sudo systemctl start nginx
sudo journalctl -u nginx --since '1 hour ago'
Also test the configuration, since a syntax error stops the server from starting:
sudo nginx -t
sudo apachectl configtest
If the server keeps stopping on its own, check whether it ran out of memory:
dmesg | grep -i 'out of memory'
Repeated out-of-memory kills mean your server needs more RAM or a lighter setup. Our Server Size Calculator can help you estimate what your traffic needs.
On shared hosting you can’t restart the web server yourself. Check your host’s status page and open a support ticket.
Fix 9: Confirm the server is listening on the right ports
A running server can still refuse connections if it isn’t listening where the browser expects.
List open listening ports:
sudo ss -tulpn | grep LISTEN
You should see your web server on port 80 and 443. If it’s on another port (for example 8080), either change the config to use the standard ports or tell visitors to use the port in the URL.
Test from the server itself and from outside:
curl -I http://localhost
curl -v https://yourdomain.com
nc -zv your-server-ip 443
If the local test works but the outside test is refused, the problem is a firewall or network rule (Fix 10). If both fail, the web server itself is the issue.
Fix 10: Open the port in your firewall and security groups
Firewalls refuse connections when a rule closes a port. Check every layer that applies to you:
- Server firewall: run
sudo ufw statusorsudo iptables -L -n. To allow web traffic with UFW:sudo ufw allow 80/tcpandsudo ufw allow 443/tcp. - Cloud firewall or security group: AWS Security Groups, Azure Network Security Groups, Google Cloud firewall rules and DigitalOcean Cloud Firewalls all need inbound rules for ports 80 and 443.
- Hosting panel firewall: tools like CSF or Imunify360 can block ports and IPs on shared and managed servers.
- Reverse proxy or load balancer: make sure it forwards traffic to the correct backend port.
If you use Cloudflare, also check that your origin allows Cloudflare’s connections. Origin-side errors often appear as Cloudflare codes instead, which our Cloudflare errors guide explains.
Fix 11: Check for an IP block, a wrong DNS record or a bad site URL
Three smaller causes are easy to miss.
Your IP was blocked. Security tools like Fail2ban or CSF can ban an IP after repeated failed logins. If the site works from other networks but not yours, check the ban lists and unblock your address.
The domain points to the wrong server. After a migration or hosting change, the DNS A record may still point to an old IP that no longer runs a web server. Check it:
nslookup yourdomain.com
Compare the result with your current server’s IP and update the record if needed. DNS changes can take time to spread.
Your WordPress site URL is wrong. If a WordPress site works for you in one place but visitors see “localhost refused to connect,” the WordPress Address and Site Address settings may point to a development URL or the wrong port. You can force the correct values by adding these lines to wp-config.php:
define( 'WP_HOME', 'https://yourdomain.com' );
define( 'WP_SITEURL', 'https://yourdomain.com' );
Fix 12: Fix localhost and Docker port problems (for developers)
Seeing “localhost refused to connect” while building an app is one of the most common versions of this error. Work through the checklist:
- Is the app actually running? Check your terminal for crashes or errors on start-up.
- Are you using the right port? If your app says it’s on port 3000, don’t open port 8080.
- Is another process using the port? If so, the app may have failed to start. Find it with
sudo lsof -i :3000(Mac and Linux) ornetstat -ano | findstr :3000(Windows). - Check the binding address. An app bound only to
127.0.0.1can’t be reached from another machine. Bind to0.0.0.0when you need outside access. - IPv4 vs IPv6. On some setups
localhostresolves to the IPv6 address::1, while the app listens only on IPv4. Tryhttp://127.0.0.1:PORTdirectly. - Docker: make sure the port is published, for example
docker run -p 8080:80 image-name, and that the app inside the container listens on0.0.0.0, not just127.0.0.1. - HTTPS on localhost: if you type
https://localhostbut the app only serves HTTP, the browser may refuse the connection. Usehttp://instead.
ERR_CONNECTION_REFUSED on Android and iPhone
On a phone, the steps are simpler:
- Toggle airplane mode on and off, or switch between Wi-Fi and mobile data.
- Turn off any VPN or private DNS setting and test again.
- Clear the browser’s cache and site data.
- Restart the phone and router.
- On Android, check Settings > Network & internet > Private DNS and set it to Automatic or Off if it’s causing problems.
If the site fails on every network, the issue is on the server.
How to prevent ERR_CONNECTION_REFUSED on your website
- Use uptime monitoring. A free monitor alerts you the moment your site refuses connections, often before visitors notice.
- Set the web server to start automatically. Make sure services restart after a reboot or crash (
systemctl enable nginx). - Watch your resources. Track RAM, CPU and disk use so the system doesn’t kill your web server. Our Bandwidth Calculator and Hosting Cost Calculator can help you plan capacity.
- Document firewall changes. Write down every rule you add so you can undo it if something breaks.
- Test after every migration. Confirm DNS, ports, SSL and firewall rules on the new server before switching traffic.
- Choose reliable hosting. Good support and a clear status page shorten outages. Our web hosting errors guide covers other problems to watch for.
Does ERR_CONNECTION_REFUSED affect SEO?
It can. If search engine crawlers can’t connect to your server, they will retry later. Short outages usually cause no harm, but repeated or long ones can reduce crawling and may cause pages to drop from results. After fixing the problem, check Settings > Crawl stats and the Pages report in Google Search Console to confirm that Google can reach your site again.
Frequently asked questions
What does ERR_CONNECTION_REFUSED mean?
It means your browser reached out to a server, but the server or a firewall in between rejected the connection. Nothing was listening on the port, or something blocked it on purpose.
Is ERR_CONNECTION_REFUSED a problem with my computer or the website?
It can be either. If the site works on other devices and networks, the issue is on your end. If it fails everywhere, the website’s server is the cause.
What is the difference between ERR_CONNECTION_REFUSED and ERR_CONNECTION_TIMED_OUT?
With a refused connection, the server answered and said no. With a timeout, no answer came back at all. Refused usually points to a stopped service or a closed port, while a timeout often points to an overloaded server or a firewall silently dropping traffic.
Why do I get “localhost refused to connect”?
Usually your local app isn’t running, is using a different port, or is bound to a different address. Check that the app started without errors, confirm the port number, and try http://127.0.0.1:PORT.
Can a VPN cause ERR_CONNECTION_REFUSED?
Yes. A VPN or proxy that is misconfigured, overloaded or blocked by the site can cause the error. Disconnect it and reload the page to test.
Can antivirus software cause ERR_CONNECTION_REFUSED?
Yes. Some antivirus and firewall programs block certain sites or ports, particularly after an update. Temporarily turning off the web protection feature is a quick way to test, as long as you turn it back on.
Is ERR_CONNECTION_REFUSED an HTTP error code?
No. It’s a connection-level error in the browser. The connection never got far enough for the server to return an HTTP status code like 404 or 503.
Will ERR_CONNECTION_REFUSED fix itself?
Sometimes. If it was caused by a short server restart or a network hiccup, it clears within minutes. If a firewall rule, stopped service or wrong setting caused it, it stays until that is fixed.
How do I fix ERR_CONNECTION_REFUSED on my own website?
Check that the web server is running, confirm it listens on ports 80 and 443, make sure no firewall or security group blocks those ports, and verify your DNS record points to the right IP. Then review the server logs for the reason it failed.
Does Chrome show ERR_CONNECTION_REFUSED more than other browsers?
The code name is specific to Chrome and other Chromium-based browsers such as Edge. Firefox and Safari show the same problem with different wording, but the causes and fixes are the same.
Final thoughts
ERR_CONNECTION_REFUSED looks alarming, but the meaning is simple: something said no to your connection. For visitors, the culprit is usually a VPN, proxy, DNS cache or security software. For site owners, it’s most often a stopped web server, a closed port or a firewall rule.
Start by finding out whether the problem is local or global, then work through the matching fixes. If you’re still stuck, check your server logs and your host’s status page, and share what you’ve tried with support.
Still seeing the error after trying these steps? Leave a comment with the exact message, your browser and your setup, and we’ll help you narrow it down.