docker ps

See your containers: which are running, which stopped, their ports and names.

>_ Try it: a simulated Linux, right here
Loading the terminal…

Examples

  • docker ps
  • docker ps -a
  • docker ps -q
  • docker ps -a | grep Exited
  • docker start site

How it works

docker ps lists the containers that are running, with their ID, image, status, ports and name.

Stopped containers are hidden unless you add -a. A container that "vanished" is usually just stopped: docker ps -a shows it with its exit code.

Syntax

docker ps [OPTIONS]

Options

OptionWhat it does
-aall containers, stopped ones too
-qonly the IDs (handy in scripts)

Good to know

  • STATUS Exited (0) means it finished fine; another number means it failed: check docker logs NAME.
  • The PORTS column reads host->container: 0.0.0.0:8080->80/tcp.