Troubleshooting

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.

کروم Easy About 15 min 8 steps Internet, Browser & Website Errors
ERR_CONNECTION_REFUSED Error (Site Refused to Connect): causes and fix — A young woman in a headscarf frowns at her laptop at a shared office desk in the morning.

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

  1. The site's server or the target app is down, or nothing is running on that port.
  2. The address, port number, or http vs. https is wrong.
  3. A proxy, VPN app or browser extension is sending the request to the wrong place.
  4. A firewall or antivirus is blocking that address or port.
  5. 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.

  1. 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.

  2. 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  7. 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.

  8. 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

Terms used on this page

More Internet, Browser & Website Errors problems

All problems Internet, Browser & Website Errors

Last updated:

Type a few letters of the topic; spelling variants are treated as the same.