This guide intends to show you how you can Monitor your Ubuntu server with Glances Tool remotely. Monitor your server by using the Glances is a good way to keep track of your server’s performance and resource usage. Glances is a cross-platform monitoring tool that provides you with server information like CPU, memory, load, disk I/O, network I/O, and more. Also, Glances can be run in two modes: client/server mode, and web server mode.
Now follow the steps below to start your Glances setup on the Ubuntu server.
Steps To Learning Monitor the Ubuntu Server with Glances Remotely
Before you start the Glances installation, you must access your Ubuntu server like Ubuntu 22.04 and Ubuntu 20.04 as a non-root user with sudo privileges. We use Ubuntu 22.04 to show you the guide steps. For this purpose, you can check the Ubuntu 22.04 Initial Setup Guide.
Then, follow the steps below to complete this guide.
Step 1 – Install Glances Monitoring Tool on Ubuntu Server
First, you must run the system update with the command below:
sudo apt update
The Glances packages are available in the Ubuntu 22.04 default repository. To run Glances in Web server mode, you need to install the Python bottle module too.
So you can install the packages by using the commands below:
# sudo apt install python3-pip -y
# sudo pip install bottle
# sudo apt install glances -y
Also, if you have a running UFW firewall, you need to open port 61208 which is the default port of Glances. To do this, you can run the command below:
sudo ufw allow 61208
Reload the firewall to apply the new rules:
sudo ufw reload
Note: to get more UFW firewall information, you can visit the Essential UFW Firewall Commands and Rules with Examples.
Step 2 – Enable and Access Glances Web Server Mode on Ubuntu
At this point, you need to enable the web server mode for Glances. To do this, you can simply run the following command:
In your output, you will see:
At this point, you can access the Glances web interface from your browser:
Step 3 – Run Glances Web Server Mode as a Service
At this point, you can make your Glances server mode as a service on Ubuntu. To do this, create a systemd unit file for it:
sudo vi /usr/lib/systemd/system/glancesweb.service
Then, add the following content to the file for the Glances web server mode:
Description = Glances in Web Server Mode
After = network.target
ExecStart = /usr/bin/glances -w -t 5
WantedBy = multi-user.target
When you are done, save and close the file.
At this point, you can easily start and enable your service with the following commands:
# sudo systemctl enable glancesweb.service
# sudo systemctl start glancesweb.service
Verify your service is active and running:
sudo systemctl status glancesweb.service
Now you can easily monitor your Ubuntu server remotely from any device. You just need to follow the URL below:
From there, you can check your CPU and memory usage and other stuff related to your system performance.
For more information, you can check the official documentation.
At this point, you have learned to Monitor the Ubuntu Server with Glances Remotely. This is a good option to keep track of your server’s health and performance from another location. Hope you enjoy it. Also, you may like to read the following articles: