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.
Instalación con revisión previa
Este activo requiere revisión. El prompt copiado pide dry-run, muestra escrituras y continúa solo tras confirmación.
npx -y tokrepo@latest install dcc36ad5-397d-11f1-9bc6-00163e2b0d79 --target codexPrimero dry-run, confirma las escrituras y luego ejecuta este comando.
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.
Preguntas frecuentes
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.
Referencias (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
Relacionados en TokRepo
Discusión
Activos relacionados
cAdvisor — Real-Time Container Resource Monitoring by Google
Analyze container resource usage and performance with Google's cAdvisor. Native Docker support, Prometheus metrics export, and zero-config deployment for production container monitoring.
Termshark — Terminal User Interface for Packet Analysis
Termshark is a terminal-based user interface for tshark that brings Wireshark-like packet inspection to the command line, ideal for analyzing network captures on remote servers.
Netshoot — Container Network Troubleshooting Toolkit
A Docker and Kubernetes network troubleshooting container packed with networking tools like tcpdump, curl, dig, nmap, iperf, and more. Run it as a sidecar or ephemeral debug container.
HuggingFace Chat UI — Open-Source AI Chat Interface
Chat UI is Hugging Face's open-source web interface for conversational AI, powering HuggingChat and supporting any text-generation model via TGI, Ollama, or OpenAI-compatible APIs with features like web search, tool use, and multimodal input.