Ask Steves · Daily notes · VPS, 20% off · AI Profit Lab · SEO · Money Hub

31 October 2026 · One command a day

How do I see which Docker containers are running on Linux?

The docker ps command lists the containers running on your server right now. It shows each one's image, how long it has been up and which ports it publishes. It is usually the first thing to run when a site behind Docker stops responding, or when you need to know what is actually running on the box.

I learn my automation tips in the AI Profit Boardroom. Have a look here. Affiliate link.

The command

sudo docker ps

sudo is needed because the Docker daemon belongs to root, unless your user is in the docker group. docker is the Docker command-line client. ps stands for "process status", like the Linux command of the same name. Without any flags it shows only containers that are running now.

What you will see

CONTAINER ID   IMAGE            COMMAND                  CREATED       STATUS                         PORTS                    NAMES
3f2a9c1d7b4e   nginx:1.27       "/docker-entrypoint.…"   3 days ago    Up 3 days                      127.0.0.1:8080->80/tcp   sitename-web
8b1e47a0c2d9   postgres:16      "docker-entrypoint.s…"   3 days ago    Up 3 days (healthy)            5432/tcp                 appname-db
c7d05e9f3a61   appname:latest   "node server.js"         2 hours ago   Restarting (1) 8 seconds ago                            appname-api

Each row is one container. STATUS matters most. "Up 3 days" is good. "(healthy)" means the container's own health check is passing. "Restarting (1)" means the main process keeps exiting with code 1, and Docker keeps starting it again. In PORTS, 127.0.0.1:8080->80/tcp means port 8080 on the server, reachable only from the server itself, goes to port 80 in the container. A port with no arrow, like 5432/tcp, is open inside Docker's network only. If you see 0.0.0.0: in front of a port, it is open to the whole internet, and Docker's published ports skip your ufw rules. NAMES is what you pass to other commands, such as sudo docker logs appname-api.

When to use it

Watch out for

Plain docker ps hides containers that have stopped. If a container crashed and did not restart, it will not appear at all, and it is easy to think it was never there. Run sudo docker ps -a to include stopped containers. Their STATUS will read something like "Exited (137) 2 hours ago". Code 137 usually means the process was killed, often because the server ran out of memory. If Docker itself is not responding, check the service with the steps in how to check if a service is running on Linux.

Questions people ask

Why do I get "permission denied" when I run docker ps?

Your user cannot reach the Docker socket. Use sudo, or add the user to the docker group with sudo usermod -aG docker $USER and log in again. Bear in mind that membership of that group is effectively root access.

How do I show only the container names?

Run sudo docker ps --format '{{.Names}}'. It prints one name per line, which works well in scripts.

Running your own containers and checking them directly like this is something you can only do on a server you control. You can get the same VPS with 20% off at https://asksteves.co.uk/vps. Affiliate link.

Want more automation tips? The AI Profit Boardroom on Skool is where I get mine. Have a look here. Affiliate link.

Everything on this blog runs on one Hostinger KVM 8. This link takes 20% off the same box.

GET A VPS, 20% OFF →

Affiliate link.

Related server notes: How do I see which IPs fail2ban has banned? · How do I see all my Node apps running under PM2? · How do I check if a service is running on Linux? · All daily notes