↑ ↓ select, Enter open, Esc close

Show the published ports of a Docker container

Adjust the values, the command updates live
root@server
docker port app

Lists the published ports in the format 80/tcp -> 0.0.0.0:8080. If it shows 0.0.0.0 or [::], the port is reachable on all interfaces, with 127.0.0.1 only locally, for example for a reverse proxy in front.

Note: Ports published by Docker often bypass ufw rules because Docker sets its own iptables rules. Therefore bind services behind a proxy to 127.0.0.1. Docker commands require root or the docker group.

Also searched as

  • docker show port mapping
  • which ports does docker container expose
  • docker port command

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.