How To Install Cacti on Debian 10

Cacti is a complete network graphing solution designed to harness the power of RRDTool‘s data storage and graphing functionality. Cacti provides a fast poller, advanced graph templating, multiple data acquisition methods, and user management features out of the box. All of this is wrapped in an intuitive, easy to use interface that makes sense for LAN-sized installations up to complex networks with thousands of devices.



Unlimited number of graph items can be defined for each graph optionally utilizing CDEFs or data sources from within cacti.

Automatic grouping of GPRINT graph items to AREA, STACK, and LINE[1-3] to allow for quick re-sequencing of graph items.

Auto-Padding support to make sure graph legend text lines up.

Graph data can be manipulated using the CDEF math functions built into RRDTool. These CDEF functions can be defined in cacti and can be used globally on each graph.

Support for all of RRDTool’s graph item types including AREA, STACK, LINE[1-3], GPRINT, COMMENT, VRULE, and HRULE.

Data Sources

Data sources can be created that utilize RRDTool’s “create” and “update” functions. Each data source can be used to gather local or remote data and placed on a graph.

Supports RRD files with more than one data source and can use an RRD file stored anywhere on the local file system.

Round robin archive (RRA) settings can be customized giving the user the ability to gather data on non-standard timespans while storing varying amounts of data.

I will try to install the latest Cacti version on my Debian 10 Server.

My hostname

The Installation requirements

RRDTool 1.0.49 or greater, 1.4+ recommended
MySQL 5.x or greater
PHP 5.1 or greater
Web Server that supports PHP e.g. Apache or IIS

Step 1

Upgrade all system packages

sudo apt update && sudo apt upgrade

Step 2

Install the webserver Apache on Debian

sudo apt install -y apache2 libapache2-mod-php

Enable and Start Apache

systemctl start apache2
systemctl enable apache2

Step 3

Install PHP packages needed for cacti installation.

apt install php php-common php-mysql php-snmp php-xml php-mbstring php-json php-gd php-gmp php-zip php-ldap php-pear php-php-gettext php-phpseclib php-twig

Uncomment the ‘date.timezone’ option and change the value with your timezone.

date.timezone = Europe/Amsterdam

Now uncomment the ‘cgi.fix_pathinfo’ option and change thge value to ‘0’.

cgi.fix_pathinfo = 0

Step 4

Install mariaDB database

sudo apt install -y mariadb-server mariadb-client

Enable and start mariadb

systemctl restart mariadb
systemctl status mariadb

Step 5

install SNMP and rrdtool

SNMP tools is used to retrieve data from connected devices and rrdtool is used to generate graphs.

sudo apt install -y snmp snmpd snmp-mibs-downloader rrdtool librrds-perl

if this command not working under Debian 10, please add this line below to source file /etc/apt/sources.list

deb buster main non-free

activate the changes

apt-get update & apt-get upgrade

Configure The Database,

Create Root Mysql password


Create cacti user abd cacti database

For the best performance of the database, you may add these settings

sudo vim /etc/mysql/mariadb.conf.d/50-server.cnf
Add the following under [mysqld]
collation-server = utf8mb4_unicode_ci
character-set-server = utf8mb4
max_heap_table_size = 128M
tmp_table_size = 64M
join_buffer_size = 64M
innodb_file_format = Barracuda
innodb_large_prefix = 1
innodb_buffer_pool_size = 1GB
innodb_buffer_pool_instances = 10
innodb_flush_log_at_timeout = 3
innodb_read_io_threads = 32
innodb_write_io_threads = 16
innodb_io_capacity = 5000
innodb_io_capacity_max = 10000

Restart the database to activate the new settings .

Step 6 : Install Cacti

Install with the command bellow.

sudo apt install cacti cacti-spine
you will be asked to select the webserver. please select Apache.
Select Yes for Configure database for cacti with dbconfig-common
create cacti user password

This password is the same as the admin user.

Now login to the cacti console



Please enter your comment!
Please enter your name here

Latest articles