Skip to content

How to Install and Use Glances on Linux

Install Glances 4 on Linux with pipx, apt, dnf or Docker, then use it in the terminal, the web UI (port 61208) and client/server mode, with a password and a systemd service.

Steps
5
On this page 5 steps

Glances is a free, open-source system monitoring tool for Linux, macOS and Windows, written in Python. It shows CPU, memory, load, disk I/O, network, file systems, sensors, containers and the top processes on one screen. It’s a good alternative to top and htop.

Glances can also run as a web server, so you can watch a server from any browser, and in client/server mode, so you can monitor remote machines from your own terminal. This guide shows how to install the current Glances 4 release on Linux and use all three modes.

Recommended:

What Glances monitors

  • CPU (total and per core), memory, swap and load average
  • Processes, sorted automatically by what’s using the most resources
  • Network interfaces, Wi-Fi and IP addresses
  • Disk I/O, file systems, RAID and SMART status
  • Temperature, fan and battery sensors
  • Docker and Podman containers
  • NVIDIA and AMD GPUs
  • Alerts, uptime and system information

Prerequisites

  • A Linux system, such as Ubuntu 26.04 or 24.04, Debian, Fedora, RHEL, Rocky Linux or AlmaLinux.
  • Python 3.10 or newer to install the latest version with pipx. Ubuntu 24.04 and newer already have it.
  • A user with sudo privileges.

Step 1 of 5Install Glances

There are three ways to install Glances. Pick one.

The packages in distribution repositories are often a major version behind. To get the latest stable release (Glances 4.5.x at the time of writing) with every feature, install it from PyPI with pipx. pipx installs Glances into its own isolated environment, so it can’t break system Python packages.

On Ubuntu and Debian:

sudo apt update
sudo apt install pipx
pipx ensurepath

On Fedora, RHEL, Rocky Linux and AlmaLinux (on RHEL-based systems, enable EPEL first with sudo dnf install epel-release):

sudo dnf install pipx
pipx ensurepath

Open a new terminal so the updated PATH takes effect, then install Glances with all optional features (web UI, containers, sensors, GPU and export modules):

pipx install 'glances[all]'

The glances command is installed in ~/.local/bin. Check the version:

glances -V

To update Glances later, run pipx upgrade glances.

Option B: Install from your distribution’s repository

This is the quickest way, but you may get an older release, and the web UI may need extra packages.

sudo apt install glances        # Ubuntu, Debian
sudo dnf install glances        # Fedora; RHEL/Rocky/Alma with EPEL
sudo pacman -S glances          # Arch Linux

Option C: Run Glances in Docker

The official image is nicolargo/glances. The latest-full tag includes every feature, and latest is a smaller image with the web UI and Docker monitoring. To run Glances in the terminal and monitor the host:

docker run --rm -it --pid host --network host -v /var/run/docker.sock:/var/run/docker.sock:ro nicolargo/glances:latest-full

To run the web UI in the background on port 61208:

docker run -d --restart=always --name glances -p 61208:61208 -e GLANCES_OPT="-w" --pid host -v /var/run/docker.sock:/var/run/docker.sock:ro nicolargo/glances:latest-full

