Geonode logo
Network errors

How to Fix ERR_CONNECTION_REFUSED in Chrome

Tell a local server problem from a public site problem, then apply the matching fix.

Updated

TL;DR

ERR_CONNECTION_REFUSED is Chrome reporting that the computer at that address turned its connection down, usually because no server listens on that port. For localhost, start your dev server and open the exact URL it prints; for a public site, check the address and your security software first.

What the error looks like in Chrome and its tools

Chrome names the computer that refused; tools built on Chrome report the same net:: code.

WhereWhat you see
Chrome, local dev serverThis site can't be reached. localhost refused to connect. ERR_CONNECTION_REFUSED
Chrome, address typed as an IPThis site can't be reached. 127.0.0.1 refused to connect. ERR_CONNECTION_REFUSED
Chrome, public siteThis site can't be reached. www.example.com refused to connect. ERR_CONNECTION_REFUSED
Chrome DevTools, Network panel Status column(failed) net::ERR_CONNECTION_REFUSED
Chrome console log, failed fetch()Failed to load resource: net::ERR_CONNECTION_REFUSED
Puppeteer page.goto()net::ERR_CONNECTION_REFUSED at http://localhost:3000
Playwright page.goto()page.goto: net::ERR_CONNECTION_REFUSED at http://localhost:3000/

Why this happens

Chrome reached the computer, but no program there accepts connections on that port.

When nothing is bound to that port, the operating system replies to Chrome's opening TCP packet with a reset, so the connection ends before any page is requested.

Diagnose your ERR_CONNECTION_REFUSED first

The first three checks need only Chrome and a phone; the last two use DevTools and a terminal.

  • Read the host before "refused to connect"; localhost or 127.0.0.1 there means your own computer turned Chrome away.

  • Compare the address bar with the link you opened; if it switched to https:// or another port, Chrome was redirected to a closed port.

  • Open the site on a phone using mobile data; if it loads, this computer or network blocks it; if not, the site's server is down.

  • Open DevTools, Network tab, and reload; if only API rows show (failed) net::ERR_CONNECTION_REFUSED, the page server works and its backend port is closed.

  • Run curl -v with the same URL; if every address it tries ends in Connection refused, the server side is closed, not Chrome.

Solutions ranked by effectiveness

Start with the server when the address is local; the second fix covers public sites, the third forced HTTPS jumps.

  1. Most common fix

    Start the server, then reload its URL

    Applies to local dev setups. The server may have stopped on an error, or moved to the next free port.

    1. Restart the stopped process, fixing the error in its log first.

    2. Copy the URL it prints at startup, port included, into the address bar.

    3. If the page loads without data, start the API server it calls as well.

    4. Click Reload on the error page once the server reports it is ready.

  2. Check next

    Check your side when a public site refuses

    Applies when the error names a public site. A wrong address, a hosts-file entry or security software can turn Chrome away.

    1. Check the address for typos and for a :port number the site never uses.

    2. Delete any hosts-file line that points the site's name at 127.0.0.1 or 0.0.0.0.

    3. In your firewall or antivirus, remove any rule that blocks Chrome or this site.

    4. If the site fails on mobile data too, wait or contact its owner.

  3. For developers

    Undo the jump to HTTPS or port 443

    Applies when the address bar shows https:// or a new port after the error. A redirect or HTTPS-only rule sent Chrome to a port where nothing listens.

    1. Turn off HTTPS redirects in your app's development settings, then reload.

    2. Serve HTTPS on .dev and .app hosts, which Chrome always switches to https://.

    3. Remove a remembered HSTS host via Delete domain security policies at chrome://net-internals/#hsts.

Stop the ERR_CONNECTION_REFUSED from coming back

Habits that keep your server's port open and point Chrome and test runners at it.

  1. Give local projects names like shop.localhost: Chrome resolves them to loopback, and its HTTPS-only preload list has no .localhost entry.

  2. In Playwright Test, set webServer.url, so tests start only after the app answers at that address.

  3. On Linux servers, set Restart=on-failure in the web server's systemd unit, so systemd starts it again after a crash.

A proxy for Chrome aloneGeonode Proxy Manager switches Chrome's proxy without changing your computer's system-wide settings.
Try residential proxies

Related errors

Learn more

FAQ

The machine at that address answered Chrome with a no instead of a page: nothing there accepted connections on that port, or something blocked the attempt.

Your server is bound to IPv6 ::1 alone, which Node.js does on macOS when told to listen on localhost. Chrome tries both IPv6 and IPv4 loopback for that name, so the name works while the literal IPv4 address gets refused.

On a phone, localhost means the phone itself, so open your computer's LAN IP and start the server on all addresses, for example with vite --host. The Android Emulator reaches your computer's 127.0.0.1 at 10.0.2.2.

When the proxy Chrome uses refuses, Chrome shows ERR_PROXY_CONNECTION_FAILED instead. Loopback names and addresses skip any configured proxy by default, so a refusal on your own machine is a direct one.

The web server is stopped, or it listens on another port or only on 127.0.0.1. On Linux, ss -ltn lists listening TCP sockets; port 443 should appear on 0.0.0.0, [::] or the public IP.

Yes, when its rule rejects the connection with a reset. A firewall that silently drops packets causes ERR_CONNECTION_TIMED_OUT instead, and Windows Firewall blocking Chrome's own connection shows ERR_NETWORK_ACCESS_DENIED.

Skip hosts your browser doesn't need

Add them to Geonode's Block list, and the proxy never fetches them.