Skip to content
Go back

ctop and lazydocker: Docker Monitoring Tools

By SumGuy 4 min read
ctop and lazydocker: Docker Monitoring Tools

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

Terminal window
# macOS
brew install ctop
# Linux
sudo 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:latest

Usage

Terminal window
ctop

You get:

CONTAINER CPU MEM NET RX/TX BLOCK RX/TX STATE
postgres:14 8.5% 512MB 120KB/32KB 0B/4.2MB Running
redis:7 0.2% 48MB 8.5KB/6.2KB 0B/0B Running
my-api:latest 42% 892MB 2.3MB/5.4MB 0B/2.1MB Running
nginx-proxy 1.2% 32MB 1.2MB/1.5MB 0B/0B Running

It’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 CPU
m → Sort by memory
n → Sort by name
o → View container details
h → Help
q → Quit

Press 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

Terminal window
# macOS
brew 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/lazydocker

What You Get

Terminal window
lazydocker

Interactive 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: 512MB
2026-04-02 10:34:20 INFO... PID: 1234

You can:

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 → Navigate
Enter → Select/Expand
d → Delete container
s → Stop container
r → Restart container
e → Exec into container
l → View logs
c → Container stats
? → Help

Comparing Them

Featurectoplazydocker
View CPU/Memory
View logs
Restart containers
Exec into container
View networks
View volumes
Lightweight
Startup timeInstant~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.

Terminal window
lazydocker
  1. Select the api container
  2. Press l → view logs (see the OOMKill events)
  3. Press c → view stats (watch memory climb over time)
  4. Press e → exec into container (run ps aux, top, check for leaks)
  5. 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.


Share this post on:

Send a Webmention

Written about this post on your own site? Send a webmention and it may appear here.


Previous Post
1-Bit LLMs: The Quantization Endgame
Next Post
AMD Lemonade: Local LLM Serving for AMD GPUs

Related Posts