Note: As of Cacti 1.2.31, PHP 8.1 is required and PHP Composer is required. Composer will be used to ensure all libraries are installed and up to date.
BSOD2600, one of the long-term users of Cacti, provides an installer for Windows. We recommend using that installer. You can obtain it under the Windows section of the Cacti forums. If you prefer to install Cacti manually, follow the instructions below.
-
(Optional) Apache - This software is optional if running Windows Internet Information Server.
-
Cacti - Install from the zip distribution into the web root of your choice. Many choose to install into a
Cactisubfolder. -
Spine - Install from the zip distribution into the
c:\cactidirectory. Ensurespine.conf.distis located in that directory as well. -
RRDtool - Install from the Cacti website into the
c:\cactidirectory. -
PHP 8.x - Install into the
c:\phpfolder. If you choose to install intoc:\Program Files\php, you will have to use 8.3 filenames to reference its binaries in Cacti. -
MySQL 8.x or MariaDB 10.5+ - Install into the default locations. For MySQL this is typically:
c:\Program Files\MySQL\MySQL Server X.XXFor MariaDB it is typically:
c:\Program Files\MariaDBAfter the database is confirmed running, apply the following settings to the
my.inifile:[mysqld] character-set-server = utf8mb4 collation-server = utf8mb4_unicode_ci max_heap_table_size = 770M # Adjust for your OS memory size max_allowed_packet = 500M # Adjust for your OS memory size tmp_table_size = 512M # Adjust for your OS memory size join_buffer_size = 256M # Adjust for your OS memory size sort_buffer_size = 32M # Per-session buffer; keep small to avoid OOM under load # sql_mode: NO_AUTO_CREATE_USER was removed in MySQL 8.0; omit it on MySQL 8+ sql_mode = NO_ENGINE_SUBSTITUTION innodb_flush_log_at_trx_commit = 2 innodb_flush_log_at_timeout = 3 innodb_file_per_table = ON innodb_buffer_pool_size = 4500M # Adjust for your OS memory size # innodb_file_format and innodb_large_prefix removed in MySQL 8.0 / # MariaDB 10.3+; omit those settings on newer releases. # for SSDs on a multi-core server innodb_doublewrite = OFF innodb_read_io_threads = 32 innodb_write_io_threads = 16 innodb_io_capacity = 10000 innodb_io_capacity_max = 20000 innodb_flush_method = O_DIRECT
Restart MariaDB/MySQL after applying these settings. Once you start the installer, Cacti will recommend better values for your hardware.
Write down your MariaDB/MySQL root password and keep a backup copy in a safe place.
-
(Optional) Cygwin - Download and execute
setup-x86_64.exefrom the Cygwin website. Keep thesetup-x86_64.exefile for later use. You will need Cygwin and its development packages for building RRDtool and Spine. -
(Optional) Net-SNMP - Install to the
c:\usrdirectory. If you choose to usec:\Program Files\net-snmp, you will have to use 8.3 filenames to reference its binaries in Cacti. The default installation location for Net-SNMP on Windows isc:\usr, which closely aligns with Linux and Unix install paths.
The following changes are required regardless of your selected web server.
-
Add the following directory to the existing Windows System
PATHenvironment variable:c:\php. The Windows PATH can be accessed via: Control Panel → System → Advanced → Environment Variables → System Variables. -
Add a new Windows System environment variable
PHPRCset toc:\php. -
Add a new Windows System environment variable
MIBDIRSset toc:\php\extrasmibs. -
Rename
c:\php\php.ini.disttophp.ini, and make the following changes. The Cacti installer will guide you through enabling additional modules.extension_dir = c:\php\ext extension=php_pdo_mysql.dll extension=php_snmp.dll extension=php_sockets.dll cgi.force_redirect = 0 date.timezone = America/Detroit memory_limit = 800M max_execution_time = 300
Note:
php_mysql.dll(the oldmysql_*extension) was removed in PHP 7.0. Usephp_pdo_mysql.dllinstead. -
In earlier PHP installation guides, moving certain DLLs to
c:\winnt\system32was recommended. If you followed those guides, remove those files. Review the PHP installation documentation for instructions. -
To allow template importing, uncomment the following line:
file_uploads = On -
Give the user running the scheduled task modify rights to the
.indexfile in the location pointed to by theMIBDIRSenvironment variable.
-
Ensure you have stopped any IIS web servers before proceeding with Apache installation, or configure Apache on an alternate port.
-
If using Apache 2.x with PHP 8, add the following lines. Adjust values for your version of PHP and Apache.
LoadModule php_module "C:\php\php8apache2_4.dll" AddHandler application/x-httpd-php .php AddType application/x-httpd-php .php DirectoryIndex index.html index.htm index.php PHPIniDir "C:\php"
PHP 8.0 removed ISAPI support. For IIS with PHP 8, use the FastCGI handler instead of ISAPI.
-
Install the IIS FastCGI module if it is not already present (available via Windows Server roles or Web Platform Installer).
-
Open IIS Manager. At the server level, open FastCGI Settings and add a new application:
- Full Path:
C:\php\php-cgi.exe - Set InstanceMaxRequests to
10000
- Full Path:
-
In the site or server Handler Mappings, add a new module mapping:
- Request path:
*.php - Module:
FastCgiModule - Executable:
C:\php\php-cgi.exe
- Request path:
-
Under the Default Document feature, add
index.phpto the list. -
Give the IIS application pool identity (or
IUSR) read and execute permissions on%windir%\system32\cmd.exe, and read/write/execute on the Cacti directories:icacls "C:\windows\system32\cmd.exe" /grant "IUSR:(OI)(CI)(RX,W)" icacls "C:\inetpub\wwwroot\cacti\resource\snmp_queries" /grant "IUSR:(OI)(CI)(RX,W)" icacls "C:\inetpub\wwwroot\cacti\resource\script_server" /grant "IUSR:(OI)(CI)(RX,W)" icacls "C:\inetpub\wwwroot\cacti\scripts" /grant "IUSR:(OI)(CI)(RX,W)" icacls "C:\inetpub\wwwroot\cacti\rra" /grant "IUSR:(OI)(CI)(RX,W)" icacls "C:\inetpub\wwwroot\cacti\log" /grant "IUSR:(OI)(CI)(RX,W)" icacls "C:\inetpub\wwwroot\cacti\cache" /grant "IUSR:(OI)(CI)(RX,W)" icacls "C:\inetpub\wwwroot\cacti\include\config.php" /grant "IUSR:(RX,W)" copy /b NUL "C:\inetpub\wwwroot\cacti\include\vendor\csrf\csrf-secret.php" icacls "C:\inetpub\wwwroot\cacti\include\vendor\csrf\csrf-secret.php" /grant "IUSR:(RX,W)"
-
Completely stop and start the IIS service:
net stop iisadmin net start w3svc
-
Installing a single instance of Cygwin and using it for all applications is recommended. Multiple Cygwin installations can have conflicting DLL versions.
-
Run the
setup-x86_64.exeyou downloaded previously. -
At the Select Packages step, install the following packages (version numbers may have changed):
- Base (include all items)
- Libs
- libcairo2
- libcrypt0
- libfontconfig-common
- libfontconfig1
- libfreetype6
- libgcrypt20
- libgd3
- libglib2.0_0
- libmariadb3
- libssl1.0
- libpango1.0_0
- libpng16
- libreadline7
- zlib-devel
- zlib0
- Devel
- autoconf
- automake
- binutils
- clang
- cygwin-devel
- gcc-core
- gcc-g++
- libmariadb-devel
- help2man
- libargp
- libltdl7
- libtool
- net-snmp-devel
- patch
- texinfo
- w32api-headers
- w32api-runtime
- windows-default-manifest
- Web
- wget
- Libs
- Base (include all items)
-
Add
c:\cygwin\binto your Windows System PATH environment variable. -
Move
setup-x86_64.exetoc:\cygwinfor future use. Update this binary periodically, as it is updated from time to time.
-
Obtain Windows-compatible builds of RRDtool from https://rrdtool.org and install to
C:\rrdtool. -
Create the MariaDB/MySQL database:
shell> mysqladmin --user=root --password create cacti -
Import the default Cacti database:
shell> mysql --user=root --password cacti < c:\apache2\htdocs\cacti\cacti.sql
-
Create a MySQL username and password for Cacti:
shell> mysql --user=root --password mysqlMySQL> CREATE USER 'cactiuser'@'localhost' IDENTIFIED BY 'cactiuser'; MySQL> GRANT ALL ON cacti.* TO 'cactiuser'@'localhost'; MySQL> GRANT SELECT ON mysql.time_zone_name TO 'cactiuser'@'localhost'; MySQL> ALTER DATABASE cacti CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; MySQL> FLUSH PRIVILEGES;
-
If you plan to use SNMP v2c and are using early versions of PHP, download and install the Net-SNMP libraries. Net-SNMP provides an installer.
If you use long directory names, note that Cacti requires 8.3 notation:
Format Path Original c:\Program Files\Net-SNMP\bin8.3 notation c:\progra~1\net-snmp\bin
-
Extract the Spine zip file to
c:\spineand editspine.conf.distwith your database details:DB_Host 127.0.0.1 DB_Database cacti DB_User cactiuser DB_Password cactiuser DB_Port 3306
Note: Use
127.0.0.1rather thanlocalhostfor the DB host on Windows. -
Spine is distributed as a binary. We strongly recommend installing Cygwin and removing all DLL files and
sh.exefromc:\spine, keeping onlyspine.exeandspine.conf.
-
Edit
cacti_web_root/cacti/include/config.phpand specify the database connection details:$database_default = "cacti"; $database_hostname = "localhost"; $database_username = "cactiuser"; $database_password = "cactiuser"; $database_port = "3306";
-
Browse to
http://your-server/cacti/and log in withadmin/admin. You will be prompted to change the password immediately. -
Go to Settings → Paths and verify/update all paths to point to the correct locations. If using Spine, all paths must use forward slashes.
- PHP Binary Path:
c:/php/php.exe - RRDtool Binary Path:
c:/rrdtool/rrdtool.exe - SNMP Binary Paths:
c:/usr/bin/snmpget.exe,c:/usr/bin/snmpwalk.exe, etc. - Cacti Logfile Path:
c:/mycacti/website/cacti/log/cacti.log - Spine Path:
c:/spine/spine.exe
- PHP Binary Path:
-
If you enabled automation, once the Cacti poller starts it will discover compatible devices using your SNMP settings and default automation rules. A Localhost device is created automatically at install time.
-
Log into the account you will use for the scheduled task and verify a polling cycle works:
php c:/cacti_web_root/cacti/poller.php
Expected output includes lines like:
OK u:0.00 s:0.06 r:1.32 10/28/2005 04:57:12 PM - SYSTEM STATS: Time:4.7272 Method:cmd.php ...After the first run,
cacti.logwill appear in/cacti/log/and RRD files in/cacti/rra/. -
Schedule a recurring task to run
poller.phpevery 5 minutes:Note: The following instructions apply to most Windows versions.
-
Open Task Scheduler (Control Panel → Scheduled Tasks).
-
Click Add Scheduled Task and then Next.
-
Browse to
c:\phpand selectphp.exe. Choose Daily and click Next. -
Click Next without changing the time or date settings.
-
Ensure the task account has the correct permissions on:
cacti_web_root/cacti/rracacti_web_root/logc:\phpc:\phpsapi
-
Click Next and Finish to close the wizard.
-
Right-click the task and select Properties.
-
On the Schedule tab, confirm Daily is selected and click Advanced.
-
Check Repeat, set to 5 minutes, and set duration to 24 hours.
-
Click OK.
-
In the Run field, enter:
c:\php\php.exe c:\mycacti\website\cacti\poller.phpSet Start in to
c:\mycacti\website\cacti.
-
Copyright (c) 2004-2026 The Cacti Group