13: Matomo - Privacy‑Friendly Analytics

Matomo is a self‑hosted web analytics platform (an alternative to Google Analytics) that lets you track website visits while keeping full control of your data. For detailed usage and advanced features, please refer to the official Matomo documentation.

What is Matomo? (Simple Explanation)

Matomo shows you how people use your website: how many visitors you have, what pages they view, where they come from, and more — all without sending data to third parties.

Prerequisites

Before installing Matomo, make sure you have:

Interdependencies: Matomo uses a MariaDB database. Database backups are handled by Borgmatic (Chapter 6). Borgmatic notifications rely on Apprise (Chapter 5).

Step 1: Start Infinity Tools

Connect to your server via SSH and start Infinity Tools:

sudo infinity-tools

Open Applications

  1. Go to 📱 APPLICATIONS
  2. Select Matomo
  3. Choose Install Matomo

Step 2: Choose HTTPS Mode

When prompted:

Use Traefik for SSL? (Y/n)

Step 3: Enter Your Domain (Traefik Mode)

Examples:

No domain? The installer will ask you to pick a port for local access.

Step 4: Wait for Installation

First‑time setup takes a few minutes. Matomo and its database will be created and started.

Step 5: Open Matomo and Complete the Wizard

Follow the Matomo setup wizard:

  1. System check → Next
  2. Database setup → The installer shows your database credentials
  3. Create your admin account
  4. Add your first website to track
  5. Copy the tracking code (you’ll paste it into your website later)

Step 6: Verify It’s Running

In Infinity Tools, go to 📊 STATUS & HEALTH → STATUS. You should see Matomo and its database running.

Cron for Archiving (Recommended)

Add this to your server’s crontab to keep reports up‑to‑date:

*/5 * * * * docker exec matomo /usr/local/bin/php /var/www/html/console core:archive >/dev/null 2>&1

Troubleshooting

Can’t access the site

Database connection error

Quick Reference

Check containers:

docker ps | grep -E "matomo|matomo-db"

View logs:

docker logs matomo

Restart services:

cd /opt/speedbits/matomo && docker compose restart

Helpful Resources


Revision #2
Created 17 November 2025 16:18:29 by bjoern
Updated 17 November 2025 16:43:17 by bjoern