Docs / Self-Hosted Applications / How to Self-Host Matomo Web Analytics

How to Self-Host Matomo Web Analytics

By Admin · Mar 1, 2026 · Updated Apr 23, 2026 · 31 views · 1 min read

What Is Matomo?

Matomo (formerly Piwik) is a comprehensive, open-source web analytics platform. It provides detailed visitor analytics, heatmaps, and conversion tracking — a full-featured alternative to Google Analytics with complete data ownership.

Requirements

  • A Breeze with at least 2 GB RAM
  • Docker and Docker Compose

Docker Compose Setup

mkdir -p /opt/matomo && cd /opt/matomo
cat > docker-compose.yml <<'EOF'
services:
  matomo:
    image: matomo:latest
    restart: unless-stopped
    ports:
      - "8080:80"
    volumes:
      - matomo-data:/var/www/html
    environment:
      - MATOMO_DATABASE_HOST=db
      - MATOMO_DATABASE_ADAPTER=mysql
      - MATOMO_DATABASE_TABLES_PREFIX=matomo_
      - MATOMO_DATABASE_USERNAME=matomo
      - MATOMO_DATABASE_PASSWORD=matomo_password
      - MATOMO_DATABASE_DBNAME=matomo
    depends_on:
      - db

  db:
    image: mariadb:11
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: root_password
      MYSQL_DATABASE: matomo
      MYSQL_USER: matomo
      MYSQL_PASSWORD: matomo_password
    volumes:
      - matomo-db:/var/lib/mysql

volumes:
  matomo-data:
  matomo-db:
EOF

docker compose up -d

Features

  • Real-time visitor analytics
  • Page views, bounce rate, session duration
  • Referrer and campaign tracking
  • Goal and conversion tracking
  • E-commerce analytics
  • Heatmaps and session recordings (premium)
  • Custom dashboards and reports
  • GDPR compliance tools
  • Import from Google Analytics
  • REST API

Was this article helpful?