Help Center

Matomo + MariaDB

Matomo is a web analytics platform alternative to Google Analytics, with an important difference: the data is hosted on your own server, so it is not shared with third parties and you control retention.

This Stack installs it with MariaDB.

Services included

In addition to the application, the Stack brings up MariaDB, an nginx that receives traffic on port 80, an automatic backups service and the web file manager.

Project structure

text
.
├── backup
│   └── backup-runner.sh
├── health
│   └── status.php
├── nginx
│   └── default.conf
├── .env.example
└── compose.yaml

Getting started

Install the Stack and start it:

bash
docker-deploy-stack --stack php/matomo-mariadb
cd /root/stack/php/matomo-mariadb
docker compose up -d

This is a ready-to-use application: you don’t need to upload any code. Themes, plugins, extensions and files you upload from its admin panel are stored in the Stack and included in automatic backups.

Configuration

Editable values are in the Stack’s .env file:

Variable Default Purpose
APP_PORT 80 Public port of the Stack.
APP_ENV development Application environment.
DB_NAME matomo Database name.
DB_USER matomo Database user.
BACKUP_ENABLED 1 Automatic backups: 1 enabled, 0 disabled.
BACKUP_INTERVAL_SECONDS 86400 How many seconds between backups.
BACKUP_RETENTION_DAYS 7 How many days backups are retained.
MARIADB_VERSION 11.4 Corresponding image version.
MATOMO_VERSION latest Corresponding image version.

After changing it, apply the changes with docker compose up -d.

Useful commands

bash
docker compose ps          # view running containers
docker compose logs -f     # view live logs
docker compose restart     # restart services
docker compose down        # stop and remove containers
Guide g.0307 · Source version 1 · en