How to Check All Docker Containers

When working with Docker, one of the first things you need is visibility into what's running. Here are the essential commands.

List running containers

The most common command shows only currently running containers:

docker ps

List ALL containers (including stopped ones)

By default docker ps hides stopped containers. Add the -a (all) flag to see everything:

docker ps -a

Show only container IDs

Useful for scripting or piping into other commands:

docker ps -aq

For example, to stop every running container at once:

docker stop $(docker ps -q)

Newer, more readable syntax

docker container ls does the same thing as docker ps and is the modern preferred form:

docker container ls        # running only
docker container ls -a     # all containers

Check live resource usage

To see CPU, memory, and network usage of running containers in real time:

docker stats

Filter containers

You can filter by status, name, or other criteria:

# Only exited containers
docker ps -a --filter "status=exited"

# By name
docker ps -a --filter "name=my-app"

Custom output format

Show just the columns you care about:

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

Inspect a single container in detail

docker inspect <container_id_or_name>

View a container's logs

docker logs <container_id_or_name>
docker logs -f <container_id_or_name>   # follow live

Quick reference.

Command What it shows
docker ps Running containers
docker ps -a All containers
docker ps -aq All container IDs only
docker stats Live resource usage
docker inspect <id> Full details of one container
docker logs <id> Container logs

That's all you need to keep tabs on your containers. Bookmark docker ps -a and docker stats — you'll use them daily.