Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversHalloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan Now×
FREEDOM251

Freedom251 › Blog › Cacti

How to Install Cacti Server Monitoring on Ubuntu

By Freedom251 Team · · 11 min read

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use the source installation when you need control over the Cacti branch; use Ubuntu’s package when distribution integration matters more than version freshness. A working Cacti server needs a web server, PHP and Composer, MariaDB or MySQL, RRDtool, and Net-SNMP. The complete setup is: install those dependencies, create the Cacti database and time-zone grant, deploy the application, configure include/config.php, schedule a poller, assign write permissions to Cacti’s runtime directories, and finish the browser wizard at /cacti.

This guide targets Ubuntu with Apache, MariaDB, PHP-FPM and the Cacti 1.2.x source branch. Check the exact Cacti release and Ubuntu repositories first: dependency floors differ between the stable 1.2.x and develop 1.3.x branches, and the guide for Cacti 1.2.31 mentions PHP 8.1 even though PHP 8.1 reached end of life on 31 December 2025.

As an Amazon Associate I earn from qualifying purchases.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

What Cacti does and what the server must provide

Cacti is an open-source network-monitoring and graphing platform built on RRDtool. It polls devices, servers and applications, stores time-series data in RRD files, and turns that data into graphs and dashboards. The project supports automated discovery, SNMP versions 1, 2 and 3, IPv6, role-based access control and plugins.

The installation is a stack rather than a single package:

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones | IPX5 Waterproof,2 Mics for AI Calls,Immersive Premium Sound Bass Headset with Charging Case,32 EQ via App Black
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.
  • Web server: Apache is used in the commands below; another supported web server can serve the same application.
  • PHP: Cacti’s web interface, poller and Composer dependencies require a compatible PHP runtime and extensions.
  • Database: MariaDB or MySQL stores Cacti’s configuration, devices and poller metadata.
  • RRDtool: Creates and updates the round-robin data files used for graphing.
  • Net-SNMP: Provides SNMP utilities and the daemon package used when the Ubuntu host itself needs to answer SNMP requests.
  • Composer: Required by the current source-install workflow to install PHP libraries.

Check the Cacti and Ubuntu versions before installing

Do not assume that every Cacti release accepts the same package set. The project repository lists these minimums:

Branch MariaDB MySQL PHP RRDtool Net-SNMP
Stable 1.2.x 10.5 or newer 8.0 or newer 8.2 or newer 1.7 or newer 5.9 or newer
Develop 1.3.x 10.11 or newer 8.4 or newer 8.3 or newer 1.8 or newer 5.9 or newer

The Ubuntu/Debian installation guide states that Cacti 1.2.31 requires PHP 8.1 and Composer, but PHP 8.1 is no longer supported as of 31 December 2025. The repository’s stable-branch floor is PHP 8.2 or newer. On a 2026 deployment, install a currently supported PHP package offered for your Ubuntu release and confirm it is accepted by the exact Cacti version you are deploying. Do not force an obsolete PHP package simply to match an old example.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Cacti 1.2.30 was released on 23 March 2025. Ubuntu Jammy’s package page identifies version 1.2.19+ds1-2ubuntu1.1, so the distribution package and the current source branch can differ substantially.

Choose source installation or Ubuntu’s package

Option Best when Advantages Trade-offs
Ubuntu package You prioritize Debian/Ubuntu dependency integration and conventional package upgrades. Dependencies are resolved by APT, files follow distribution conventions, and maintenance fits normal Ubuntu administration. The available version follows the Ubuntu release; Jammy lists Cacti 1.2.19+ds1-2ubuntu1.1, not necessarily the newest 1.2.x release.
Source tree You need a chosen Cacti branch or a newer release than your Ubuntu repository provides. You control the branch, can use the documented 1.2.x tree, and can install Composer dependencies with the project’s layout. You must manage the source directory, Composer libraries, database schema updates and permissions yourself.

