# 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. ## Install Save in your project root: # Matomo — Self-Hosted Google Analytics Alternative ## Quick Use ```bash docker run -d --name matomo -p 8080:80 -v matomo-data:/var/www/html -e MATOMO_DATABASE_HOST=db matomo:latest # Complete the web installer at http://localhost:8080 ``` ## Introduction Matomo (formerly Piwik) is the leading open-source web analytics platform, providing a privacy-respecting alternative to Google Analytics. Self-hosted on your own servers, it gives you 100% data ownership and full GDPR, CCPA, and PECR compliance out of the box. ## What Matomo Does - Tracks page views, visits, referrers, and user flows across your websites - Provides real-time visitor dashboards with geographic and device breakdowns - Measures e-commerce conversions, goals, and campaign attribution - Generates heatmaps and session recordings to understand user behavior - Supports tag management for deploying tracking scripts without code changes ## Architecture Overview Matomo is a PHP application backed by MySQL or MariaDB. The tracking endpoint ingests JavaScript beacon requests and queues them for archiving. A cron-based archiver processes raw log data into aggregated reports. The plugin architecture extends every layer from tracking to UI widgets. ## Self-Hosting & Configuration - Install via Docker, Debian/RPM packages, or extract the PHP archive to a web server - Requires PHP 8.x and MySQL 8.0+ or MariaDB 10.4+ as the database backend - Run `console core:archive` via cron every hour for report pre-processing - Configure a GeoIP2 database for accurate geographic visitor tracking - Set `trusted_hosts[]` and `force_ssl=1` in config.ini.php for production security ## Key Features - Full data ownership with no third-party data sharing or sampling - GDPR compliance built-in with consent management and data anonymization - Import existing Google Analytics data with the official migration tool - Over 100 plugins available including custom dashboards, funnels, and cohorts - Roll-up reporting aggregates data across multiple sites into a single view ## Comparison with Similar Tools - **Google Analytics** — free but sends data to Google; Matomo keeps data on your servers - **Plausible** — lightweight privacy analytics; Matomo offers deeper enterprise features - **Umami** — simpler self-hosted analytics; Matomo provides e-commerce and tag management - **PostHog** — product analytics oriented; Matomo focuses on web traffic analytics - **Fathom** — paid privacy analytics; Matomo has a free self-hosted option ## FAQ **Q: Is Matomo free?** A: The self-hosted version is free and open-source under GPLv3. Matomo Cloud is a paid hosted service. Some premium plugins require a subscription. **Q: Can it handle high traffic?** A: Yes. Matomo scales to millions of page views per day with proper MySQL tuning, cron archiving, and optional QueuedTracking plugin for async ingestion. **Q: How do I migrate from Google Analytics?** A: Use the Google Analytics Importer plugin to pull historical data via the GA API into your Matomo instance. **Q: Does it affect page load speed?** A: The JavaScript tracker is lightweight at around 22 KB. Async loading ensures it does not block page rendering. ## Sources - https://github.com/matomo-org/matomo - https://matomo.org/docs/ --- Source: https://tokrepo.com/en/workflows/7aee70f4-39c1-11f1-9bc6-00163e2b0d79 Author: AI Open Source