Matomo — Self-Hosted Google Analytics Alternative
Matomo is a privacy-respecting, self-hosted web analytics platform used by over 1 million websites with full data ownership and GDPR compliance.
Installation agent prête
Cet actif peut être installé après choix du runtime, vérification du plan et exécution de la commande adaptée.
npx -y tokrepo@latest install 7aee70f4-39c1-11f1-9bc6-00163e2b0d79 --target codexÀ exécuter après confirmation du plan en dry-run.
What it is
Matomo (formerly Piwik) is an open-source web analytics platform that you host on your own infrastructure. It tracks page views, visitor flows, referrers, e-commerce conversions, and campaign attribution while keeping all data under your control. Unlike cloud analytics services, Matomo stores everything on your servers.
Matomo is built for website operators who need analytics without sending visitor data to third parties. It suits teams subject to GDPR, CCPA, or PECR regulations, as well as organizations that simply prefer data sovereignty.
How it saves time or tokens
This TokRepo workflow provides a ready-to-run Docker configuration for Matomo. Instead of reading through installation docs and configuring PHP, MySQL, and cron jobs manually, you get a single docker-run command that launches a working instance. The included cron-based archiver setup automates report pre-processing, so dashboards load instantly rather than computing on every request.
How to use
- Run the Docker container with your database credentials:
docker run -d --name matomo -p 8080:80 \
-v matomo-data:/var/www/html \
-e MATOMO_DATABASE_HOST=db \
matomo:latest
- Open
http://localhost:8080and complete the web installer. Connect your MySQL or MariaDB instance, create an admin account, and add your first website.
- Add the Matomo JavaScript tracking snippet to your site. The installer generates the snippet automatically. Paste it before
</body>on every page you want to track.
- Set up the cron archiver to pre-process reports:
*/5 * * * * /usr/bin/php /var/www/html/console core:archive \
--url=http://localhost:8080 > /dev/null 2>&1
Example
# docker-compose.yml for Matomo + MariaDB
version: '3'
services:
db:
image: mariadb:10.11
environment:
MYSQL_ROOT_PASSWORD: secret
MYSQL_DATABASE: matomo
volumes:
- db-data:/var/lib/mysql
matomo:
image: matomo:latest
ports:
- '8080:80'
environment:
MATOMO_DATABASE_HOST: db
MATOMO_DATABASE_USERNAME: root
MATOMO_DATABASE_PASSWORD: secret
MATOMO_DATABASE_DBNAME: matomo
volumes:
- matomo-data:/var/www/html
depends_on:
- db
volumes:
db-data:
matomo-data:
Related on TokRepo
- Self-hosted tools -- Browse other self-hosted platforms for AI and developer workflows
- Monitoring tools -- Explore observability and monitoring solutions that complement analytics
Common pitfalls
- Forgetting to set up the cron archiver leads to slow dashboard loads because Matomo computes reports on every page view instead of pre-processing them.
- Running Matomo on shared hosting with limited PHP memory causes archiving failures. Allocate at least 256MB for the archiver process.
- Not configuring a reverse proxy with HTTPS means tracking requests are sent in plain text, which defeats the privacy purpose.
Questions fréquentes
Matomo stores all data on your own server. No visitor information leaves your infrastructure. This makes it compliant with GDPR, CCPA, and PECR by default, whereas Google Analytics sends data to Google servers and requires additional consent mechanisms.
Matomo requires MySQL 8.0 or later, or MariaDB 10.4 or later. The database stores raw visit logs, archived reports, and configuration. For high-traffic sites, a dedicated database server with SSD storage is recommended.
Yes. Matomo provides a Google Analytics importer plugin that pulls historical data via the GA API. The import runs as a background job and can take hours for large datasets, but it preserves continuity when migrating.
Yes. Matomo includes a built-in Tag Manager that lets you deploy tracking scripts, conversion pixels, and custom HTML without modifying your site code. It works similarly to Google Tag Manager but runs on your own server.
For sites under 100K page views per month, a single 2-core server with 2GB RAM is sufficient. High-traffic sites benefit from separating the database and web server, increasing PHP memory to 512MB, and running the archiver more frequently.
Sources citées (3)
- Matomo GitHub— Matomo is the leading open-source analytics platform formerly known as Piwik
- Matomo Installation Guide— Matomo requires PHP 8.x and MySQL 8.0+ or MariaDB 10.4+
- Matomo Archiving Docs— Cron-based archiving for report pre-processing
En lien sur TokRepo
Fil de discussion
Actifs similaires
Shlink — Self-Hosted URL Shortener with Analytics
Shlink is a self-hosted URL shortener that lets you create short links with full analytics, QR codes, and API access. Built with PHP, it supports custom domains and provides detailed visit tracking.
Whoogle — Self-Hosted Privacy-Respecting Search Engine
Whoogle is a self-hosted metasearch engine that proxies Google search results through your own server, stripping ads, tracking scripts, and AMP links while preserving result quality.
RustDesk — Self-Hosted Open Source Remote Desktop
RustDesk is a full-featured open-source remote desktop application written in Rust. It offers a self-hosted alternative to TeamViewer and AnyDesk, giving you full control over your data with your own relay and rendezvous servers.
Vikunja — Self-Hosted Open Source To-Do and Project Management
Vikunja is an open-source task management application written in Go. It offers lists, kanban boards, Gantt charts, and CalDAV sync — a self-hosted alternative to Todoist, Trello, and Asana.