How to Install Cacti on Ubuntu 20.04


Easily deploy your favorite applications in seconds at an unbeatable price for your next projects.

Installing Cacti on Ubuntu 20.04

Cacti is an open-source network monitoring and graphing tool designed to provide a visually appealing dashboard for analyzing and managing network infrastructure. It uses the Simple Network Management Protocol (SNMP) to collect data from various devices and presents it in the form of comprehensive graphs and charts.

To install Cacti on Ubuntu 20.04, follow the steps below:

Step 1: Update System

Before installing any software, it is recommended to update the system packages to their latest versions. Open a terminal and run the following command:

sudo apt update
sudo apt upgrade

Step 2: Install LAMP Stack

Cacti requires a LAMP (Linux, Apache, MySQL, PHP) stack to run. Install the necessary packages using the following command:

sudo apt install apache2 mariadb-server php php-mysql libapache2-mod-php php-snmp php-xml php-imagick php-gd php-net-socket php-mbstring php-gettext php-ldap php-xmlrpc php-bcmath php-json mysql-client

Step 3: Configure MySQL

During the installation of the MariaDB package, you will be prompted to set a root password. After that, run the following command to secure the installation:

sudo mysql_secure_installation

Step 4: Create Cacti Database

Log in to the MySQL/MariaDB server using the root credentials:

sudo mysql -u root -p

Once logged in, create a new database for Cacti:

GRANT ALL PRIVILEGES ON cacti.* TO 'cactiuser'@'localhost' IDENTIFIED BY 'password';

Step 5: Install Cacti

Install the Cacti package using the following command:

sudo apt install cacti

During the installation, you will be prompted to choose the web server you are using. Select "Apache2" and press ENTER.

After the installation completes, import the default Cacti database:

sudo mysql -u cactiuser -p cacti < /usr/share/doc/cacti/cacti.sql

Step 6: Configure Cacti

Edit the Cacti configuration file using a text editor such as nano or vim:

sudo nano /etc/cacti/db.php

Find the following lines:

$database_username = 'cactiuser';
$database_password = 'password';

Replace 'password' with the password you set for the cactiuser in Step 4. Save the file and exit the editor.

Step 7: Configure Apache

Enable the necessary Apache modules by running the following command:

sudo a2enmod rewrite

Then, open the Cacti configuration file in a text editor:

sudo nano /etc/apache2/sites-available/cacti.conf

Find the following line:

Require host localhost

Add a new line below it:

Allow from all

Save the file and exit the editor.

Disable the default Apache virtual host and enable the Cacti virtual host:

sudo a2dissite 000-default
sudo a2ensite cacti

Restart Apache to apply the changes:

sudo systemctl restart apache2

Step 8: Setup Cron Job

Configure a cron job to automatically poll data for Cacti. Open the crontab file using the following command:

sudo crontab -e

Add a new line at the end of the file:

* * * * * www-data php /usr/share/cacti/site/poller.php > /dev/null 2>&1

Save the file and exit the editor.

Step 9: Access Cacti Web Interface

Open a web browser and visit your server's IP address or domain name followed by "/cacti" (e.g., http://your_server_ip/cacti). You should see the Cacti login page.

Log in with the following default credentials:

Username: admin

Password: admin

After logging in, you will be prompted to change the admin password. Follow the on-screen instructions to complete the setup.

You have successfully installed Cacti on Ubuntu 20.04. Enjoy monitoring and graphing your network infrastructure!

Refer A Friend
Get $25

Installing Cacti
Cacti installation
Install Cacti
Cacti Ubuntu 20.04
Cacti Ubuntu installation
Cacti setup
Set up Cacti
Ubuntu 20.04 Cacti installation
How to install Cacti on Ubuntu 20.04
Step-by-step Cacti installation on Ubuntu 20.04.

Why Customers Love Us

What our customers say about us

Ready To Get Started For Free?

Create your free account today.