In this tutorial, we'll setup Glances Web Mode on AlmaLinux 10 server.
Introduction
Keeping our servers monitored in real time is essential for reliability and performance. Instead of relying on heavy dashboards or complex agents, Glances gives us a lightweight, web-based monitoring interface that displays system metrics like CPU, memory, disk, network, and running processes — all in a single view.
In this guide, we’ll set up Glances Web Mode on AlmaLinux 10, run it securely behind Apache, protect it using Basic Authentication, and enable HTTPS with Let’s Encrypt (Certbot) for encrypted access.
Prerequisites
Before we begin, ensure we have the following:
- An AlmaLinux 10 on dedicated server or KVM VPS.
- Basic Linux Command Line Knowledge.
- A domain pointing A DNS record to server IP.
Set Up Glances Web Mode on AlmaLinux 10
Step 1: Update the System Packages
Before installing any tool, we should make sure our AlmaLinux 10 system is up-to-date.
Run the following commands:
sudo dnf update -y
sudo dnf upgrade -y
Keeping the system updated ensures we have the latest security patches and dependencies needed for Glances to run smoothly.
Step 2: Install Python 3 and Pip
Glances is written in Python, so we’ll use Python 3 and pip (Python package manager) for installation.
sudo dnf install python3 python3-pip -y
After installation, verify the Python and pip versions:
python3 --version
pip3 --version
AlmaLinux 10 typically comes with Python 3.12 or newer, which is fully compatible with Glances.
Step 3: Install Nginx and Certbot
Nginx will act as a reverse proxy and Certbot will install SSL certificate.
sudo dnf install nginx certbot python-certbot-nginx -y
Start and Enable Nginx
sudo systemctl start nginx
sudo systemctl enable nginx
Configure Firewall
Allow HTTP and HTTPS traffic through our firewall.
sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --permanent --add-service=https
sudo firewall-cmd --reload
Configure SELinux
If you have SELinux enabled, execute following command:
sudo setsebool -P httpd_can_network_connect on
Step 4: Install Glances via Pip
Now, install Glances globally on the server using pip3:
sudo pip3 install glances
To verify Glances installation, run:
glances --version
If everything is correct, the terminal will display the installed Glances version (for example, Glances v4.0.6).
Step 5: Install Optional Dependencies for Better Metrics
Glances supports additional plugins and monitoring features. To unlock full functionality, install the following dependencies:
sudo pip3 install psutil bottle
- psutil: Provides access to CPU, memory, and disk stats.
- bottle: Lightweight web framework used to serve Glances Web UI.
Step 6: Start Glances in Web Mode
Once installed, start Glances in web mode using this command:
glances -w
By default, it runs on port 61208.
To access the dashboard, open a browser and visit:
http://<server-ip>:61208
Replace <server-ip> with the public IP address of our AlmaLinux server.
We’ll see a clean, responsive dashboard showing system load, memory usage, process list, and network throughput.
Step 7: Run Glances as a Background Service
To make Glances run continuously (even after logout or reboot), we can create a systemd service.
Create a new service file:
sudo nano /etc/systemd/system/glances.service
Add the following configuration:
[Unit]
Description=Glances Web Monitoring Service
After=network.target
[Service]
ExecStart=/usr/local/bin/glances -w
Restart=on-failure
User=root
Environment=LC_ALL=C.UTF-8
Environment=LANG=C.UTF-8
[Install]
WantedBy=multi-user.target
Save and close the file (CTRL + O, then CTRL + X).
Now reload and enable the service:
sudo systemctl daemon-reload
sudo systemctl enable glances
sudo systemctl start glances
Check the service status:
sudo systemctl status glances
If it says “active (running),” our web-based monitoring service is live and persistent.
Step 8: Access Glances via Reverse Proxy (NGINX)
For production environments, it’s a good idea to expose Glances behind a reverse proxy such as NGINX for added security and HTTPS support.
Example snippet:
nano /etc/nginx/conf.d/glances.conf
Add following content:
server {
listen 80;
server_name monitor.example.com;
location / {
proxy_pass http://127.0.0.1:61208/;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Then reload NGINX:
sudo systemctl reload nginx
Obtain SSL Certificate
This command will interactively guide us through obtaining the certificate. Certbot will automatically configure Nginx for SSL.
sudo certbot --nginx -d monitor.example.com
Step 9: Secure Access with Authentication (Recommended)
We need the htpasswd utility to create username/password pairs for NGINX authentication.
sudo dnf install httpd-tools -y
Create the Authentication File
We’ll store our login credentials in a secure file (for example /etc/nginx/.htpasswd).
sudo htpasswd -c /etc/nginx/.htpasswd admin
It will prompt for a password — choose a strong one.
To add more users later (without overwriting the file), remove the -c flag:
sudo htpasswd /etc/nginx/.htpasswd anotheruser
Configure NGINX for Glances
Open your Glances proxy config file (or create one if it doesn’t exist):
sudo nano /etc/nginx/conf.d/glances.conf
Then use the following configuration:
server {
listen 80;
server_name monitor.example.com;
location / {
proxy_pass http://127.0.0.1:61208/;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# Enable Basic Authentication
auth_basic "Restricted Area";
auth_basic_user_file /etc/nginx/.htpasswd;
}
}
Save and close the file.
Test NGINX Configuration
Before applying changes, always check syntax:
sudo nginx -t
If it says syntax is ok and test is successful, reload NGINX:
sudo systemctl reload nginx
Test Authentication in Browser
Now when we visit:
https://monitor.example.com
- NGINX will prompt for a username and password.
- Only valid users from /etc/nginx/.htpasswd will get through to Glances.
- Optional: Secure with HTTPS (Highly Recommended)
Step 10: Monitor and Maintain
We can view logs for troubleshooting using:
journalctl -u glances -f
To stop or restart the service anytime:
sudo systemctl stop glances
sudo systemctl restart glances
Regularly updating Glances helps us stay compatible with AlmaLinux 10 updates:
sudo pip3 install --upgrade glances
Final Thoughts
With this configuration, our AlmaLinux 10 server gains a powerful, secure, real-time monitoring dashboard using Glances — fully integrated with Apache and protected with HTTPS.
It’s fast, easy to maintain, and production-safe — perfect for VPS, dedicated servers, or internal infrastructure monitoring.
