ERR_CONNECTION_REFUSED Error (Site Refused to Connect): causes and fix
Quick answer: The server turned the connection away, usually because the site or local app isn't running or the address or port is wrong. Check the address first, then try another network.

Symptoms
- "This site can't be reached" with "example.com refused to connect"
- The code ERR_CONNECTION_REFUSED under the error message
- Addresses like localhost or 192.168.1.1 won't open
- One specific site fails while other sites load fine
Likely causes
- The site's server or the target app is down, or nothing is running on that port.
- The address, port number, or http vs. https is wrong.
- A proxy, VPN app or browser extension is sending the request to the wrong place.
- A firewall or antivirus is blocking that address or port.
- The site's server rejects your IP address or your provider's IP range.
Step-by-step fix
Start from step one and test again after each step; steps go from the simplest to the most technical.
-
Double-check the address
Make sure the address is typed correctly, especially http vs. https, www, and any port number after the colon (like :8080). Some routers' admin pages only open over http, not https.
-
Try another device or network
Open the same address on your phone using mobile data. If it's refused there too, the site itself is the problem and you'll have to wait. If it loads, the issue is your device or network, so keep going.
-
Check your VPN and proxy
If a VPN is on, turn it off and try again. On Windows, open "Settings > Network & internet > Proxy" and make sure "Use a proxy server" isn't on unless you set it up yourself; a proxy left behind by a closed app causes similar errors.
-
Check cache and extensions
Open the address in an Incognito window. If it works there, clear the cache in "Delete browsing data" and disable proxy, VPN or ad-blocking extensions one by one.
-
Flush the DNS cache
On Windows, open Command Prompt and run ipconfig /flushdns. It only clears saved site addresses and is completely safe. On a phone, turn airplane mode on and off once.
-
Check firewall and antivirus
Look in your antivirus or firewall alerts to see whether that address or port was blocked. If you trust the site or app, add it as an exception. Don't turn off the whole antivirus.
-
Developers: check the local server
If localhost or 127.0.0.1 is refused, nothing is listening on that port. Make sure your dev server (for example npm run dev) is still running in the terminal without errors and that you're using the right port. To open it from a phone, the server must listen on 0.0.0.0 and Windows Firewall must allow that port.
-
Site owners: check the web server
If it's your site and it refuses everyone, confirm the web server (such as Nginx or Apache) is running, listening on ports 80 and 443, and that the server firewall allows them. If you don't have access, ask your hosting support.
If nothing worked
If the site is refused on every device and connection, the problem is on the site's side. Try again in a few hours or check the service's official channels.
If only one computer gets the error, recheck its proxy settings and extensions and run a full scan with Windows Security; some malware changes network settings.
Don't install unknown "internet error fixer" apps, and don't change network settings because a stranger told you to.
Frequently asked questions
Why does localhost say "refused to connect"?
Nothing is running on that port on your computer: the dev server was closed or crashed, or you typed the wrong port. Check the terminal output and start the server again.
How can I tell if the problem is the site or me?
Open the same address on your phone using mobile data. If you get the same error, the site has a problem; if it loads, your device or network is the cause, so work through steps 3 to 6.
Related problems

ERR_CONNECTION_RESET Error
The connection was cut midway by the network or the server. Reload the page, restart your router, and if a VPN or proxy is on, turn it off and try again.

ERR_CONNECTION_TIMED_OUT Error
The site didn't answer in time, usually because of your connection, a regional block or the site's server. Test on another network first, then restart your router and toggle any VPN.

ERR_PROXY_CONNECTION_FAILED Error (No Internet, Proxy Problem)
Your browser is trying to use a proxy that no longer works, usually one left behind by a closed VPN app. Turn off the manual proxy in Windows settings or the proxy on your phone's Wi-Fi.
Terms used on this page
More Internet, Browser & Website Errors problems
All problems Internet, Browser & Website Errors
Last updated: