How to Install Cacti on Elementary OS Latest

Cacti is an open-source network monitoring and graphing tool that makes it easy to visualize and monitor network bandwidth, memory usage, CPU utilization and other key parameters. Installing Cacti on your Elementary OS is easy, and this guide will walk you through the process.

Prerequisites

Installing Prerequisites

Before we proceed with the installation of Cacti, we need to install some prerequisites. Open a terminal and run the following command:

sudo apt-get update
sudo apt-get install apache2 libapache2-mod-php7.4 mysql-server php7.4 php7.4-snmp php7.4-gd php7.4-mysql php7.4-cli php7.4-xml php7.4-mbstring snmp graphviz

This command will install the necessary packages to run Cacti on your Elementary OS system.

Installing Cacti

Once the prerequisite packages are installed, let’s move on to install Cacti from the official website. Follow the below steps to install Cacti on your system.

  1. Download the latest Cacti version from http://www.cacti.net/downloads/cacti-latest.tar.gz. You can do this directly from the terminal using the wget command:

    wget http://www.cacti.net/downloads/cacti-latest.tar.gz
    
  2. Extract the downloaded file using the following command:

    tar -xzf cacti-latest.tar.gz
    
  3. Move the extracted folder to the /var/www/html directory:

    sudo mv cacti-* /var/www/html/cacti
    
  4. Create a MySQL database for Cacti and a separate user to access that database:

    sudo mysql -u root -p
    
    mysql> CREATE DATABASE cacti; 
    mysql> GRANT ALL PRIVILEGES ON cacti.* TO cacti@localhost IDENTIFIED BY '<your-password-here>';
    mysql> FLUSH PRIVILEGES;
    mysql> exit;
    

    Replace <your-password-here> with a secure password of your choice.

  5. Import the default Cacti database using the following command:

    sudo mysql cacti < /var/www/html/cacti/cacti.sql -u cacti -p
    

    You will be prompted to enter the password you set for the Cacti user in the previous step.

  6. Open the Apache config.php file with nano or your preferred text editor:

    sudo nano /var/www/html/cacti/include/config.php
    
  7. Update the following lines in the config.php file with your database details:

    $database_type = "mysql";
    $database_default = "cacti";
    $database_hostname = "localhost";
    $database_username = "cacti";
    $database_password = "<your-password-here>";
    
  8. Save and close the config.php file.

Configuring Cacti

Now that we have installed Cacti, we need to configure it to start monitoring our network.

  1. Open a web browser and go to http://localhost/cacti.

  2. You should see the Cacti installation page. Click the "Start" button to begin the installation process.

  3. On the next page, select the “New Install” option and click “Next”.

  4. On the next page, review the system checks to make sure everything is correct. Then click “Next”.

  5. On the following page, enter the MySQL database details you created earlier.

  6. On the next page, enter a name and password for the default Cacti user.

  7. Finally, click “Finish” to complete the installation.

Conclusion

Now that you have successfully installed Cacti on your Elementary OS system, you can start using it to monitor your network. Cacti provides a wide range of graphs for monitoring your network's performance, including bandwidth usage, CPU utilization, and memory usage. For further customization, refer to the Cacti documentation.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!