How to Monitor System Resources Using Glances on Linux

Why Choose Glances Over Top or Htop?

While top and htop are excellent tools for monitoring CPU and memory usage, they lack visibility into other critical system components like disk I/O, network bandwidth, and hardware sensors. Glances is a cross-platform monitoring tool written in Python that provides a comprehensive, single-screen dashboard covering CPU, RAM, Swap, Load, Network, Disk I/O, and even Docker containers, making it the ultimate command-line system monitor.

Step 1: Install Glances

Glances is available in most default Linux repositories, but it can also be installed via Python’s package manager (pip) to ensure you have the latest version.

To install via the package manager (Ubuntu/Debian):

sudo apt update && sudo apt install glances -y

To install via PIP (recommended for the latest features):

sudo apt install python3-pip -y

sudo pip3 install glances

Step 2: Launch the Glances Dashboard

To start monitoring your system, simply type the command:

glances

The terminal will clear, revealing a highly organized interface. The top section displays CPU and memory, the left side lists processes, and the right side shows network interfaces, disk I/O, and filesystem usage.

Step 3: Understand the Color Coding

Glances uses a traffic-light color system to help you identify bottlenecks instantly:

  • Green: OK (everything is fine)
  • Blue: CAREFUL (needs attention, usually above 50% usage)
  • Violet: WARNING (starting to become a problem, usually above 70%)
  • Red: CRITICAL (bottleneck detected, usually above 90%)

Step 4: Use Keyboard Shortcuts

While Glances is running, you can press various keys to toggle features or sort processes:

  • m: Sort processes by MEM usage.
  • c: Sort processes by CPU usage.
  • d: Show/hide disk I/O stats.
  • n: Show/hide network stats.
  • q: Quit the application.

Step 5: Run Glances in Web Server Mode

One of the most powerful features of Glances is its built-in web server. This allows you to monitor a headless Linux server remotely via a web browser.

Start Glances in web mode using the -w flag:

glances -w

Open a web browser on another computer and navigate to the server’s IP address on port 61208 (e.g., http://192.168.1.50:61208). You will see the exact same Glances dashboard rendered perfectly in your browser.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.