↑ ↓ select, Enter open, Esc close

Get the IP address of a Docker container

Adjust the values, the command updates live
root@server
docker inspect app | grep '"IPAddress"'

Extracts all lines containing IPAddress from the container details. One address appears per network the container is attached to, and empty values ("") are normal for the default entry when the container is only in a custom network.

Note: Container IPs change when the container is recreated. For connections between containers, use the container name in a shared network instead. Docker commands require root or the docker group.

Also searched as

  • docker get container ip address
  • docker inspect ip
  • find ip of running container

Related one-liners

All in Docker

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.