⚡
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, self-contained, and production-ready. Click any tool to inspect verified docker-compose configurations, hardware sizing, and deployment guides.

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. 1Deploy a VPS with 4GB-8GB RAM (PostHog runs ClickHouse, Postgres, Redis, and Web workers).
  2. 2Clone PostHog repository or use the production Docker Compose recipe.
  3. 3Start stack with `docker compose up -d`.
  4. 4Access PostHog on port 8000 and initialize your organization.
  5. 5Install posthog-js in your frontend application to start tracking funnels and session replays.

Recommended Cloud VPS for PostHog

Compare all VPS hosts →
Hetzner Cloud€7.59/mo

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

ClickHouse analytics engine runs fast on 8GB RAM.

Deploy on Hetzner →
DigitalOcean$24.00/mo

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

Includes $200 trial credits.

Claim $200 DO Credit →
Vultr$24.00/mo

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

NVMe disk I/O ensures fast 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. 1Provision a 2GB RAM VPS on Hetzner or DigitalOcean.
  2. 2Save docker-compose.yml in a new directory.
  3. 3Run `docker compose up -d`.
  4. 4Complete web setup wizard at port 8080 connecting to MariaDB database.
  5. 5Add Matomo JavaScript tracking snippet to your website.

Recommended Cloud VPS for Matomo

Compare all VPS hosts →
Hetzner Cloud€3.79/mo

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

Economical European hosting compliant with GDPR.

Deploy on Hetzner →
DigitalOcean$6.00/mo

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

Instant 1-click Docker deployment.

Claim $200 DO Credit →
Vultr$6.00/mo

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

Reliable global infrastructure.

Deploy on Vultr →

Quick Specification Matrix

ToolLicenseMin RAMMin CPUGitHub RepoPrimary Advantage
Amplitude & Mixpanel (Proprietary)Proprietary ClosedManaged CloudManaged CloudN/ATurnkey onboarding with 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
Starter Stack Pack — $29

Skip the setup: get the production-ready stack

Don't stitch together configs from five different READMEs. Get all 5 production-hardened Docker Compose stacks — Postgres, Redis, SSL auto-renewal, and backup scripts — ready to deploy in minutes.

⚡n8nVisual workflow automation
📊UmamiPrivacy-first web analytics
🛡️Uptime KumaUptime monitoring & alerts
🔐VaultwardenBitwarden-compatible vault
☁️NextcloudDropbox/Drive replacement
Get the Stack Pack — $29 →

One-time purchase · Instant download · Production-ready

esc
↑↓ navigate↵ open