How to Install Cacti on Linux Mint

Cacti is an open-source network monitoring tool that graphically displays real-time data using RRDtool. In this tutorial, we will guide you through the installation of Cacti on Linux Mint.

Prerequisites

Before we start, ensure that your Linux Mint system has the following prerequisites installed:

You can install these packages using the following command:

sudo apt-get update
sudo apt-get install apache2 mariadb-server php snmp php-mysql

Install Cacti

  1. Download the latest version of Cacti from the official website:

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

    tar -zxvf cacti-latest.tar.gz
    
  3. Move the extracted folder to the Apache root directory:

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

    mysql -u root -p
    
    MariaDB [(none)]>CREATE DATABASE cacti;
    
    MariaDB [(none)]>GRANT ALL PRIVILEGES ON cacti.* TO 'cactiuser'@'localhost' IDENTIFIED BY 'P@ssw0rd';
    
    MariaDB [(none)]>FLUSH PRIVILEGES;
    

    Replace 'P@ssw0rd' with a strong password of your choice.

  5. Import the Cacti database schema:

    mysql -u cactiuser -p cacti < /var/www/html/cacti/cacti.sql
    
  6. Edit Cacti configuration file:

    sudo nano /var/www/html/cacti/include/config.php
    

    Find and edit the following lines:

    $database_type = "mysql";
    $database_default = "cacti";
    $database_hostname = "localhost";
    $database_username = "cactiuser";
    $database_password = "P@ssw0rd";
    

    Replace 'P@ssw0rd' with the password you set in step 4.

  7. Add a new cron job for data polling:

    sudo nano /etc/cron.d/cacti
    

    Insert the following line:

    */5 * * * * cacti /usr/bin/php /var/www/html/cacti/poller.php > /dev/null 2>&1
    
  8. Set permission for RRD directory:

    sudo chown -R www-data:www-data /var/www/html/cacti/rra/
    sudo chown -R www-data:www-data /var/www/html/cacti/log/
    
  9. Restart Apache:

    sudo systemctl restart apache2
    

Configure Cacti

  1. Open your browser, and navigate to http://<your-server-IP>/cacti/. You should see the Cacti login page.

  2. Login with the default username "admin", and default password "admin".

  3. Change the default password.

  4. Follow the web installer to configure Cacti.

  5. Once installation is complete, you will be directed to the Cacti dashboard.

Conclusion

In this tutorial, we have shown you how to install and configure Cacti on Linux Mint. You can now use Cacti to monitor your network and generate graphical reports.

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!