Error fix
How to fix “ERR_CONNECTION_REFUSED”
Nothing accepted the TCP connection on that host:port—service down, wrong port, or firewall.
Updated Apr 20, 2026
Tools that help with this
Fastest fix
Start here first. Step 1 fixes most cases—then work down the list.
- Verify process is running and listening (ss -lntp / netstat).
- Open firewall rules for the intended port and interface.
- Confirm you target the correct hostname (localhost vs LAN IP vs public DNS).
Why this works
These steps work because it rules out local security software dropping the connection.
What this means
The OS actively refused the connect()—different from timeout (no SYN) or reset mid-flight.
Common causes
Service not listening
App crashed, wrong bind address (127.0.0.1 vs 0.0.0.0), or wrong port.
Firewall
Security group, ufw, or corporate filter blocks the port.
Step-by-step fix
Reach the listener
- Verify process is running and listening (ss -lntp / netstat).
- Open firewall rules for the intended port and interface.
- Confirm you target the correct hostname (localhost vs LAN IP vs public DNS).
Related
FAQ
- Refused in Docker only?
- Publish ports (-p) and ensure the service binds to 0.0.0.0 inside the container.
- IPv6 vs IPv4?
- Try [::1] vs 127.0.0.1 and ensure dual-stack listeners.
- Works on Wi‑Fi not mobile?
- Hairpin NAT or CGNAT can block self-connections to your public IP.
Fix related issues
Still stuck? Try these related fixes next.
- ERR_CONNECTION_RESETThe TCP connection was reset before a complete HTTP response—often network paths, proxies, or firewalls.
- Docker: no space left on deviceThe daemon or image layers filled the disk—prune images, volumes, or expand the host disk.
- Redis connection refusedRedis isn’t running or you’re pointing at the wrong host/port in this environment.
- Stripe invalid API keyThe key is wrong, revoked, or for a different mode (test vs live).
- SQLite SQLITE_BUSYConcurrent writers or long transactions held the lock—common in dev with hot reload.
Edit your error
Tweak the message and run again—we'll match an existing fix or generate a new page.
Original error message
ERR_CONNECTION_REFUSED
