The Problem with docker stats
You run docker stats and get a wall of numbers. CPU, memory, network I/O, block I/O. Raw and unwieldy.
You kill the command and try something else. Maybe docker ps -a | grep something.
Minutes pass. You still don’t know what’s actually consuming CPU.
Two tools fix this: ctop and lazydocker. Both give you interactive dashboards for Docker inspection.
ctop: Top for Containers
ctop is like the top command but for containers. It shows CPU, memory, and I/O in a sortable table.
Installation
# macOSbrew install ctop
# Linuxsudo apt-get install ctop
# Or Docker (meta, I know)docker run --rm -it --name=ctop \ --volume /var/run/docker.sock:/var/run/docker.sock \ quay.io/vektorlab/ctop:latestUsage
ctopYou get:
CONTAINER CPU MEM NET RX/TX BLOCK RX/TX STATEpostgres:14 8.5% 512MB 120KB/32KB 0B/4.2MB Runningredis:7 0.2% 48MB 8.5KB/6.2KB 0B/0B Runningmy-api:latest 42% 892MB 2.3MB/5.4MB 0B/2.1MB Runningnginx-proxy 1.2% 32MB 1.2MB/1.5MB 0B/0B RunningIt’s real-time and updates every second. Press p to sort by CPU. Press m to sort by memory. Press q to quit.
Practical Scenario
Your Docker host is sluggish. Run ctop, sort by CPU, and immediately see which container is the culprit. No guesswork. No running three commands.
Keyboard Shortcuts
p → Sort by CPUm → Sort by memoryn → Sort by nameo → View container detailsh → Helpq → QuitPress o on any container to see logs and inspect options.
lazydocker: The Git Diff of Docker
lazydocker is a terminal UI for Docker management. Lighter than Portainer, more interactive than CLI.
Installation
# macOSbrew install lazydocker
# Linux (using Go)go install github.com/jesseduffield/lazydocker@latest
# Or Docker (to keep your system clean)docker run --rm -it \ -v /var/run/docker.sock:/var/run/docker.sock \ -v /yourpath/config:/home/user/.config/lazydocker \ lazyteam/lazydockerWhat You Get
lazydockerInteractive UI:
Containers Images Volumes─────────────────────────────────[postgres:14 ] Running[redis:7 ] Running[my-api:latest ] Running[nginx-proxy ] Running
DETAIL VIEW:Logs Stats─────────────────────────────────2026-04-02 10:34:22 INFO... CPU: 8.5%2026-04-02 10:34:21 INFO... Mem: 512MB2026-04-02 10:34:20 INFO... PID: 1234You can:
- View logs for any container
- See resource usage
- Restart containers
- Stop/start containers
- Remove containers
- Exec into containers
- Inspect configuration
Practical Scenario
Your API is OOMing (out of memory). Open lazydocker, select the container, view stats while you watch logs. See the exact moment memory spikes. Check the logs for the cause.
All without running five separate commands.
Keyboard Shortcuts
Arrows → NavigateEnter → Select/Expandd → Delete containers → Stop containerr → Restart containere → Exec into containerl → View logsc → Container stats? → HelpComparing Them
| Feature | ctop | lazydocker |
|---|---|---|
| View CPU/Memory | ✓ | ✓ |
| View logs | ✓ | ✓ |
| Restart containers | ✗ | ✓ |
| Exec into container | ✓ | ✓ |
| View networks | ✗ | ✓ |
| View volumes | ✗ | ✓ |
| Lightweight | ✓ | ✗ |
| Startup time | Instant | ~1 second |
ctop is for quick inspection. “What’s using CPU right now?”
lazydocker is for troubleshooting. “Let me see logs and stats while I restart this.”
Real-World Example: Debugging a Memory Leak
Your API container is restarting every hour. Memory climbs until the kernel OOMKills it.
lazydocker- Select the api container
- Press
l→ view logs (see the OOMKill events) - Press
c→ view stats (watch memory climb over time) - Press
e→ exec into container (runps aux,top, check for leaks) - Press
r→ restart container
All without ssh’ing into the host, without running docker logs, without juggling six terminal windows.
Installation Recommendations
For servers: Install both. ctop for quick checks, lazydocker for deep investigation.
For local dev: lazydocker is fine. Lighter than Docker Desktop’s UI, faster than Portainer.
For minimal systems: ctop only. Super lightweight, instant startup.
Advanced: Monitoring Multiple Hosts
Both tools work on a single Docker daemon. For multi-host Docker monitoring, they’re not the solution. That’s where you’d use Portainer or Prometheus exporters.
But for a single host or a dev machine? These tools are unmatched.
The Payoff
You stop guessing about container resource usage. You see it in real-time.
Install ctop. It takes 30 seconds. You’ll use it constantly.
Then try lazydocker for deeper troubleshooting. It’s worth the extra second of startup time.
Your docker debugging life just got a lot easier.