Guides 11792 Published by

The guide walks through installing the Glances system monitor on a fresh Ubuntu 22.04 LTS setup, offering both the quick “apt install glances” method and a preferred pip‑based installation that pulls in the latest plugins and fixes issues like missing GPU stats. It then shows how to generate and edit the default configuration file (~/.config/glances/glances.conf) to adjust colors, refresh intervals, and enable the web UI permanently. A handy cheat sheet of common Glances commands is provided, along with instructions for creating a systemd service so the monitor can start at boot and be accessed remotely via a lightweight web server. Finally, it advises verifying the installed version and, if necessary, using update‑alternatives to prioritize the newer pip binary over the repository copy.



Install Glances System Monitor on Ubuntu 22.04 LTS

I’ll show you how to get Glances up and running on a fresh 22.04 install, tweak a couple of settings, and fire off the most useful commands straight from your terminal. By the end you’ll have a lightweight, all‑in‑one view of CPU, RAM, disks, network and more—no extra GUI fluff required.

Prerequisites

You need sudo rights and an internet connection. If you’ve ever tried to install something while offline, you know how quickly that “permission denied” feeling creeps in, so make sure your user is in the sudo group:

groups $(whoami)

If sudo isn’t listed, add yourself with usermod -aG sudo $USER and log out/in.

Install from Ubuntu’s repos (quick and dirty)

The simplest route is the official 22.04 repository:

sudo apt update
sudo apt install glances

Why bother with this at all? The repo version is stable, pulls in all required dependencies automatically, and won’t break your system if you later decide to purge it. The downside: it’s usually a couple releases behind the latest Python‑based build, so some newer plugins may be missing.

Grab the newest release with pip (my preferred method)

I ran into an issue where the repo version refused to show GPU stats after I upgraded my NVIDIA driver. Installing via pip solved it because the upstream package pulls in the freshest libraries.

sudo apt install python3-pip # ensure pip is present
sudo -H pip3 install --upgrade glances[all]

The [all] extra bundles optional modules (like psutil, bottle, and sensor support). It adds a few megabytes, but you’ll thank yourself when Glances starts reporting temperature or battery info without extra tinkering.

Real‑world note: I’ve seen this happen after a bad driver update—Glances from the repo kept spitting “sensor not found” errors while the pip version displayed everything correctly.

First run and basic configuration

Run it once to generate the default config file (~/.config/glances/glances.conf):

glances -w # starts the web UI on http://localhost:61208

Close it with Ctrl‑C. Open the newly created config with your favorite editor:

nano ~/.config/glances/glances.conf

A couple of tweaks I always make:

  • disable the rainbow color scheme if you use a dark terminal theme—set color = false.
  • increase the refresh rate for faster response (refresh = 2 instead of default 3 seconds).
  • enable the web UI permanently by adding webserver = true.

Save and exit; the next launch will respect those changes.

Handy commands you’ll actually use

CommandWhat it does
glancesLaunches the interactive curses interface.
glances -wStarts a lightweight web server (perfect for remote monitoring).
glances -t 5Sets a custom refresh interval of 5 seconds.
glances --export csvDumps live stats to a CSV file—useful for quick logs.
systemctl enable glances (after creating a systemd service)Makes Glances start at boot if you want it always on.

If you’re feeling adventurous, drop a simple systemd unit in /etc/systemd/system/glances.service:

[Unit]
Description=Glances System Monitor

[Service]
ExecStart=/usr/local/bin/glances -w
Restart=always
User=nobody
Group=nogroup

[Install]
WantedBy=multi-user.target

Enable it with sudo systemctl enable --now glances.service. Now you have a headless monitor that anyone on the LAN can check via browser.

Quick sanity check

glances -V # prints version, confirming pip install if it shows 4.x+

If the version number looks older than what you expected, double‑check your PATH. Sometimes Ubuntu still points glances at /usr/bin/glances (the apt copy) instead of the pip location (/usr/local/bin/glances). Fix that with:

sudo update-alternatives --install /usr/bin/glances glances /usr/local/bin/glances 99

That forces the system to use the newer binary.

Alright, you should now have a fully functional Glances monitor on Ubuntu 22.04. Play around with the UI, toss in some custom alerts, and enjoy watching your box behave.