Terminal GuideTerminal Guide
glances icon

glances

System Monitoring
macOSLinuxWindows
Python

System monitoring tool with web interface and REST API.

Official Website

Features

Web InterfaceREST APIExport DataPlugin System

Installation

Homebrew
brew install glances
APT (Debian/Ubuntu)
apt install glances
Pacman (Arch)
pacman -S glances
pip
pip install glances

Why Use glances?

Web Interface

Built-in Web UI for browser-based system monitoring. Perfect for remote server monitoring.

REST API

Retrieve system information via RESTful API. Easy integration with monitoring systems and dashboards.

Docker/Kubernetes Support

Features specialized for container environment monitoring. Monitor Docker, Podman, and Kubernetes containers.

Client/Server Mode

Monitor multiple remote servers from a single dashboard. Runs in server and client modes.

Installation

installation
# pip (recommended)
pip install glances

# With all optional features
pip install 'glances[all]'

# With Web UI feature
pip install 'glances[web]'

# macOS (Homebrew)
brew install glances

# Ubuntu/Debian
sudo apt install glances

# Fedora
sudo dnf install glances

# Arch Linux
sudo pacman -S glances

# Docker
docker run -d --name=glances -p 61208:61208 -v /var/run/docker.sock:/var/run/docker.sock:ro nicolargo/glances:latest-full

Basic Usage

basic-usage
# Normal launch (TUI mode)
glances

# Launch in Web server mode
glances -w

# Launch Web server on specific port
glances -w -p 8080

# Launch in server mode (waiting for remote connections)
glances -s

# Connect to server in client mode
glances -c server_ip

# Specify update interval (seconds)
glances -t 5

# Export statistics to CSV
glances --export csv --export-csv-file /tmp/glances.csv

# Docker-only mode
glances --enable-plugin docker

# Batch mode (for scripts)
glances --stdout cpu.total,mem.percent

Screen Display

server-01 (Ubuntu 22.04 64bit / Linux 5.15.0-generic) Uptime: 3 days, 12:45:21 CPU [||||||||||||||||||||||||||||||||░░░░░░░░░░░░░░░░░░] 63.2% MEM [████████████████████░░░░░░░░░░] 66.7% user: 45.2% system: 12.1% idle: 36.8% total: 16.0G used: 10.7G free: 5.3G iowait: 2.5% steal: 0.0% active: 8.2G buffers: 512M SWAP [░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░] 0.0% LOAD 1.45 1.23 0.98 (4 cores) NETWORK Rx/s Tx/s DISK I/O Read/s Write/s eth0 5.8M/s 1.2M/s sda 15.2M/s 8.5M/s docker0 256K/s 128K/s sdb 2.1M/s 512K/s FILE SYS Used Total Use% SENSORS / 45.2G 100.0G 45% CPU: 52°C /home 128.5G 500.0G 26% GPU: 65°C /var/lib/docker 25.3G 50.0G 51% CONTAINERS (Docker) CPU% MEM% NET I/O BLOCK I/O nginx-proxy 2.1 0.5 1.2M / 512K 0B / 0B postgres-db 15.2 12.5 256K / 128K 5.2M / 2.1M redis-cache 0.8 1.2 64K / 32K 0B / 0B app-server 8.5 3.2 2.1M / 1.5M 128K / 64K PROCESSES (sorted by CPU%) PID USER CPU% MEM% VIRT RES TIME+ NAME 1234 www-data 25.0 3.2 2.1G 512M 12:34:56 node 5678 mysql 15.2 12.5 4.5G 2.0G 45:12:34 mysqld 9012 root 12.1 1.6 1.0G 256M 8:21:15 nginx

Display Sections

CPU/MEMCPU usage (user/system/idle/iowait) and memory status
SWAP/LOADSwap usage and load average (1/5/15 min)
NETWORKSend/receive speed per network interface
DISK I/ORead/write speed per disk
FILE SYSFilesystem usage
CONTAINERSDocker/Podman container status (optional)
PROCESSESProcess list (sortable)

Color Meanings

Green: OK (normal)
Yellow: CAREFUL (caution)
Orange: WARNING (warning)
Red: CRITICAL (critical)

Keyboard Shortcuts

