Required Configuration to Run Matomo

To run Matomo your host needs a couple of things:

  • Webserver such as Apache, Nginx, IIS, LiteSpeed, etc.
  • Matomo 4.x requires PHP version 7.2.5 or greater. Matomo 4.16 and Matomo 5 work well with PHP 8. (The older Matomo 3.x required PHP version 5.5.9 or PHP 7.x.)
  • MySQL version 5.5 or greater, or MariaDB.
  • (enabled by default) PHP extension pdo and pdo_mysql, or the mysqli extension.
  • Matomo can be run on any operating system such as Linux (Ubuntu, RedHat, CentOS, Raspberry Pi OS, etc.), Windows, macOS Server or FreeBSD.

Note: If you have a WordPress site, you can easily install Matomo Analytics fully in your WordPress, with a few clicks!

We recommend using the latest PHP 8.x release as it is more memory efficient and faster than previous PHP versions.

We recommend using MySQL 8+ or MariaDB for your database.

To make the most out of Matomo, you also need a few extra PHP extensions such as the PHP GD extension that is used to generate the sparklines (small graphs), graphs in statistics Email reports, as well as graphs in the Matomo Mobile App. The list of PHP extensions you are recommended to install are:

$ sudo apt-get install php php-curl php-gd php-cli mysql-server php-mysql php-xml php-mbstring

We also recommend the PHP function to execute system commands is enabled as it is used for CLI processes. Please see the following FAQ for more information: How to make the diagnostic “Managing processes via CLI” to display Ok?.

For medium and high traffic websites, please see the following FAQ for more information: Matomo (Piwik) setup for high traffic websites

MySQL User requirements

When installing Matomo, you will need to specify a MySQL username and password. The MySQL user must have permission to create and alter tables in the database.

The MySQL USER should have the permission to SELECT, INSERT, UPDATE, DELETE, CREATE, INDEX, DROP, ALTER, CREATE TEMPORARY TABLES, LOCK TABLES, FILE.

→ Click here for detailed instructions on how to create a new database and MySQL user.

Note: Matomo won’t work with a MySQL load balancer such as ProxySQL unless you can ensure that all queries within a given established connection are always sent to the same database server.

To know how many CPUs and how much RAM and disk Disk space to use, the most important factor is how many requests you will be tracking per month in Matomo. Requests include pageviews, events, downloads, etc. Other factors which would impact server capacity planning include how many websites are created, and how many user segments need to be processed.

As a general rule, when tracking more than 1 million user actions/pageviews/events per month, we recommend to have at least two servers, one for the database and one for handling all the HTTPS requests (Tracking, API, UI) and the Report processing.

Below you will find general recommendations for which instance types to use. While these should work well for most cases, you may need to adjust the instances types to suit your processing workload. Matomo Analytics is designed for speed.

Matomo is a Web Analytics platform designed for speed.

Tracking 100,000 page views per month or less

While Matomo can scale to millions of pages, it is also very efficient to run on a smaller scale, even on a shared hosting account.

  • One server is sufficient to host both the database and app server
  • App server minimum recommended configuration: 2 CPU, 2 GB RAM, 50GB SSD disk.

Tracking 1 million page views per month or less

  • One server can be sufficient to host both the database and app server
  • App server minimum recommended configuration: 4 CPU, 8 GB RAM, 250GB SSD disk.

Tracking 10 million page views per month or less

  • Two servers recommended
    • 1 x App servers, at least 8 CPUs, 16 GB RAM, 100GB SSD disk.
      • Or 2 x App servers, at least 4 CPUs, 4 GB RAM, 100GB SSD disk.
    • 1 x Database server, at least 8 CPUs, 16 GB RAM, 400GB SSD disk.

Tracking 100 million page views per month or less

  • Three servers at minimum recommended:
    • 3 x App servers (or only 2x), with each: 16 CPUs, 16+ GB RAM, 100GB SSD disk.
    • 1 x Database server, at least 16 CPUs, 32 GB RAM, 1 TB SSD disk.
      • optionally 2 x DB servers: second one replicated and configured as reader
    • 1 x Load balancer
    • 1 x CDN recommended

Tracking more than 100 million page views per month

You will need at least the following:

  • Five servers at minimum:
    • 3 x App servers (or more), with each: 16 CPUs, 16+ GB RAM, 100GB SSD disk.
    • 2 x Database server, at least 16 CPUs, 32 GB RAM, 1 TB SSD disk.
      • replicated and configured as reader
    • 1 x Load balancer
    • 1 x CDN

Please contact us for more details. You will need multiple App servers and we can help you setup a high scale Matomo configuration. Matomo can support more than 1 billion page views per month (and even many more by setting up a cluster of multiple instances of Matomo).

Configure Matomo for speed

Learn more in Tips for configuring Matomo and your server for speed.

If you do not have a server with PHP 7 enabled or a MySQL/MariaDB database, or whenever you don’t want to host Matomo on your own servers, we have created our own high quality Matomo hosting service: a fast, scalable, fully secure Matomo service pre-installed for a small fee. Our team takes care of all the complexities for you and we can even migrate any existing Matomo data.

Next step: install Matomo

Next step is to Install Matomo.