π What Is Glances? #
Glances is a terminal-based monitoring tool that lets you monitor CPU, RAM, Disk, Network, and Processes in real time. Ideal for server administration and system performance debugging.
Key Features of Glances: β Real-time interactive display β Supports remote monitoring via web β Lightweight and fast β Compatible with Linux, macOS, and Windows (WSL)
π₯ Step 1: Install Glances on Linux #
Glances can be installed using pip (Python Package Manager) or your Linux distro’s package manager.
Method 1: Install via Pip (Recommended) #
sudo apt update && sudo apt upgrade -y # For Debian/Ubuntu
sudo dnf update -y # For Fedora/CentOS
sudo pacman -Syu # For Arch Linux
# Install pip (if not installed)
sudo apt install python3-pip -y # Debian/Ubuntu
sudo dnf install python3-pip -y # Fedora/CentOS
# Install Glances
pip3 install glances
Method 2: Install via Package Manager #
# Debian/Ubuntu
sudo apt install glances -y
# Fedora/CentOS
sudo dnf install glances -y
# Arch Linux
sudo pacman -S glances
Verify Installation:
glances --version
βοΈ Step 2: Run Glances #
You can run Glances with the following command:
glances
To run in web server mode (access via browser):
glances -w
Open your browser and go to:
http://YOUR-IP:61208
π Step 3: Set Auto Start on Boot #
To make Glances run automatically at boot, use systemd.
1. Create Glances Service File #
Create the systemd config file:
sudo nano /etc/systemd/system/glances.service
Add the following configuration:
[Unit]
Description=Glances Monitoring Tool
After=network.target
[Service]
ExecStart=/usr/local/bin/glances -w
User=root
Restart=always
RestartSec=10
[Install]
WantedBy=multi-user.target
(Note: Adjust the ExecStart path if Glances is installed elsewhere. Check with which glances)
2. Enable & Start the Service #
sudo systemctl daemon-reload
sudo systemctl start glances
sudo systemctl enable glances
3. Check Service Status #
sudo systemctl status glances
If the status shows active (running), Glances is successfully running on boot.
π§ Troubleshooting #
-
Port 61208 Blocked? Make sure your firewall allows access:
sudo ufw allow 61208/tcp # For Ubuntu/Debian sudo firewall-cmd --add-port=61208/tcp --permanent && sudo firewall-cmd --reload # Fedora/CentOS -
Error “Glances not found”? Check Python PATH or reinstall Glances.
π― Summary #
With Glances, you can monitor your Linux system performance in real time. With auto start enabled, Glances will always run after reboot.
π₯ Extra Tips:
- Use
glances -2for 2-second refresh mode. - Remote monitoring is accessible via smartphone browser.
Now your system is well monitored! π