Note: The old one-line installer (curl -L https://bit.ly/glances | /bin/bash) used in earlier versions of this guide is no longer maintained. Use one of the methods above instead.

Step 2 of 5Run Glances in standalone (terminal) mode

Run Glances to monitor the local system in your terminal:

glances

Glances running in standalone mode in a Linux terminal

Values change colour by status: green is OK, blue is careful, magenta is warning and red is critical. Useful keys while Glances is running:

KeyAction
aSort processes automatically (default)
c / mSort processes by CPU / memory
p / iSort processes by name / disk I/O
1Show each CPU core separately
d / n / fShow or hide disk I/O / network / file systems
hShow help with all keys
q or EscQuit

Other useful options:

glances -t 5                    # refresh every 5 seconds (default 2)
glances --percpu                # start with per-CPU view
glances --stdout cpu.user,mem.percent,load   # print values as plain text, good for scripts

Step 3 of 5Run Glances in web server mode

In web mode, Glances serves its dashboard over HTTP on port 61208 so you can open it in a browser. Your installation needs web support: glances[all] with pipx and the Docker images include it.

Start the web server, listening on all interfaces:

glances -w -B 0.0.0.0

Then open http://SERVER_IP:61208 in your browser. To change the refresh interval, add it to the URL, for example http://SERVER_IP:61208/10 for every 10 seconds.

Glances web UI in a browser on port 61208

Protect the web UI with a password

Without a password, anyone who can reach the port sees your system details and process list. Start Glances with --password. It asks for a password and offers to save it in ~/.config/glances/ so you aren’t asked again. The default user name is glances; change it with --username.

glances -w -B 0.0.0.0 --password

If the server is on the internet, also limit access with a firewall, or bind Glances to 127.0.0.1 and put it behind an Nginx reverse proxy with HTTPS.

Open the port in the firewall

sudo ufw allow 61208/tcp                                # Ubuntu, Debian
sudo firewall-cmd --permanent --add-port=61208/tcp      # Fedora, RHEL
sudo firewall-cmd --reload

Use the REST API

Web mode also provides a JSON REST API, which is handy for scripts and dashboards:

curl -s http://localhost:61208/api/4/cpu
curl -s http://localhost:61208/api/4/mem

Step 4 of 5Run Glances in client/server mode

Client/server mode lets you monitor a remote machine from your own terminal, without logging in to it with SSH. Install Glances on both the server you want to watch and your local machine.

On the remote server, start Glances in server mode. In Glances 4 it uses XML-RPC on port 61209:

glances -s --password

Allow port 61209 in the server’s firewall (sudo ufw allow 61209/tcp), then connect from your machine. Replace 192.168.10.100 with the server’s IP:

glances -c 192.168.10.100

Monitoring a remote Linux server with the Glances client

To watch many servers from one screen, list them in the [serverlist] section of ~/.config/glances/glances.conf and run the central browser, glances --browser in the terminal or glances --browser -w in the web UI.

Step 5 of 5Run the Glances web UI as a systemd service (optional)

To keep the web UI running after reboots, create a systemd service. First find the full path of the command:

command -v glances

Create /etc/systemd/system/glances.service, replacing the ExecStart path and User with your own:

sudo nano /etc/systemd/system/glances.service
[Unit]
Description=Glances web server
After=network.target

[Service]
User=ubuntu
ExecStart=/home/ubuntu/.local/bin/glances -w -B 0.0.0.0 --disable-check-update
Restart=on-failure

[Install]
WantedBy=multi-user.target

Then start the service and enable it at boot:

sudo systemctl daemon-reload
sudo systemctl enable --now glances
systemctl status glances

If you set a password, run glances -w --password once as that user and save the password first, so the service can start without asking for it.

Glances 5 (beta)

Glances 5 is in beta. It replaces the XML-RPC server with the REST API, so client/server and web mode share port 61208 and the API moves to /api/5. Server mode also listens only on localhost by default, so add -B 0.0.0.0 for remote access. pip installs the beta only if you ask for it with pip install --pre glances. Stay on Glances 4 for production servers until version 5 is stable.

Troubleshooting

  • glances: command not found after installing with pipx: ~/.local/bin isn’t in your PATH. Run pipx ensurepath and open a new terminal.
  • Web mode fails because modules such as fastapi or uvicorn are missing: your installation doesn’t include web support. Run pipx install --force 'glances[all]'.
  • Can’t open the web UI from another computer: check that Glances listens on 0.0.0.0 (sudo ss -ltnp | grep 61208) and that the firewall or cloud security group allows port 61208.
  • Containers aren’t shown: the user running Glances must be able to read the Docker socket. Add the user to the docker group, or mount /var/run/docker.sock when you use Docker.

Frequently asked questions

What is the default port of Glances?

The web UI and REST API use port 61208. In Glances 4, client/server mode (glances -s) uses port 61209. Change either with -p PORT.

Is Glances better than htop?

They do different jobs. htop is a fast, interactive process viewer. Glances shows the whole system (disks, network, sensors, containers and GPU) and adds a web UI, a REST API and remote monitoring.

Does Glances work on Windows and macOS?

Yes. Glances runs anywhere Python and psutil run. Install it with pipx install 'glances[all]', or on macOS with brew install glances.

How do I export Glances data?

Use an export module, for example glances --export csv --export-csv-file /tmp/glances.csv. Glances can also export to InfluxDB, Prometheus, Elasticsearch and other back ends.

Conclusion

You’ve installed Glances and used it in terminal, web and client/server mode. For quick checks, use glances in the terminal. For a dashboard you can open from anywhere, run the web UI as a systemd service behind a password and a firewall.

References:

Rahul

Rahul Kumar is the founder and chief editor of TecAdmin.net. A Red Hat Certified Engineer (RHCE), he has worked in IT since 2009, with hands-on experience in Linux system administration, DevOps, web hosting, cloud platforms and automation. He started TecAdmin in 2013 to share practical, step-by-step guides, and leads its editorial work with one aim: making technical learning clear and useful for sysadmins, developers and beginners alike.

4 Comments

  1. Detected system: Ubuntu
    Reading package lists… Done
    Building dependency tree
    Reading state information… Done
    Package lm-sensors is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source

    Package python-dev is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source
    However the following packages replace it:
    python-dev-is-python3

    E: Unable to locate package python-pip
    E: Package ‘python-dev’ has no installation candidate
    E: Unable to locate package python-docker
    E: Package ‘lm-sensors’ has no installation candidate

    getting these errors while instaling on ubuntu 20.04 LTS installed on windows

    1. Yes, You can install Glances on Ubuntu 20.04 LTS system. The command will automatically install required Python packages.

Leave a Reply

Your email address will not be published. Required fields are marked *


Back to top