Updated: 12 October 2026 · Applies to: Matomo On-Premise 5.14.1 on a Linux VPS (checked with PHP 8.4 on Debian 13); installation guides for Ubuntu 24.04, Debian 13, AlmaLinux and Rocky Linux 9 and 10, and Fedora 44
To run Matomo on a VPS server, you need a Linux VPS with a web server (Apache or Nginx), PHP 8 with the pdo_mysql or mysqli extension, and MySQL or MariaDB. According to Matomo, 2 CPU cores, 2 GB of RAM and 50 GB of SSD storage handle up to 100,000 pageviews a month. You download Matomo, run its web installer, add the tracking code to your website and let cron prepare the reports.
Matomo On-Premise (formerly Piwik) is free, open-source web analytics. On your own VPS, visitor data stays in your own database instead of going to a third party, which helps with privacy rules such as the GDPR. The current release is Matomo 5.14.1; Matomo 6 is in beta at the time of writing.
What size of VPS Matomo needs
Matomo's own sizing advice, by pageviews per month:
- Up to 100,000: one server with 2 CPU cores, 2 GB RAM and 50 GB SSD.
- Up to 1 million: one server with 4 CPU cores, 8 GB RAM and 250 GB SSD.
- Up to 10 million: two servers (application and database) with 8 CPU cores and 16 GB RAM, 100 GB SSD for the application and 400 GB for the database.
- More than that: three or more servers; above 100 million, Matomo recommends several application servers behind a load balancer, plus a CDN.
The database grows with every visit you keep, and by default Matomo deletes nothing. Plan disk space for the history you want, or turn on automatic deletion of old raw data (see "After the installation").
Software requirements
- Web server: Apache, Nginx or LiteSpeed.
- PHP 8 with
pdo_mysqlormysqli(required), plusgdfor graphs andcurl,xmlandmbstring(recommended). On Debian 13,apt install php-mysql php-gd php-xml php-mbstring php-curl php-zipgave all of them with PHP 8.4.26 in our test. - Database: MySQL or MariaDB. Debian 13 ships MariaDB 11.8.
- PHP memory: Matomo's configuration advises a PHP
memory_limitof at least 128 MB, and its command-line archiver raises the limit to at least 768 MB while it runs. Leave room for that in the VPS RAM. - Matomo 6 will need PHP 8.1 or newer and MySQL 8.0 or newer or MariaDB 10.6 or newer. The guides below already meet that.
How to set up Matomo on a VPS
- Point a subdomain, for example
analytics.example.com, to the VPS IP address with an A record. - Install the web server, PHP and MariaDB, and create an empty database and user for Matomo. Our step-by-step guides (tested with Matomo 5.14.0, which passed all required checks):
- Install Matomo on Ubuntu 24.04 (PHP 8.3, MariaDB 10.11)
- Install Matomo on Debian 13 (PHP 8.4, MariaDB 11.8)
- Install Matomo on AlmaLinux and Rocky Linux 9 and 10 (PHP 8.3, MariaDB 10.11)
- Install Matomo on Fedora 44 (PHP 8.5, MariaDB 11.8)
- Download and unpack Matomo:
cd /var/www curl -O https://builds.matomo.org/matomo.zip unzip matomo.zip
Installunzipfirst if it is missing. In our test the archive was 28 MB and unpacked into amatomofolder of about 112 MB. Matomo's guide asks for all files to be readable by the web server and write access only fortmp/andconfig/, for examplechown -R www-data:www-data /var/www/matomo/tmp /var/www/matomo/configon Debian and Ubuntu (the user isapacheornginxon AlmaLinux, Rocky Linux and Fedora). - Turn on HTTPS for the subdomain, for example with certbot as in how to enable SSL for Apache with certbot.
- Open
https://analytics.example.comand follow the installer: Welcome, System Check, database setup, Super User, your first website, tracking code. Fix anything the System Check marks as an error before you continue. - Paste the JavaScript tracking code into every page of your website, right before
</head>, or into a shared header file.
Set up report archiving with cron
According to Matomo, once a site has more than a few hundred visits a day, reports should be prepared by cron instead of when someone opens them in the browser.
- Create a log file the web server user can write to:
touch /var/log/matomo-archive.log chown www-data:www-data /var/log/matomo-archive.log
- Create
/etc/cron.d/matomo-archivewith this line (it runs at five past every hour):5 * * * * www-data /usr/bin/php /var/www/matomo/console core:archive --url=https://analytics.example.com/ > /var/log/matomo-archive.log
- In Matomo, go to Administration > System > General Settings, set Archive reports when viewed from the browser to No and Archive reports at most every X seconds to 3600. To enforce it, add
browser_archiving_disabled_enforce = 1under[General]inconfig/config.ini.php.
Useful core:archive options in Matomo 5.14.1: --force-idsites=1,3 archives only those sites, --concurrent-requests-per-website sets parallel requests (default 3), and --php-cli-options="-d memory_limit=2G" gives the archiver more memory if it runs out.
After the installation
- Privacy: under Administration > Privacy > Anonymize data, IP masking is on by default (2 bytes). The section Regularly delete old raw data limits how long visit logs are kept; Matomo suggests 3 to 6 months for privacy. Check which rules apply to you.
- Behind Cloudflare or a reverse proxy: every visit shows the proxy address until you add
proxy_client_headers[] = HTTP_CF_CONNECTING_IP(Cloudflare) orproxy_client_headers[] = HTTP_X_FORWARDED_FORunder[General]inconfig/config.ini.php. - Updates: after replacing the files with a new release, run
php /var/www/matomo/console core:updateas the web server user. - Backups: back up the database regularly; it holds all your analytics history.
Matomo on a Ucartz VPS
Following Matomo's sizing, our VPS Standard plan (2 CPU cores) suits up to about 100,000 pageviews a month and VPS Elite about 1 million. Once your Matomo VPS is running, open a Technical Support ticket from the client area with the domain for your analytics, and our engineers install Matomo with HTTPS and report archiving at no extra cost. Still choosing a tool? Compare the options in self-hosted alternatives to Google Analytics.
Official documentation: Matomo requirements, installing Matomo, setting up auto-archiving and privacy settings.