Matomo setup Auto-Archiving with Docker

posted by chriskapp on

Recently I have migrated all analytics of our projects from Google Analytics to Matomo. Matomo is a self-hosted alternative to Google Analytics with better privacy handling. Since all our projects run on Plant we use the official Docker-Image to run Matomo.

For larger websites it is recommended to set up Auto-Archiving, which helps to process our analytics data in the background. The docs explain the setup for a plain installation but to execute the cron in side the docker container you need a different command. Our host server runs on Ubuntu 24.04 and to execute the cron we simply configure the following cron on our host system:

5 * * * * root /usr/bin/docker exec -t [container_name] /usr/bin/bash -c -i "./console core:archive --url=https://[your_url]/" > /tmp/matomo.log

This is basically only s short post to document this for the future and maybe this can also help others.

matomoanalytics