Skip to main content

Install Cacti on Proxmox Container Ubuntu 24.04

Here’s a clean step-by-step guide for Cacti installation on Ubuntu 24.04 inside your Proxmox CT

Update the System

sudo apt update && sudo apt upgrade -y

Install Required Packages, Cacti needs a web server, PHP, SNMP, RRDtool, and MySQL/MariaDB.

sudo apt install -y apache2 mariadb-server mariadb-client \
php php-mysql php-snmp php-xml php-ldap php-gd php-mbstring php-gmp \
rrdtool snmp snmpd librrds-perl unzip git

Enable required Apache modules:

sudo a2enmod php* rewrite
sudo systemctl restart apache2

Secure MariaDB:

sudo mysql_secure_installation
  • Set root password

  • Remove anonymous users

  • Disallow remote root login

  • Remove test DB

  • Reload privilege tables

Create Cacti database and user:

mysql -u root -p
CREATE DATABASE cacti CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'cactiuser'@'localhost' IDENTIFIED BY 'yourpassword';
GRANT ALL PRIVILEGES ON cacti.* TO 'cactiuser'@'localhost';
GRANT SELECT ON mysql.time_zone_name TO 'cactiuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Load time zone data:

mysql_tzinfo_to_sql /usr/share/zoneinfo | sudo mysql -u root -p mysql

Download Cacti official GitHub: https://github.com/Cacti/cacti

cd /var/www/html
sudo git clone -b master https://github.com/Cacti/cacti.git
sudo chown -R www-data:www-data cacti

Import Default Database

mysql -u cactiuser -p cacti < /var/www/html/cacti/cacti.sql

Configure Cacti Settings,Edit config file:

sudo nano /var/www/html/cacti/include/config.php

Set DB info:

$database_type     = "mysql";
$database_default  = "cacti";
$database_hostname = "localhost";
$database_username = "cactiuser";
$database_password = "yourpassword";
$database_port     = "3306";

Configure Apache, for cacti

sudo nano /etc/apache2/sites-available/cacti.conf

Paste

<VirtualHost *:80>
    DocumentRoot /var/www/html/cacti
    ServerName cacti.local

    <Directory /var/www/html/cacti>
        Options +FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/cacti_error.log
    CustomLog ${APACHE_LOG_DIR}/cacti_access.log combined
</VirtualHost>