‍Glances is a powerful system monitoring tool that provides real-time insights into various aspects of your AlmaLinux 9 server. In this guide, we will walk you through the step-by-step process of installing Glances using Snap, a cross-platform package manager. By the end of this tutorial, you will have Glances up and running on your AlmaLinux 9 server, allowing you to monitor critical system metrics effortlessly.

Prerequisites

Before we begin, make sure you have the following:

  • A running instance of AlmaLinux 9.
  • SSH access to your server with administrative privileges.

Step 1: Update System

To ensure that your system is up to date, start by running the following command:

sudo dnf update

This will update all the packages on your AlmaLinux 9 server to their latest versions.

Step 2: Install Snapd

Snapd is the package manager we will be using to install Glances. If you don’t have Snapd installed on your system, you can install it by running the following command:

sudo dnf install snapd

Once the installation is complete, enable and start the Snapd service by executing the following commands:

sudo systemctl enable --now snapd.socket
sudo ln -s /var/lib/snapd/snap/snap

Step 3: Install Glances

With Snapd installed and running, you can now proceed to install Glances. Execute the following command:

sudo snap install glances

Snap will download and install the latest version of Glances on your system.

Step 4: Configure Firewall

By default, Glances listens on port 61208. To access Glances from a web browser, you need to allow incoming traffic on this port. Run the following command to open the necessary port in the firewall:

sudo firewall-cmd --zone=public --add-port=61208/tcp --permanent
sudo firewall-cmd --reload

These commands will enable incoming connections on port 61208, allowing you to access Glances remotely.

Step 5: Accessing Glances

With Glances successfully installed and the firewall configured, you can now access it from your web browser. Open your preferred browser and enter the following URL:

http://your-server-ip-address:61208/

Replace your-server-ip-address with the actual IP address of your AlmaLinux 9 server. You should now see the Glances dashboard, displaying real-time system metrics.

Running Glances as a Service

To ensure that Glances starts automatically on system boot and runs in the background, you can set it up as a service. Follow the steps below to create a systemd service for Glances:

  1. Open your favorite text editor and create a new service file:
sudo nano /etc/systemd/system/glances.service
  1. In the editor, paste the following configuration:
[Unit]
Description=Glances System Monitor
After=network.target

[Service]
ExecStart=/snap/bin/glances

[Install]
WantedBy=multi-user.target
  1. Save and close the file.
  2. Enable and start the Glances service with the following commands:
sudo systemctl enable glances.service
sudo systemctl start glances.service

Glances will now start automatically on system boot and run as a background service.

Additional Information

At Shape.host, we specialize in providing reliable and scalable cloud hosting solutions. Our Linux SSD VPS offerings are designed to meet the demands of businesses of all sizes, ensuring maximum performance and uptime. If you need assistance with Glances or any other aspect of your server management, don’t hesitate to reach out to our team of experts.

Conclusion

In this tutorial, we covered the step-by-step process of installing Glances on AlmaLinux 9 using Snap. We started by updating the system and installing Snapd, followed by the installation of Glances itself. We then configured the firewall to allow access to Glances and accessed it from a web browser. Finally, we set up Glances as a service to ensure it runs automatically in the background.

Monitoring your AlmaLinux 9 server with Glances provides valuable insights into its performance and resource utilization, enabling you to make informed decisions and ensure optimal efficiency. With Glances up and running, you can now keep a close eye on your server’s vital statistics with ease.