The steps that follow use the source tree. If you choose the Ubuntu package, keep the same database, polling, ownership and browser-wizard requirements, but use the package’s documented paths and service names instead of assuming /var/www/html/cacti.

1. Prepare Ubuntu and install prerequisites

Update APT and install the stack

Run these commands as a sudo-capable administrator. The example uses PHP 8.3 package names because they are suitable for releases that provide them; substitute the currently supported PHP package series in your Ubuntu repository when the names differ.

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.
sudo apt update
sudo apt install apache2 rrdtool mariadb-server snmp snmpd 
  php8.3-cli php8.3-mysql php8.3-snmp php8.3-xml php8.3-mbstring 
  php8.3-gd php8.3-gmp php8.3-zip php8.3-ldap php8.3-intl 
  php8.3-curl php8.3-fpm composer git

The required PHP extensions cover MySQL access, SNMP, XML, multibyte strings, GD graph support, GMP, ZIP, LDAP, internationalization and cURL. Ubuntu’s Cacti metadata separately identifies PHP CLI/modules, php-snmp, RRDtool, SNMP and Apache (or another web server) as dependencies or recommendations.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Confirm the binaries and versions

Before deploying Cacti, verify that the commands resolve and that their versions meet your selected release’s floors.

php -v
composer --version
rrdtool --version
snmpget --version
mariadb --version

If APT cannot find a PHP package, do not mix extensions from different PHP series. Select the supported series supplied by your Ubuntu release, install every required extension for that series, and re-check the Cacti release requirements.

2. Download Cacti and install Composer dependencies

Clone the stable branch, place it under Apache’s document root, and install production dependencies without development packages. The project’s source repository is https://github.com/Cacti/cacti.git.

cd /tmp
git clone -b 1.2.x https://github.com/Cacti/cacti.git
sudo mv cacti /var/www/html/cacti
cd /var/www/html/cacti
sudo composer install --no-dev

Run Composer from the application directory. If you run it as a non-root user, ensure that the resulting files remain readable by Apache and that the runtime directories are writable by the poller user in the permission step below. Keep the Git branch and the Composer lock data together when you later perform upgrades; changing only one of them can leave an inconsistent application.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord | 6.35mm Jack, Durable Design, Stage and Home Studio Use, Low Noise Shielded Electric Cord for Bass, Keyboard, Amp, Mixer
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by

3. Create the MariaDB database and account

Open the database console

sudo mariadb

Create a dedicated database and user

Use a unique, long password rather than the illustrative value shown here, and store it in your password manager. The account needs full privileges on the Cacti database and read access to MySQL’s time-zone names.

CREATE DATABASE cacti CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'cactiuser'@'localhost' IDENTIFIED BY 'S3cure-Cacti-Db-2026!';
GRANT ALL PRIVILEGES ON cacti.* TO 'cactiuser'@'localhost';
GRANT SELECT ON mysql.time_zone_name TO 'cactiuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;

The time-zone grant is easy to miss. Without it, the web installer or later date/time operations can fail even though the main database login works. Replace the example password before production use, and use the same final value in include/config.php.

4. Load the Cacti schema

Import the schema shipped in the source tree after creating the empty database:

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

Enter the database password when prompted. If the import reports an authentication error, test the account directly with mysql -u cactiuser -p -e 'SELECT 1' cacti; if it reports missing tables, confirm that the input path points to the schema belonging to the same Cacti tree you cloned.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

5. Configure include/config.php

Copy the distribution configuration

cd /var/www/html/cacti
sudo cp include/config.php.dist include/config.php
sudo nano include/config.php

Set the database connection values

Make the values match the account and server you created. This example uses a local MariaDB listener and the standard MySQL port:

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.
$database_type     = 'mysql';
$database_default  = 'cacti';
$database_hostname = 'localhost';
$database_username = 'cactiuser';
$database_password = 'S3cure-Cacti-Db-2026!';
$database_port     = '3306';
$database_retries  = 5;
$database_ssl      = false;