KeyFunction
hShow help screen
q / EscExit glances
1Toggle global CPU stats and per-core
2Toggle left sidebar
3Toggle quick look
/Filter processes
aAuto sort processes
cSort by CPU%
mSort by MEM%
pSort by process name
iSort by I/O rate
tSort by CPU time
dToggle disk I/O stats
fToggle filesystem stats
nToggle network stats
sToggle sensor stats
DToggle Docker stats
kKill selected process
eToggle extended process info
wToggle warning logs

Web Interface

One of glances' greatest features is browser-based monitoring via the built-in Web server.

web-mode
# Launch in Web mode (default port: 61208)
glances -w

# Launch on custom port
glances -w -p 8080

# Enable authentication
glances -w --username admin --password secret

# Enable SSL
glances -w --ssl-cert cert.pem --ssl-key key.pem

# Access in Web mode
# Open http://localhost:61208 in browser

Web UI Features

  • Responsive design viewable from smartphones
  • Real-time updates (default 3-second interval)
  • Dark theme support
  • Interactive display of all statistics

REST API

glances provides a RESTful API to retrieve system information programmatically.

rest-api
# API is also available when launching in Web mode
glances -w

# Get list of available plugins
curl http://localhost:61208/api/3/pluginslist

# Get CPU information
curl http://localhost:61208/api/3/cpu

# Get memory information
curl http://localhost:61208/api/3/mem

# Get process list
curl http://localhost:61208/api/3/processlist

# Get Docker container information
curl http://localhost:61208/api/3/docker

# Get all statistics
curl http://localhost:61208/api/3/all

# Get specific value
curl http://localhost:61208/api/3/cpu/total

Client/Server Mode

Monitor multiple servers from a single machine.

client-server
# Server side (monitored target)
glances -s

# Server side (with password)
glances -s --password

# Server side (bind to specific IP)
glances -s -B 0.0.0.0

# Client side (monitoring side)
glances -c 192.168.1.100

# Client side (with password)
glances -c 192.168.1.100 --password

# Monitor multiple servers (browser mode)
glances --browser

Settings and Customization

Detailed customization is possible via config files.

config-location
# Configuration file location
~/.config/glances/glances.conf

# or
/etc/glances/glances.conf

# Generate default config
glances --config-file ~/.config/glances/glances.conf

Configuration File Example

glances.conf
[global]
# Update interval (seconds)
refresh=3

# History length
history_size=1200

[cpu]
# CPU thresholds (warning color switching)
careful=50
warning=70
critical=90

[mem]
# Memory thresholds
careful=50
warning=70
critical=90

[network]
# Interfaces to monitor
hide=lo,docker.*

[diskio]
# Disks to monitor (regex)
hide=loop.*,/dev/dm-.*

[fs]
# Filesystems to monitor
hide=/boot.*,/snap.*

[docker]
# Docker container monitoring
disable=false

[processlist]
# Default process list sort
sort_key=cpu_percent

[amps]
# Application Monitoring Process
enable=true

[ports]
# Port monitoring
[[ports.port]]
host=localhost
port=80
description=HTTP
refresh=60

Data Export

glances can export data in various formats.

export
# Export in CSV format
glances --export csv --export-csv-file /tmp/glances.csv

# Export to InfluxDB
glances --export influxdb

# Expose as Prometheus endpoint
glances --export prometheus

# Export to Elasticsearch
glances --export elasticsearch

# JSON for Grafana
glances --export json --export-json-file /tmp/glances.json

# Export to multiple destinations
glances --export influxdb,prometheus

Tips

1. Docker Monitoring Configuration

To monitor Docker, the glances user must be in the docker group or have read permissions on the socket. You can also mount the Docker socket with -v /var/run/docker.sock:/var/run/docker.sock:ro to monitor from within a container.

2. Grafana Integration

Export to InfluxDB and visualize in Grafana to display system history on beautiful dashboards. Official Grafana dashboard templates are available for glances.

3. AMPs (Application Monitoring Processes)

Use the AMPs feature for detailed monitoring of specific applications (nginx, mysql, postgres, etc.). Can be enabled in the config file.

4. Alert Configuration

Set thresholds for CPU, memory, and disk in the config file to display alerts at three levels: critical/warning/careful.

5. systemd Service

Register glances as a systemd service to automatically start in Web server mode on system boot. Combine with glances --export for continuous monitoring.

6. Script Integration

Use the --stdout option to output specific metrics to stdout. Useful for automation in shell scripts. Example: glances --stdout cpu.total,mem.percent

Written by Dai AokiPublished: 2026-01-20

Related Articles

Explore More