docker ps Explained

What docker ps does, with an example.

Published November 7, 2026

docker ps lists running containers with their ID, image, command, status, ports and name. Add -a to include stopped ones.

How it works

Use filters and formatting for scripting. docker container ls is the same command in the newer syntax.

The ID can be abbreviated in other commands.

Try it

docker ps
CONTAINER ID IMAGE STATUS PORTS NAMES
a1b2c3 nginx Up 3 minutes 0.0.0.0:8080->80/tcp web

Practical examples

All containers

docker ps -a

Only IDs

docker ps -q

Filter

docker ps --filter status=exited --filter name=web

Custom format

docker ps --format "table {{.Names}}\t{{.Status}}\t{{.Ports}}"

Common mistakes

  • Forgetting -a and wondering where a crashed container went.
  • Parsing the human table in scripts.
  • Not noticing restart loops (STATUS: Restarting).

Key takeaways

  • docker ps lists running containers with their ID, image, command, status, ports and name.
  • Run docker <command> --help for all options.
  • Clean up unused resources regularly.

FAQ

How do I see sizes?

docker ps -s.

Where can I see all options?

Run the command with --help.

More General articles