How To Install Cacti Monitoring on CentOS 7

Install Cacti Monitoring on CentOS 7

In this tutorial we will show you how to install and configuration Cacti Monitoring on CentOS 7 server. For those of you who didn’t know, Cacti is an open-source, web-based network monitoring and graphing tool designed as a front-end application for the open-source, industry-standard data logging tool RRDtool. It is used by IT businesses and stores all of the necessary information about bandwidth, hard disk usage, CPU usage, load average, RAM statistics etc in a MySQL database. Cacti creates graphs and populates them with data. It offers SNMP support, 3rd party templates and plugins and has built in user authentications and user permission features.

This article assumes you have at least basic knowledge of linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo’ to the commands to get root privileges. I will show you through the step by step installation Cacti on a CentOS 7 server.

Install Cacti Monitoring on CentOS 7

Step 1. First let’s start by ensuring your system is up-to-date.

Step 2. Install LAMP server.

A CentOS 7 LAMP server is required. If you do not have LAMP installed, you can follow our guide here. Also install rwuired PHP modules:

Step 3. Installing the Cacti packages.

Now, we’ll gonna install snmp and cacti in our linux machine:

Before we start the web configuration part, we need to start the snmpd service:

You need to install and enable EPEL Repository. Once you’ve enabled repository, type the following command to install Cacti application:

Step 4. Configuring MariaDB for Cacti application.

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script. you should read and below each steps carefully which will set root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MariaDB:

Configure it like this:

Next we will need to log in to the MariaDB console and create a database for the Cacti. Run the following command:

This will prompt you for a password, so enter your MariaDB root password and hit Enter. Once you are logged in to your database server you need to create a database for Cacti installation:

Now, import cacti database tables from the cacti.sql file. First locate cacti.sql file:

After we have successfully imported the database table to our mariadb database cacti, we’ll now configure our cacti configuration file. Open /etc/cacti/db.php file using nano editor and edit the below lines:

Step 5. Configuring Apache web server for Cacti.

We’ll now need to allow access to Cacti from over the internet. To do so, we’ll need to edit /etc/httpd/conf.d/cacti.conf using a text editor:

Add the following lines:

Save and close the file. Restart the apache service for the changes to take effects:

Set cron for cacti:

Step 6. Configuring firewall rules for Cacti.

Step 7. Accessing cacti.

Cacti will be available on HTTP port 80 by default. Open your favorite browser and navigate to or http://server-ip/cacti and complete the required the steps to finish the installation. You will get the “Cacti Installation Guide” on screen. Click on ‘Next’ button.


In next screen, you will get drop down button. Because this fresh installation select ‘New Install’ and click ‘Next’ button.


Cacti will now check for the packages it needs to run properly. Make sure all the checks appear with an “OK” status, and then click Finish.


The next page is the login page. The first time you log into Cacti, use admin as username and password.


Congratulation’s! You have successfully installed Cacti. Thanks for using this tutorial for installing Cacti Monitoring on your CentOS 7 system. For additional help or useful information, we recommend you to check the official Cactiweb site.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get a best deal!