Self-host Matomo with Levelrail
A privacy-friendly, self-hosted alternative to Google Analytics with full data ownership.
- Authormatomo-org
- LicenceGPL-3.0-or-later
- Memory512 MiB
- Archarm64
- Services2
How to self-host Matomo
-
Pull the images
2 images are pulled on your server.
Show images
mariadb:10.11matomo:5.13.0-apache
-
Create the app
2 services start in a single Compose app, with 2 named volume mounts for your data, on port 80.
-
Fill in the secrets
3 secrets are generated and stored encrypted, 5 settings are preset, you do not have to fill in anything.
-
Open it
Without a domain the app gets an sslip.io address; add --domain SERVICE=HOST to use your own.
Matomo requirements
- Memory
- About 512 MiB
- Architectures
- amd64 image published, arm64 image published
- Ports
- 80
- Domain
- Optional, an sslip.io address is used without one
- Settings
- none to fill in
- License
- GPL-3.0-or-later, copyleft license
- Listed. It is in the catalog but not verified. Back up the data volume before changing an image tag.
- Host ports. It publishes port 80 on the host, so open them in the VPS firewall only if you want that.
Install Levelrail first
On a server with Levelrail running, run the command above, or open the dashboard: Apps, New app, Browse templates, then Matomo. New to Levelrail? Install it on a fresh VPS first.
docker pull ghcr.io/glincker/levelrail:latest Then levelrail-cli login --device. See Getting started and the Matomo docs page.
Deploy Matomo your way
Every format below deploys the same pinned images. Pick the one that fits how you work.
Deploy Matomo from the CLI
levelrail-cli templates deploy matomo --name my-matomo Deploy Matomo with the API
curl -X POST -H "Authorization: Bearer $TOKEN" \
https://levelrail.example.com/api/v1/service-templates/matomo/deploy Matomo configuration
Matomo services
| Service | Image | Ports | Volumes |
|---|---|---|---|
| db | mariadb:10.11 | none | matomo_db_data -> /var/lib/mysql |
| matomo | matomo:5.13.0-apache | 80 | matomo_data -> /var/www/html |
Matomo environment variables
| Variable | Service | Value |
|---|---|---|
| MYSQL_DATABASE | db | Preset by the template |
| MYSQL_PASSWORD | db | Generated at deploy |
| MYSQL_ROOT_PASSWORD | db | Generated at deploy |
| MYSQL_USER | db | Preset by the template |
| MATOMO_DATABASE_DBNAME | matomo | Preset by the template |
| MATOMO_DATABASE_HOST | matomo | Preset by the template |
| MATOMO_DATABASE_PASSWORD | matomo | Generated at deploy |
| MATOMO_DATABASE_USERNAME | matomo | Preset by the template |
Ports and volumes
- Ports
- 80
- Volumes
- 2 named mounts: matomo_db_data -> /var/lib/mysql, matomo_data -> /var/www/html
Matomo FAQ
How much memory does Matomo need?
The catalog lists about 512 MiB of memory for Matomo across its 2 services.
Does Matomo run on arm64?
For Matomo, an arm64 image is published; amd64 is image published.
What licence is Matomo under?
Matomo is licensed under GPL-3.0-or-later, which is copyleft, so changes you distribute must be shared under the same terms.
Does Matomo need configuration before it starts?
No. The template fills in its own defaults and generates secrets at deploy time.
Which database does Matomo bundle?
The template includes MySQL, running as its own service.
Which ports does Matomo use?
Matomo listens on port 80 inside the stack.
Where does Matomo keep its data?
In named volumes: matomo_db_data mounted at /var/lib/mysql and matomo_data mounted at /var/www/html.
Can I deploy Matomo on Dokploy or Dokku?
The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list has an entry with the id matomo for this app, so check that entry as well. Dokku deploys container images with its own commands, so the pinned image mariadb:10.11, matomo:5.13.0-apache is what you deploy there.