Skip to content
ohsudo, Home

Tags

#localhost

connect ECONNREFUSED 127.0.0.1
Docker & Containers

Docker: "connection refused" to localhost from a container — how to reach the host

Fix "connection refused" when a container connects to localhost: use host.docker.internal or a Compose service name, make the host service listen, and check the firewall.

Beginner · 4 min read