How to setup Matomo

1 min read
Last update: November 28, 2021

Linux like Digital Ocean droplet

Matomo is an alternative to collect website data: Matomo website

Connect on your server

cd /home/user/www/
wget && unzip
rm How\ to\ install\ Matomo.html && rm
sudo chown -R www-data:www-data /home/user/www/matomo
sudo find /home/user/www/matomo/tmp -type f -exec chmod 644 {} \; && sudo find /home/user/www/matomo/tmp -type d -exec chmod 755 {} \;
cd /etc/nginx/sites-available
sudo vim

For NGINX config, refer to matomo-org/matomo-nginx

server {
    listen 80;
    root /home/user/www/matomo;
    index index.php index.html index.htm;

    error_log /var/log/nginx/matomo.log warn;
    access_log /var/log/nginx/matomo.log;

    location / {
        try_files $uri $uri/ =404;
    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/var/run/php/php7.4-fpm.sock;

    location ~ /\.ht {
        deny all;

sudo ln -s /etc/nginx/sites-available/ /etc/nginx/sites-enabled
sudo certbot --nginx

Now you have to create a MySQL matomo user and database. Go to and setup Matomo with guide.