7 November 2026 · One command a day
How do I see memory and CPU use per Docker container on Linux?
docker stats --no-stream prints one snapshot of how much CPU, memory, network and disk each running container is using, then exits. Use it when the server feels slow, memory is running low, or you want to know which container is the heavy one before you restart anything.
I learn my automation tips in the AI Profit Boardroom. Have a look here. Affiliate link.
The command
sudo docker stats --no-streamdocker stats reads live resource figures for every running container. On its own it keeps refreshing the screen until you press Ctrl+C. --no-stream takes one reading, prints it and returns you to the prompt, so you can paste it into a note, pipe it to another command or run it from a script. sudo is needed unless your user is in the docker group. Add a container name at the end, such as sudo docker stats --no-stream appname, to see just that one.
What you will see
CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS
3f2a9c1d7b44 appname-web 2.41% 212.6MiB / 31.34GiB 0.66% 1.2GB / 860MB 45.1MB / 12.3MB 23
8b7e5d02a913 appname-db 0.87% 1.104GiB / 31.34GiB 3.52% 640MB / 1.1GB 2.3GB / 4.8GB 41
c90d14e6f2ab sitename 134.20% 2.87GiB / 4GiB 71.75% 98MB / 15MB 310MB / 0B 12Each row is one container. CPU % is measured against a single core, so on an 8-core server a busy container can show up to 800%. MEM USAGE / LIMIT is the memory in use and the most it is allowed. MEM % is usage as a share of that limit. NET I/O and BLOCK I/O are totals since the container started, not current speeds. PIDS is the number of processes inside. In this example, sitename is using more than one core and is near its 4 GiB cap, so it is the one to look at.
When to use it
- The server's load is high and you need to find which container is causing it.
- A container keeps restarting and you suspect it is hitting its memory limit and being killed.
- You are deciding whether there is room for another app, and want a quick record of what the current ones use.
To check which containers are running in the first place, see how to see which Docker containers are running. To keep an eye on the figures, you can drop --no-stream, or use watch to rerun a command every 2 seconds.
Watch out for
If a container has no memory limit, the LIMIT column shows the total RAM of the whole server, and MEM % looks small and harmless. That does not mean the container is safe. It means nothing stops it from using all the memory on the host. If one container's usage keeps growing, set a limit with mem_limit in your Compose file or --memory on docker run.
Questions people ask
Why does CPU % show more than 100%?
The figure is per core, so 200% means the container is using the equivalent of two full cores. That is normal on a multi-core server.
Can I show only the columns I care about?
Yes. Use sudo docker stats --no-stream --format "table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}" to print just the name, CPU and memory.
Seeing what every container really uses is the kind of thing 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.
Affiliate link.