How to Install Cacti SNMP Monitoring Tool on Debian 9

How to Install Cacti SNMP Monitoring Tool on Debian 9

Spread the love

In today’s tutorial, we will show you how to install and Cacti on a Debian 9 server. Cacti is an open-source, web-based network graphing solution written in PHP and build on top of the industry-standard data logging tool RRDtool. Cacti stores all of the necessary information in a MySQL database and allows a user to poll services at predetermined intervals and graph the resulting data using RRDtool. This guide should work on other Linux VPS systems as well, but was tested and written for a Debian 9 VPS.

1. Login to your VPS via SSH

ssh user@vps_IP

2. Update the system

sudo apt update && sudo apt -y upgrade

3. Install MariaDB Server

We will the install MariaDB 10.1 server from the official Debian repositories, you can skip this step if MariaDB/MySQL server is already installed on your machine.
To install the MariaDB server , run the following commands:

sudo apt install mariadb-server mariadb-client

4. Secure MariaDB Installation

Once the MariaDB installation is complete, run the following command to secure your installation:


5. Enable large Varchar Indexes

Edit your MariaDB/MySQL configuration and enable large varchar indexes:

sudo nano /etc/mysql/mariadb.conf.d/50-server.cnf
innodb_file_format = Barracuda
innodb_file_per_table = 1

character-set-server = utf8mb4
collation-server = utf8mb4_unicode_ci

6. Restart MariaDB

Restart the mariadb service for changes to take effect:

sudo systemctl restart mariadb

7. Install Apache2, PHP and required PHP modules

Chances are that you already have Apache and PHP installed on your machine, if not execute the following command:

sudo apt install apache2 php php-mysql php-snmp

8. Install Cacti

Once Apache, PHP, and MariaDB are installed, we can proceed with the Cacti installation. The easiest way to install Cacti on Debian 9 is to use the Cacti deb package from the Debian’s apt repository.

The following command will install Cacti and all the necessary requirements including the rrdtool tool:

sudo apt install cacti snmpd

The installation will now prompt you to answer a series of questions.

Configure database for cacti with dbconfig-common?

Select Yes and click [enter]

 Please provide a password for cacti to register with the database server. If left blank, a random password will be generated.
 MySQL application password for cacti:

Leave it empty and click [enter]

 Please select the web server for which Cacti should be automatically configured
Select "None" if you would like to configure the web server manually.

Select Apache2 and click [enter]

9. Set Admin Password

Once the installation is completed, set the admin password using the following command:

mysql -u root -p -D cacti -e "update user_auth set password=md5('your_new_admin_password') where username='admin';"

That’s it. You have successfully installed Cacti on your Debian 9 VPS.  Now you can login to the Cacti web interface at http://YOUR_IP/cacti using username admin and password your_new_admin_password.

For more information about how to configure and manage your Cacti installation, please refer to the official Cacti documentation.

Of course, you don’t have to install Cacti SNMP Monitoring Tool on Debian 9, if you use one of our outsourced server support services, in which case you can simply ask our expert Linux admins to install Cacti SNMP Monitoring Tool on Debian 9r. They are available 24×7 and will take care of your request immediately.

PS. If you liked this post on how to install Cacti SNMP Monitoring Tool on Debian 9,  please share it with your friends on the social networks using the buttons on the left or simply leave a reply below. Thanks.

2 thoughts on “How to Install Cacti SNMP Monitoring Tool on Debian 9

Leave a Reply

Your email address will not be published. Required fields are marked *