How To Install Cacti on CentOS 6


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. I will show you through the step by step installation Cacti on CentOS 6.

Step 1. First, you need to enable EPEL repository on your system.

Step 2. Install required packages.

Install apache:

Install MySQL server:

Intsall PHP modules:

Install PHP-SNMP:

Install NET-SNMP:

Install RRDTool:

Once installed all the above softwares, start them:

In order for these services to run at startup we need to enter the following commands:

Step 2. Install Cacti.

Step 3. Configuring MySQL.

By default, MySQL is not hardened. You can secure MySQL 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 MySQL.

Cacti requires a MySQL user and database, so create them by executing the following commands:

Step 4. Setup Cacti tables to MySQL.

Now import cacti database tables from the file cacti.sql . Issue the below command to find the location of cacti.sql file:

Now we need to install the tables into the cacti.sql file. Use the following command to do this and enter your database password when prompted:

Now we need to edit the database configuration file of cacti so that it uses the correct database name and username:

Configure MySQL settings for Cacti. Open /etc/cacti/db.php with your favourite editor and enter the values for your ‘cacti’ database:

Step 5. Configure the Apache Server.

We can change the Apache configuration to choose what IP addresses / subnets are allowed to connect. You can do this by editing the following file:

Restart Apache:

Step 6. Configure Cron for Cacti.

Open /etc/cron.d/cacti file:

Step 7. Configuring Iptables or firewall for Cacti.

Step 5. Accessing Cacti.

Cacti will be available on HTTP port 80 by default. Open your favorite browser and navigate to or http://server-ip/cacti. The default username and password for Cacti is admin / admin. Upon first login, you will be force to change the default password.

Congratulation’s! You have successfully installed Cacti. Thanks for using this tutorial for installing Cacti network monitoring tool on CentOS 6 system.

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!