Why Glances?
htop shows processes. Glances shows everything:
- CPU, RAM, swap — Real-time usage and history.
- Disk I/O — Per-disk read/write speeds.
- Network — Per-interface bandwidth.
- Docker containers — CPU/RAM per container.
- Processes — Sorted by resource usage.
- Sensors — Temperature, fan speed, battery.
- Web UI + API — Monitor remotely.
Prerequisites
- Docker on any Linux/macOS server.
- At least 128 MB RAM.
Step 1: Deploy with Docker
docker run -d \
--name glances \
--restart=always \
--pid host \
-v /var/run/docker.sock:/var/run/docker.sock:ro \
-p 61208:61208 \
-e GLANCES_OPT="-w" \
nicolargo/glances:latest-full
Access at http://your-server:61208.
Step 2: Monitoring Capabilities
| Metric | What it Shows | Alert Threshold |
|---|
| CPU | Usage per core, load average, steal | >70% warning, >90% critical |
| Memory | Used/available, buffers, cache | >70% warning, >90% critical |
| Swap | Usage and I/O | >50% warning |
| Disk I/O | Read/write per disk (MB/s) | Configurable |
| Network | RX/TX per interface (Mbps) | Configurable |
| Docker | CPU/RAM/Net per container | Configurable |
| Processes | Top processes by CPU/RAM | Per-process limits |
| Sensors | Temperature, fan RPM | >80°C warning |
| File systems | Usage per mount point | >80% warning |
Step 3: REST API
# CPU stats
curl http://localhost:61208/api/4/cpu
# Memory stats
curl http://localhost:61208/api/4/mem
# Docker container list
curl http://localhost:61208/api/4/containers
# All available endpoints
curl http://localhost:61208/api/4/pluginslist
Glances vs Alternatives
| Feature | Glances | htop | btop | Netdata |
|---|
| Web UI | Yes | No | No | Yes |
| REST API | Yes | No | No | Yes |
| Docker monitoring | Yes | No | No | Yes |
| Prometheus export | Yes | No | No | Yes |
| Resource usage | ~50 MB RAM | ~5 MB | ~10 MB | ~200 MB |
| Setup | One command | Installed | Package | Agent install |
| Best for | Quick overview + API | Terminal power users | Beautiful terminal | Full monitoring stack |
Troubleshooting
| Problem | Solution |
|---|
| Docker containers not showing | Mount Docker socket: -v /var/run/docker.sock:/var/run/docker.sock:ro |
| High CPU usage by Glances | Increase refresh interval: GLANCES_OPT="-w --time 5" (5 seconds) |
| Sensors not detected | Use latest-full image tag which includes sensor libraries |
| API returns 403 | Set --disable-webui if only using API; check bind address |
Summary
- One-screen overview of CPU, RAM, disk, network, Docker, and processes.
- Web UI + REST API for remote monitoring and automation.
- Prometheus export for integration with existing monitoring stacks.
- Lightweight — ~50 MB RAM vs Netdata’s ~200 MB.
Related Articles