ctop — Top-Like Interface for Container Metrics
Real-time monitoring dashboard for Docker and runC containers, displaying CPU, memory, network, and I/O metrics in a familiar top-style terminal UI.
What it is
ctop is a terminal-based monitoring tool that brings the familiar Unix top experience to Docker and runC containers. It displays live CPU, memory, network I/O, and disk I/O metrics per container in a scrollable table.
ctop targets developers and DevOps engineers who want quick container resource visibility without setting up a full monitoring stack like Prometheus plus Grafana.
How it saves time or tokens
Instead of parsing docker stats output or piping JSON through jq, ctop provides instant visual feedback in a single command. It also lets you start, stop, pause, and remove containers directly from the TUI, eliminating context-switching to a separate terminal window.
How to use
- Install ctop:
# macOS
brew install ctop
# Linux
sudo wget https://github.com/bcicen/ctop/releases/download/v0.7.7/ctop-0.7.7-linux-amd64 -O /usr/local/bin/ctop
sudo chmod +x /usr/local/bin/ctop
- Run
ctopin your terminal. It auto-detects the Docker daemon.
- Use arrow keys to select a container and press Enter for detailed sparkline graphs.
Example
# Launch ctop
ctop
# Filter containers by name
ctop -f web
# Sort by CPU usage
# Press 's' inside ctop, then select 'cpu'
# Connect to a remote Docker host
DOCKER_HOST=tcp://remote:2375 ctop
Related on TokRepo
- DevOps Tools -- Infrastructure monitoring and container management tools
- Self-Hosted Solutions -- Tools you can run on your own servers
Common pitfalls
- ctop requires access to the Docker daemon socket. If running as a non-root user, add yourself to the
dockergroup or use sudo. - The default refresh interval is 1 second which can cause high CPU on hosts with hundreds of containers. Use the
-iflag to increase the interval. - ctop does not support Kubernetes pods directly. It monitors containers at the Docker/runC runtime level only.
Frequently Asked Questions
ctop is designed for Docker and runC container runtimes. Podman compatibility depends on whether the Podman socket is configured to emulate the Docker API. With podman-docker installed and the socket active, ctop can connect.
Yes. Set the DOCKER_HOST environment variable to point to a remote Docker daemon (e.g., tcp://remote:2375) and ctop will connect to that host instead of the local socket.
ctop shows CPU usage percentage, memory usage and limit, network bytes received and transmitted, and block I/O read and write per container. The detail view adds sparkline history graphs for each metric.
Yes. ctop is compiled as a single Go binary. It has no runtime dependencies beyond access to the Docker daemon socket or runC state directory.
docker stats provides a streaming text table that is hard to sort or filter. ctop adds interactive sorting, filtering, container actions (stop, pause, remove), and sparkline history graphs in a full TUI experience.
Citations (3)
- ctop GitHub— ctop is a top-like interface for container metrics supporting Docker and runC
- Docker Documentation— Docker container stats API for resource usage monitoring
- runC GitHub— runC is the OCI container runtime specification
Related on TokRepo
Discussion
Related Assets
NAPI-RS — Build Node.js Native Addons in Rust
Write high-performance Node.js native modules in Rust with automatic TypeScript type generation and cross-platform prebuilt binaries.
Mamba — Fast Cross-Platform Package Manager
A drop-in conda replacement written in C++ that resolves environments in seconds instead of minutes.
Plasmo — The Browser Extension Framework
Build, test, and publish browser extensions for Chrome, Firefox, and Edge using React or Vue with hot-reload and automatic manifest generation.