LightAtom

ERR_CONNECTION_REFUSED: What It Means and How to Fix It

The browser reached the server, but the server actively refused the connection, usually because nothing is listening on that port or a firewall rejected it.

ERR_CONNECTION_REFUSED

Your browser reached the server's address, but the server replied “no” right away: nothing accepts connections on that port, or a firewall rejected it.

Quick checks

  • Check the address, especially the port (:8080) and http vs https.
  • Open the site on another device or network. If it fails everywhere, the server is down.
  • If it's localhost, make sure your development server is actually running.
  • Disconnect VPNs and proxies, then try again.

Fixes on Mac

  1. For localhost: check that the server is listening

    1. Run lsof -nP -iTCP:3000 -sTCP:LISTEN in Terminal, replacing 3000 with your port.
    2. No output means nothing is listening: start the server, or check it isn't crashing on start.
    3. If it listens on 127.0.0.1 but you open [::1] (or the reverse), make both match; see the localhost guide.
  2. Clear Chrome's cache and sockets

    1. Open chrome://net-internals/#sockets and click Flush socket pools.
    2. Reload with ⌘⇧R to bypass the cache.
  3. Turn off proxies

    1. System Settings › Network › Wi-Fi › Details › Proxies: turn off any proxy you don't use.
    2. A proxy app that has quit (Charles, a VPN) can leave a dead proxy configured, which refuses every connection.
  4. Check the macOS firewall and security tools

    1. Firewalls like Little Snitch or LuLu can block a connection; check their logs for the site or app.

Fixes on Windows

  1. Reset proxies and network settings

    1. Settings › Network & internet › Proxy: turn off Use a proxy server.
    2. Run netsh winsock reset in an administrator Command Prompt and restart.
  2. Check Windows Firewall and antivirus

    1. Temporarily pause third-party antivirus web protection and retry.

Other devices

  1. Phones and other devices

    1. Try the site on mobile data; if it works there, restart your router.
    2. Make sure you're not using a numeric address with a port meant only for your local network.

Still not working?

If the site refuses connections from every network, the server is down or its service isn't running. As a visitor, wait or contact the site. As the owner, check that the web server (nginx, Apache, Node) is running, listening on the right port and interface (0.0.0.0 vs 127.0.0.1), and that the firewall or cloud security group allows the port.

See what’s happening

LightAtom's Ports view shows every port your Mac is listening on and the app that owns it, so you can see at a glance whether your local server is up and on which address.

Frequently asked questions

What does connection refused mean?

The server's operating system answered your connection attempt with a reset: no program is listening on that port, or a firewall actively rejected it. It differs from a timeout, where nothing answers at all.

How do I fix ERR_CONNECTION_REFUSED on localhost?

Start your development server and confirm it's listening with lsof -nP -iTCP:PORT -sTCP:LISTEN. Use the same address it listens on: localhost may resolve to ::1 while the server listens only on 127.0.0.1.

Is ERR_CONNECTION_REFUSED a problem with my computer?

Usually not: the server refused. Local causes are a dead proxy setting, security software, or a typo in the port. If other sites load and this one fails everywhere, it's the server.

What is the difference between refused and timed out?

Refused is an instant no from the server. Timed out means no reply at all, often because a firewall silently drops the traffic or the server is unreachable.

LightAtom team

The people who build LightAtom, a network monitor for macOS.