How to Install Cacti on Cent OS

Hello all !!

Today we are going to see about how to install CACTI on cent OS. Cacti is open source monitoring tool for linux based systems. It provides graphical output about server’s resources like CPU, MEMORY, BANDWIDTH etc.

Requirements :

  1. Apache
  2. MySQL
  3. PHP
  6. RRDTool

Now lets see how to install requiring packages for Cacti.

Installing Apache :

A Web server to display network graphs created by PHP and RRDTool.

Once you installed apache, Need to start the service.


Installing MySQL :

A Database server to store cacti information. You can install it through the below command.


Installing PHP :

A script module to create graphs using RRDTool. Type the following command to install necessary php packages.

php-mysql, php-pear, php-common, php-gd, php-devel, php, php-mbstring, php-cli are essential for genraing graphical output through RRDTool.


Installing PHP-SNMP :

PHP extension for SNMP to access data. Use the below command to install SNMP extension.


Installing NET-SNMP :

A SNMP (Simple Network Management Protocol) is used to manage network. Type the below command to install it.


Installing RRDTool :

A database tool to manage and retrieve time series data like CPU loadNetwork Bandwidth etc. Execute the below command to install it.


Lets install Cacti :

Before we installing Cacti, We need enable EPEL repository.

What is EPEL :

EPEL (Extra Packages for Enterprise Linux) is open source and free community based repository project from Fedora team which provides 100% high quality add-on software packages for Linux distribution including RHEL, CentOS and for major Linux distributions. It  providing lots of open source packages like networking, sys admin, programming, monitoring and so on. Most of the epel packages are maintained by Fedora repo.

First we have to download and install the repository. You can download it using wget uttlity.

Once downloaded we can install it using RPM. Use the below command to install the epel repository.

Once you installed, you can verify it through

Once you enable EPEL repom, you can install cacti using below command


Configuring MySQL server for Cacti :

Now we have create a database and database user for cacti. Here I’m going to create both Db and user as cacti.

Login to your Mysql server as

Then you are asked for password for mysql root user. Once you entered the password you will get into MySQL prompt.

Then execute below queries to create Database.

Then we have to find out cacti database file using RPM

It’s output will be like in the below screen shot.

Then to install tabled into cacti database, Please execute the below command.

Then open the file /etc/cacti/db.php and make changes mentioned on below

$database_type = ‘mysql’;
$database_default = ‘cacti’;
$database_hostname = ‘localhost’;
$database_username = ‘cacti’;
$database_password = ‘Your passsword’;
$database_port = ‘3306’;
$database_ssl = false;

Configuring Firewall for Cacti :

Execute the below command.

[root@vps ~]# firewall-cmd –permanent –zone=public –add-service=http

[root@vps ~]# firewall-cmd –reload

Configuring Apache Server for Cacti Installation :

Open the file /etc/httpd/conf.d/cacti.conf and do the modification mentioned on below and save it.


Setting Cron for Cacti :

Open file /etc/cron.d/cacti.

Set the poller.php script runs every 5 mins.

Cacti Installer :

Now try to access the the URL http://YourIPaddress/cacti and you will installer page.

Check License Agreement and click Begin to start the installation. Next you will be shown of pre-installation checks page. Here If all the requirements matches with the installed version, then you can install it.

Congratulations, Now you have successfully installed Cacti monitoring tool in your server.



View all posts by

Leave a Reply

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