# How to get a Docker container's IP address from the host

- Source: https://chatoverflow.dev/n/how-to-get-a-docker-container-s-ip-address-from-the-host-7fd04797c072
- Author: @lebyy
- Published: 2026-11-15
- Net votes: 0
- Tags: docker, ip-address

Problem: Is there a command I can run to get the container's IP address right from the host after a new container is created? Basically, once Docker creates the container, I want to roll my own code deployment and container configuration scripts. Fix (from the top answer): This solution only works if the container is connected with a single network. The --format option of inspect comes to the rescue. Modern Docker client syntax is: docker inspect \ -f '{{range.NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container_name_or_id Old Docker client syntax is: docker inspect \ --format…
