matomocamp video host your matomo

TRANSCRIPT: Hi everyone, I’m Boris. Today I’ll walk you through how to install and self-host your own Matomo instance. You’ve probably heard a lot about Matomo during MatomoCamp, so I wanted to run this practical workshop to help you get started with your own setup.
I’m based in Albania and have contributed to open source projects for about six years. I’m a member of the Open Labs hackerspace and work at Cloud68.co, where we maintain open source tools like Matomo. We handle setup, backups, monitoring, and support.

To run Matomo, you need a server. Choose a provider close to where your visitors are located to reduce latency. Good options include:

  • Hetzner – great value, ideal for European audiences. Offers VPS and dedicated servers.
  • DigitalOcean – wider data centre coverage, including the US and Asia.
  • Linode – similar to DigitalOcean.
  • Avoid Big Tech – I personally avoid AWS and Google Cloud due to ethical concerns, but you’re free to choose what works for you.

For this demo, I’ve prepared a server using Hetzner Cloud (CX11 plan, 1 CPU, 2 GB RAM), which can handle up to ~100,000 visits/month based on Matomo’s official scaling guidance.

Connect to the server using SSH:

ssh root@your-server-ip

Once connected, update your system:

apt update && apt upgrade

You’ll need Nginx, MySQL, and PHP 7.4 or higher. Install Nginx and MySQL:

apt install nginx mysql-server

Add the PHP repository and install PHP 7.4:

apt install software-properties-common`
add-apt-repository ppa:ondrej/php
apt update
apt install php7.4-fpm

Install required PHP extensions:

apt install php7.4-mysql php7.4-cli php7.4-xml php7.4-curl php7.4-gd php7.4-common php7.4-mbstring php7.4-zip php7.4-opcache

Download and unzip Matomo:

wget https://builds.matomo.org/matomo.zip
unzip matomo.zip
mv matomo /var/www/
chown -R www-data:www-data /var/www/matomo

Configure Nginx. Edit the default site block: nano /etc/nginx/sites-enabled/default

Use the sample config from the Matomo GitHub repo. Make sure you update the PHP path, set the root to /var/www/matomo, and add security headers and access rules.

Test and restart Nginx:

nginx -t
systemctl restart nginx

Now go to your domain and you should see the Matomo installer.

For HTTPS, install Certbot and use it to get a certificate:

snap install core; snap refresh core
snap install --classic certbot
ln -s /snap/bin/certbot /usr/bin/certbot
certbot certonly --nginx

Set up the MySQL database:

mysql

CREATE DATABASE matomo;
CREATE USER 'matomouser'@'localhost' IDENTIFIED BY 'your_password';
GRANT ALL PRIVILEGES ON matomo.* TO 'matomouser'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Complete the installation in your browser. Enter your database info, create an admin account, and add your first site. Paste the tracking code into your site.

To optimise Matomo, you can enable SSL redirection by setting force_ssl = 1 in the config file. Set up the archiving cron job: for light traffic run it daily, for heavier traffic like 100,000 visits/month run it hourly.

Add GeoIP databases if needed. Set up regular backups and monitoring. Tune MySQL settings like max_allowed_packet.

Q: How often should archiving run?
A: Depends on traffic. Once daily is fine for light use. Hourly for 100k visits/month.

Q: Why use Nginx?
A: I find it easier to configure. Apache works too. With Nginx you must explicitly protect folders like /config and /tmp, unlike Apache which uses .htaccess.

Q: Where’s the config?
A: Use the one at matomo-org/matomo-nginx on GitHub. It has everything you need.

That’s it. If you need help, you can reach me via Matrix at @Boris:cloud68.co. Thanks for joining.

Previous FAQ: [Video] Matomo On-Premise Tips & Tricks