Use the actual production password, not the example value. If the database is remote, set the hostname, port, SSL option and database account restrictions to match that design. Keep the file readable by the web process but protected from unrelated users because it contains credentials.

6. Schedule Cacti polling

Cacti cannot graph current values until a poller runs repeatedly. Cacti 1.2.16 and later document two supported approaches: the PHP poller through cron, or the optional cactid systemd service. The project identifies the built-in PHP poller and Spine as its two polling engines.

Option A: PHP poller with cron

The documented five-minute cron entry runs the poller as www-data:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo crontab -u www-data -e

Add this single line:

*/5 * * * * www-data php /var/www/html/cacti/poller.php >/dev/null 2>&1

Depending on the cron file you use, the username field may or may not be required. The line above is the documented system-wide form; when editing the per-user crontab with crontab -u www-data -e, omit the extra www-data field if your cron implementation expects only five time fields followed by the command. Verify the resulting entry with sudo crontab -u www-data -l.

Option B: the optional cactid systemd service

Choose the service-based poller when you want systemd to supervise a long-running process, provide lifecycle controls and make service status visible through normal system administration. Choose cron when a simple scheduled PHP invocation is easier to operate. The higher-performance Spine engine is a separate choice described by the project; do not assume that installing the PHP poller automatically installs or selects Spine.

Use the service unit and executable supplied by the exact Cacti package or source release you installed. Confirm its configured user, application path and database settings before enabling it, and do not run both pollers against the same installation unless the Cacti documentation for your release explicitly calls for that arrangement.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

7. Assign runtime-directory ownership

The web and polling processes must be able to write RRD data, logs, cache files and resources. Make Apache’s Ubuntu account the owner of those directories:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
sudo chown -R www-data:www-data 
  /var/www/html/cacti/rra 
  /var/www/html/cacti/log 
  /var/www/html/cacti/cache 
  /var/www/html/cacti/resource

Do not make the entire application tree world-writable. Keep source and configuration files protected, granting write access only to the runtime directories that Cacti documents.

8. Restart PHP-FPM and open the initialization wizard

Restart the PHP-FPM daemon

Restart PHP-FPM before opening the installer so its cache is rebuilt. Use the service name matching the PHP series installed on your host:

sudo systemctl restart php8.3-fpm

If your Ubuntu release provides another supported PHP series, substitute that daemon name. A stale or mismatched PHP-FPM process can present as an HTTP 500 during setup.

Open Cacti in a browser

Browse to:

http://serverip/cacti

The Cacti guide describes this as the point where the initialization wizard starts. Replace serverip with the server’s address or DNS name. The wizard checks PHP modules, database connectivity, writable directories and other prerequisites; correct every reported failure before continuing.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

9. Complete the browser wizard safely

  1. Confirm that the detected Cacti version matches the source tree you intended to deploy.
  2. Review the prerequisite checklist. A missing PHP extension, RRDtool binary or writable runtime directory must be fixed on Ubuntu before proceeding.
  3. Enter the database host, name, user, password and port from include/config.php. Keep the database type consistent with the installed driver.
  4. Accept the selected paths only when they point to the actual application, RRD, log, cache and resource directories.
  5. Complete the administrator account setup with a unique password and record the credentials securely.
  6. After login, verify that the poller is scheduled and that a test device can be queried before building dashboards.

Source versus package: operational decisions after installation

When the Ubuntu package is the better fit

  • Several administrators maintain the host using APT and want Cacti upgrades to follow Ubuntu’s normal dependency and security workflow.
  • The repository version is adequate for the features and fixes you require.
  • You prefer distribution-managed paths and do not want to maintain a Git checkout and Composer tree.

When the source tree is the better fit

  • You need the stable 1.2.x branch while your Ubuntu release offers an older package.
  • You need to control exactly which Cacti release is deployed and when it is upgraded.
  • Your operations process already handles Git checkouts, Composer dependencies, schema migrations and rollback copies.

