How to Install Cacti on Ubuntu 16

Try it in our public cloud & Get $5 Credit

How to Install Cacti on Ubuntu 16

Cacti is a network monitoring tool that uses RRDTool on the backend to store network data in a circular buffer database that constantly rotates out the oldest data so that the database remains the same constant size. Cacti is notable for providing robust graphing tools so that you can visually see all statistics pertaining to your server.

You also have the option of creating users that each have their own collections of data; thus, Cacti is perfect for shared hosting situations where users need access only to their own data.

Cacti is free and open source, being licensed under the GNU General Public License.

Getting started

To complete this guide, you will need the following:
• 1 Remote server (Cloud Server or Dedicated Server) running Ubuntu 16.
• All commands should be run as the root user


Cacti only supports MySQL 5.6, whereas the current version in the Ubuntu default repository is MySQL 5.7. In order to install this older version of MYSQL, you will need to add this repository and grab it from there.

nano /etc/apt/sources.list
deb http://archive.ubuntu.com/ubuntu trusty universe
apt-get update

Now you can install the LAMP stack necessary to run Cacti using MySQL 5.6. You will need this in order to access the data that Cacti provides.

apt-get install apache2 mysql-server-5.6 php libapache2-mod-php -y

Start the web server and MySQL server. Set them to automatically start up on server boot.

systemctl start apache2.service
systemctl enable apache2.service
systemctl start mysql.service
systemctl enable mysql.service

Now that the LAMP stack is settled, you can install the rrdtool and snmp packages. rrdtool stands for Round-Robin Database tool. This is the backend that stores data about your system on a rotating basis. snmp is the Simple Network Management Protocol, used to relay information about your system to suitable applications for network monitoring purposes.

apt-get install snmp snmpd rrdtool -y

Just as with the two servers above, start and then enable the snmpd service to start automatically on boot.

systemctl start snmpd.service
systemctl enable snmpd.service

Once that’s done, you can proceed with the installation of Cacti itself.

apt-get install cacti cacti-spine -y

You will be prompted for some information during the installation — what kind of web server you’re using, and what you’d like the username and password for the Cacti database to be.
In this case, you will choose apache2 as the web server. Pick whichever username and password you’d like for the Cacti database, but be sure to save it somewhere safe for later reference.

Once the installation process is complete, you will have to restart all services to reflect the changes made.

systemctl restart apache2.service
systemctl restart mysql.service
systemctl restart snmpd.service

All that remains is to complete the installation online by going to this URL:
Login : admin
Password : admin


With Cacti installation complete, you have access to a robust data analysis and management solution that you can use for a variety of applications. Experiment to see how Cacti can aid your monitoring workflow. If you found this article helpful, feel free to share it with your friends and let us know in the comments below!