Fixing host.docker.internal on Linux
· 2 min read
If you've ever moved a Docker project from a Mac to a Linux server, you've probably hit this error:
Connection refused: host.docker.internal:3000
On macOS and Windows, host.docker.internal is a magic DNS name that resolves to your host machine's IP address. It's incredibly useful for connecting containers to local databases or APIs running outside of Docker.
But on Linux? It doesn't exist by default.