SelfHostStackOpen-Source Directory

Why Migrate Away from Amplitude & Mixpanel?

Cloud product analytics vendors charge aggressive overage fees per million events tracked, sample user sessions, and force third-party data processor agreements under GDPR and HIPAA. Self-hosting gives you complete, unsampled event tracking, zero per-event costs, built-in session recording, heatmaps, and feature flags within your own isolated cloud VPS.

Top 2 Recommended Open-Source Replacements

Tested and production-ready. Click any tool to view hardware specs and docker-compose configurations.

PostHog

MIT / PostHog Open Source License⭐ 23.5k+

The all-in-one open-source product OS with product analytics, session replay, heatmaps, feature flags, and A/B testing.

Min RAM4 GB
Min CPU2 vCPUs
GitHub Repo ↗

✅ Advantages

  • Complete all-in-one product suite eliminating 5 separate SaaS tools
  • Sub-second analytical queries on ClickHouse columnar storage
  • Rich plugin and webhook ecosystem for real-time alerts

⚠️ Trade-offs / Limitations

  • Resource-heavy stack requiring minimum 4GB RAM
  • Multi-service architecture (ClickHouse, Redis, Kafka, PostgreSQL)

Core Features

Full event autocapture and custom product funnel analysis
Integrated session recordings, heatmaps, and console log inspection
Feature flags, remote config, and multivariate A/B experiment engine
User cohort analysis and retention matrix tracking
ClickHouse-backed query engine for sub-second event aggregation
📄 docker-compose.yml
Production Ready
version: '3.8'
services:
  posthog:
    image: posthog/posthog:latest
    container_name: posthog
    restart: always
    ports:
      - "8000:8000"
    environment:
      - SITE_URL=https://analytics.yourdomain.com
      - SECRET_KEY=your_secret_key_random_32_bytes
      - POSTGRES_HOST=db
      - POSTGRES_DB=posthog
      - POSTGRES_USER=posthog
      - POSTGRES_PASSWORD=securepassword123
      - CLICKHOUSE_HOST=clickhouse
      - REDIS_URL=redis://redis:6379/
    depends_on:
      - db
      - clickhouse
      - redis
  db:
    image: postgres:16-alpine
    container_name: posthog-db
    restart: always
    environment:
      - POSTGRES_DB=posthog
      - POSTGRES_USER=posthog
      - POSTGRES_PASSWORD=securepassword123
    volumes:
      - posthog-pgdata:/var/lib/postgresql/data
  clickhouse:
    image: clickhouse/clickhouse-server:24.3-alpine
    container_name: posthog-clickhouse
    restart: always
    volumes:
      - posthog-chdata:/var/lib/clickhouse
  redis:
    image: redis:7-alpine
    container_name: posthog-redis
    restart: always
volumes:
  posthog-pgdata:
  posthog-chdata:

🚀 5-Minute Deployment Guide

  1. 1Provision a 4GB+ RAM VPS on Hetzner CX32 or DigitalOcean Basic Droplet.
  2. 2Install Docker and Docker Compose.
  3. 3Create directory and save docker-compose.yml.
  4. 4Generate random SECRET_KEY with 197a6874d04f90da350db59980c3e4c31ee95a4cbd605be52482f59e6c1185bd.
  5. 5Start stack with .
  6. 6Configure reverse proxy (Caddy/Nginx) with SSL pointing to port 8000.

Recommended Cloud VPS for PostHog

Compare all VPS hosts →
Hetzner Cloud€7.59/mo

CX32 (4 vCPU, 8GB RAM, 80GB NVMe)

Exceptional CPU & RAM performance for ClickHouse analytics processing.

Deploy on Hetzner →
DigitalOcean4.00/mo

Basic Droplet (2 vCPU, 4GB RAM, 80GB SSD)

Includes 00 free credit to test PostHog clustering for 60 days.

Claim $200 DO Credit →
Vultr4.00/mo

High Performance (2 vCPU, 4GB RAM, 64GB NVMe)

Global low-latency edge datacenters for rapid event ingestion.

Deploy on Vultr →

Matomo

GPL-3.0⭐ 19.8k+

Battle-tested Google Analytics and Mixpanel alternative offering 100% data ownership and zero data sampling.

Min RAM1 GB
Min CPU1 vCPU
GitHub Repo ↗

✅ Advantages

  • Low resource footprint on standard PHP & MySQL stack
  • Extensive enterprise compliance features and audit logs
  • Zero data sharing with third-party advertising networks

⚠️ Trade-offs / Limitations

  • Traditional UI compared to modern product analytics SPAs
  • Advanced heatmap and session recording plugins require paid commercial add-on

Core Features

100% data ownership with strict GDPR, HIPAA, and CCPA compliance
Heatmaps, session recording, and form analytics plugins
No data sampling even on multi-million monthly visit websites
Tag Manager and custom conversion attribution models
📄 docker-compose.yml
Production Ready
version: '3.8'
services:
  matomo:
    image: matomo:latest
    container_name: matomo-app
    restart: always
    ports:
      - "8080:80"
    environment:
      - MATOMO_DATABASE_HOST=db
      - MATOMO_DATABASE_ADAPTER=mysql
      - MATOMO_DATABASE_TABLES_PREFIX=matomo_
      - MATOMO_DATABASE_USERNAME=matomo
      - MATOMO_DATABASE_PASSWORD=matomosecurepassword
      - MATOMO_DATABASE_DBNAME=matomo
    volumes:
      - matomo-data:/var/www/html
    depends_on:
      - db
  db:
    image: mariadb:11.2
    container_name: matomo-db
    command: --max-allowed-packet=64M
    restart: always
    environment:
      - MYSQL_ROOT_PASSWORD=mariadb_root_pass
      - MYSQL_DATABASE=matomo
      - MYSQL_USER=matomo
      - MYSQL_PASSWORD=matomosecurepassword
    volumes:
      - matomo-dbdata:/var/lib/mysql
volumes:
  matomo-data:
  matomo-dbdata:

🚀 5-Minute Deployment Guide

  1. 1Launch an entry-level VPS (1GB RAM is sufficient).
  2. 2Install Docker Engine and Docker Compose.
  3. 3Save docker-compose.yml in .
  4. 4Run .
  5. 5Open in browser to run the 5-minute setup wizard.
  6. 6Attach your domain name and enable HTTPS via Caddy reverse proxy.

Recommended Cloud VPS for Matomo

Compare all VPS hosts →
Hetzner Cloud€3.79/mo

CX22 (2 vCPU, 4GB RAM, 40GB NVMe)

Superb budget server with plenty of headroom for MariaDB.

Deploy on Hetzner →
DigitalOcean.00/mo

Basic Droplet (1 vCPU, 1GB RAM, 25GB SSD)

Fast spin-up with 1-Click Docker image support.

Claim $200 DO Credit →
Vultr.00/mo

Cloud Compute (1 vCPU, 1GB RAM, 25GB NVMe)

Instant deployment in 32+ global datacenter locations.

Deploy on Vultr →

Quick Specification Matrix

ToolLicenseMin RAMMin CPUGitHub RepoPrimary Benefit
Amplitude & Mixpanel (Proprietary)Proprietary ClosedManaged CloudManaged CloudN/ATurnkey but vendor lock-in & paywalls
PostHogMIT / PostHog Open Source License4 GB2 vCPUsPostHog/posthogComplete all-in-one product suite eliminating 5 separate SaaS tools
MatomoGPL-3.01 GB1 vCPUmatomo-org/matomoLow resource footprint on standard PHP & MySQL stack