Skip to main content

How to Self-Host Glances: Real-Time System Monitoring Dashboard 2026

·OSSAlt Team
glancesmonitoringsystemdashboardself-hostingdocker2026

TL;DR

Glances (LGPL 3.0, ~26K GitHub stars, Python) is a cross-platform real-time system monitoring tool — like an enhanced htop with a web UI. It shows CPU, RAM, disk I/O, network, processes, Docker containers, sensors, and more in a single dashboard. Run it on any server and access via browser. Unlike Netdata (~72K stars, heavier), Glances is a single Python process with minimal dependencies and no daemon. Perfect for quick server health checks without a full monitoring stack.

Key Takeaways

  • Glances: LGPL 3.0, ~26K stars, Python — htop on the web, single process, minimal
  • Web UI: Browser dashboard with auto-refresh, accessible from any device
  • REST API: Query any metric programmatically
  • Prometheus export: Feed Netdata/Grafana with Glances metrics
  • Docker monitoring: Per-container CPU, RAM, and network stats
  • Plugins: 60+ built-in plugins — disks, network, GPU, sensors, processes

Glances vs Netdata vs htop

FeatureGlancesNetdatahtop
LicenseLGPL 3.0GPL 3.0GPL 2.0
GitHub Stars~26K~72K~7K
Web UIYesYes (rich)No
Setuppip or dockerDockerapt/brew
RAM~50MB~100MB~5MB
Docker monitoringYesYesNo
AlertsBasic700+ rulesNo
Prometheus exportYesYesNo
Multi-hostVia client-serverParent-childNo
History/retentionNoYes (dbengine)No

Part 1: Docker Setup

# docker-compose.yml
services:
  glances:
    image: nicolargo/glances:latest-full    # -full includes all plugins
    container_name: glances
    restart: unless-stopped
    ports:
      - "61208:61208"     # Web UI
      - "61209:61209"     # API
    pid: host
    network_mode: host    # Required for full network monitoring
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /etc/os-release:/etc/os-release:ro
      - glances_config:/glances/conf
    environment:
      GLANCES_OPT: "-w"   # Web server mode
    privileged: true       # For sensor access

volumes:
  glances_config:
docker compose up -d

Visit http://your-server:61208 — the dashboard loads immediately.


Part 2: Without Docker (Direct Install)

For minimal overhead directly on the host:

# Install with full extras:
pip install glances[all]

# Or just the basics:
pip install glances

# Run in web server mode:
glances -w --port 61208

# Or as a systemd service:
sudo tee /etc/systemd/system/glances.service << 'EOF'
[Unit]
Description=Glances monitoring daemon
After=network.target

[Service]
ExecStart=/usr/local/bin/glances -w --port 61208 --config /etc/glances/glances.conf
Restart=on-abort
User=root

[Install]
WantedBy=multi-user.target
EOF

sudo systemctl enable --now glances

Part 3: HTTPS with Caddy

monitor.yourdomain.com {
    basicauth {
        admin $2a$14$hash_here    # caddy hash-password
    }
    reverse_proxy localhost:61208
}

Glances has no built-in auth — protect with Caddy basicauth or leave open on LAN.


Part 4: What Glances Shows

System overview panel:

CPU: 12.3% (8 cores)    Load: 0.5, 0.3, 0.2
RAM: 3.2G / 16G (20%)   Swap: 0 / 8G (0%)

Per-process table (sortable by CPU, RAM, name):

PID   USER    CPU%  MEM%  NAME
1234  www     8.2   2.1   nginx
5678  redis   1.1   0.8   redis-server

Docker containers (auto-detected):

Container        CPU%   MEM      Status
nextcloud        2.1    512M     running
postgres         0.5    256M     running
nginx            0.2    64M      running

Disk I/O:

/dev/sda    Read: 15 MB/s    Write: 8 MB/s

Network interfaces:

eth0   Rx: 12 Mb/s   Tx: 4 Mb/s   Cx: 142

Part 5: Configuration

Create a config file for custom thresholds and display:

# /glances/conf/glances.conf

[global]
refresh=2        # Refresh every 2 seconds
check_update=false

[cpu]
user_careful=50
user_warning=70
user_critical=90

[memory]
careful=50
warning=70
critical=90

[filesystem]
careful=50
warning=70
critical=90

[docker]
# Show Docker stats
all=false        # Only running containers

[processlist]
cpu_careful=50
cpu_warning=70
cpu_critical=90
mem_careful=20
mem_warning=50
mem_critical=70
max_processes=20

[alert]
min_duration=6   # Alert must persist 6 seconds before notifying

Part 6: REST API

Query any metric programmatically:

# Get all stats as JSON:
curl http://your-server:61208/api/3/all | jq

# Specific metrics:
curl http://your-server:61208/api/3/cpu
curl http://your-server:61208/api/3/mem
curl http://your-server:61208/api/3/diskio
curl http://your-server:61208/api/3/network
curl http://your-server:61208/api/3/docker
curl http://your-server:61208/api/3/processlist

# CPU usage:
curl -s http://your-server:61208/api/3/cpu | jq '.total'

# Memory free:
curl -s http://your-server:61208/api/3/mem | jq '.free'

# Top 5 processes by CPU:
curl -s http://your-server:61208/api/3/processlist \
  | jq 'sort_by(-.cpu_percent) | .[0:5] | .[] | {name, cpu_percent, memory_percent}'

Part 7: Prometheus Export

Feed metrics to Grafana:

# Add to docker-compose.yml:
environment:
  GLANCES_OPT: "-w --export prometheus"

Or run the Prometheus exporter separately:

glances -w --export prometheus --port 61208

Then in Prometheus scrape_configs:

- job_name: "glances"
  static_configs:
    - targets: ["server.yourdomain.com:61208"]
  metrics_path: /api/3/all
  params:
    format: [prometheus]

Part 8: Multi-Host (Client-Server Mode)

Monitor multiple servers from one Glances instance:

On each server being monitored:

glances -s --port 61209   # Server mode (XML-RPC API)

Or in Docker:

environment:
  GLANCES_OPT: "-s --port 61209"

On the monitoring client:

glances -c server1.yourdomain.com --port 61209
glances -c server2.yourdomain.com --port 61209

Part 9: Alerts

Basic email alerts when thresholds are exceeded:

# glances.conf
[alert]
min_duration=6

[smtp]
host=smtp.yourdomain.com
port=587
username=noreply@yourdomain.com
password=your-smtp-password
to=ops@yourdomain.com
from=glances@yourdomain.com
ssl=true

For more sophisticated alerting, pipe Glances metrics to Prometheus + Alertmanager.


Maintenance

# Update Glances:
docker compose pull
docker compose up -d

# Logs:
docker compose logs -f glances

# Check current metrics quickly (CLI mode):
docker exec glances glances --stdout cpu.total,mem.percent,load

# Run in terminal mode on host (classic htop-style):
glances

See all open source monitoring and observability tools at OSSAlt.com/categories/monitoring.

Comments