Troubleshoot the problems that stop polling

Symptom Likely cause Checks and corrective action
The browser returns HTTP 500 during setup. PHP-FPM has stale configuration or a missing extension. Restart the installed PHP-FPM daemon, confirm the PHP version and required modules, and inspect the web-server and PHP-FPM error logs for the specific missing component.
The wizard cannot connect to MariaDB. Wrong host, port, username, password or database type. Test the same credentials with the MySQL client, compare every value with include/config.php, and verify that the account is allowed from the configured host.
Database setup succeeds but time-related checks fail. The Cacti account lacks its MySQL time-zone read grant. Re-enter the GRANT SELECT ON mysql.time_zone_name statement, run FLUSH PRIVILEGES, and repeat the check.
Graphs remain empty and no new RRD data appears. The poller is not scheduled, is running as the wrong user, or cannot write to runtime directories. List the www-data cron entry, run the poller command manually as the intended user, inspect Cacti’s log directory, and verify ownership of rra, log, cache and resource.
The poller runs but devices show no SNMP data. SNMP credentials, protocol version, address or network reachability are wrong. Test the target with the matching SNMP version and credentials using an SNMP utility, then correct the device definition in Cacti. Cacti supports SNMP v1, v2 and v3; select the version configured on the device.
Composer-installed classes are missing. Composer was skipped, run in the wrong directory or run against a different source tree. Change to /var/www/html/cacti and run composer install --no-dev for that exact checkout, then repeat the wizard’s prerequisite check.
Apache reports permission errors while serving Cacti. Files are owned by an account Apache cannot read, or runtime directories are not writable. Keep the application readable by Apache, assign www-data ownership to the four documented runtime directories, and avoid broad world-write permissions.

AppArmor: change nothing on a stock Ubuntu Apache host

Ubuntu and Debian enable AppArmor by default, but they do not ship an Apache confinement profile on a stock installation. Therefore, no Apache AppArmor change is needed for Cacti when no Apache profile is installed. Create a local profile override only if your system has an Apache profile and its audit logs show denials affecting Cacti; otherwise, adding an override creates unnecessary maintenance.

Production checks before adding devices

  • Use HTTPS for the Cacti interface and restrict administrative access to trusted networks.
  • Replace every example database credential and use a dedicated database account rather than a global administrator.
  • Prefer SNMPv3 where your monitored devices support it, and protect SNMP credentials in Cacti’s access controls.
  • Confirm that the poller runs exactly once at the intended interval; duplicate pollers can produce conflicting updates.
  • Back up the Cacti database, configuration and RRD directory before upgrades.
  • Record the Cacti branch, PHP series, database version and Composer state so a future schema or dependency upgrade is reproducible.
  • Watch disk usage in the RRD and log directories and rotate logs according to your Ubuntu operations policy.

Installation checklist

  1. Verify the Cacti branch’s MariaDB/MySQL, PHP, RRDtool and Net-SNMP minimums.
  2. Install Apache, the database server, RRDtool, SNMP packages, the supported PHP extensions, PHP-FPM, Composer and Git.
  3. Clone the selected Cacti branch and run composer install --no-dev.
  4. Create the cacti database with utf8mb4, create a dedicated user, grant database privileges and grant SELECT on mysql.time_zone_name.
  5. Import cacti.sql and configure include/config.php.
  6. Schedule either the documented PHP cron poller or the optional service-based poller, not an accidental duplicate.
  7. Assign www-data ownership to rra, log, cache and resource.
  8. Restart the matching PHP-FPM service.
  9. Open http://serverip/cacti, complete the wizard, and verify a real poll before importing templates or creating dashboards.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

CactiLinux serverMariaDBNetwork MonitoringRRDtoolSNMPUbuntu

Leave a Reply

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

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.