localhost, 127.0.0.1 and 0.0.0.0: what changes?
Understand loopback, all-interface bindings and IPv6 when a service works locally but not from another device.
This guide separates bind addresses from client destinations. Dual-stack behavior depends on the OS and application; an :: listener does not by itself prove IPv4 access.
1. Loopback means this environment
127.0.0.1 is IPv4 loopback and ::1 is IPv6 loopback. localhost may resolve to either or both; binding only one family can leave the other unreachable. Inside a container it normally refers to that container, not the host.
2. An all-interface bind is not a destination URL
Binding to 0.0.0.0 accepts connections on local IPv4 interfaces; clients should use an actual host address. Firewalls, routing, NAT and container publishing still determine external reachability. Remove unnecessary exposure after testing.
3. Compare address families
These local HTTP tests force IPv4 and IPv6 separately. If only one succeeds, inspect name resolution and listener addresses before broadening the bind address.
curl --noproxy "*" -4 --connect-timeout 3 --max-time 10 -I http://localhost:3000/
curl --noproxy "*" -6 --connect-timeout 3 --max-time 10 -I http://localhost:3000/Sources and review
Sources checked on: