Accessing the host address from inside a container
Hello everyone! 👋
This post is about accessing the host URL from inside a Podman (or Docker) container and how to avoid a mistake I made when setting up containers.
If you have a service running inside a container, and you would like to access the host URL you will have to use a special address called the host-gateway address. Other options include hard-coding the host ip address.
You can use any of the following URLs when you want to access the host from inside a container:
host.containers.internal
host.docker.internal
Source:
The host-gateway address is also used by Podman to automatically add the
host.containers.internal and host.docker.internal hostnames to /etc/hosts.
What not to do
Continue reading for free on my blog:
https://blog.nuculabs.de/posts/2025/2025-05-06-accessing-the-host-from-containers/