SelfHostStackOpen-Source Directory

Why Migrate Away from Google Analytics (GA4)?

GA4 forces EU/global privacy headaches (cookie banners, GDPR/ePrivacy liability), slows down your site with heavy JavaScript tags, and samples your data. Self-hosting lightweight analytics gives you 100% data ownership, bypasses ad-blockers cleanly via your own domain, requires zero cookie banners, and loads in < 2KB.

Top 2 Recommended Open-Source Replacements

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

Umami

MIT⭐ 24.5k+

Ultra-lightweight, privacy-focused open source analytics with clean UI and zero cookie banners.

Min RAM512 MB
Min CPU1 vCPU
GitHub Repo ↗

✅ Advantages

  • Extremely lightweight
  • Zero config cookie-free
  • Blazing fast Next.js UI

⚠️ Trade-offs / Limitations

  • No built-in session recording
  • Less advanced e-commerce attribution compared to GA360

Core Features

Bypasses ad-blockers when proxied through your domain
Script payload under 2 KB (10x lighter than GA4)
No cookies required — fully GDPR, CCPA & PECR compliant
Custom event tracking, funnel analysis, and UTM campaigns
Multi-website support with shareable public/private dashboards
📄 docker-compose.yml
Production Ready
version: '3.8'
services:
  umami:
    image: ghcr.io/umami-software/umami:postgresql-latest
    container_name: umami
    restart: always
    ports:
      - "3000:3000"
    environment:
      DATABASE_URL: postgresql://umami:securepassword123@db:5432/umami
      DATABASE_TYPE: postgresql
      APP_SECRET: 9f8a3c2b1e4d5f6a7b8c9d0e1f2a3b4c
    depends_on:
      - db
  db:
    image: postgres:16-alpine
    container_name: umami-db
    restart: always
    environment:
      POSTGRES_DB: umami
      POSTGRES_USER: umami
      POSTGRES_PASSWORD: securepassword123
    volumes:
      - umami-db-data:/var/lib/postgresql/data
volumes:
  umami-db-data:

🚀 5-Minute Deployment Guide

  1. 1Provision a $4/mo VPS on Hetzner or DigitalOcean with Ubuntu 24.04.
  2. 2Install Docker & Docker Compose: `curl -fsSL https://get.docker.com | sh`.
  3. 3Create a directory `mkdir -p ~/umami && cd ~/umami`.
  4. 4Save the docker-compose.yml file and generate a random 32-char string for APP_SECRET.
  5. 5Run `docker compose up -d`.
  6. 6Point an A-record (e.g. `analytics.yourdomain.com`) to your VPS IP.
  7. 7Set up reverse proxy with Caddy or Nginx Proxy Manager for free auto-renewing SSL.

Recommended VPS for Running Umami

Hetzner Cloud€3.79/mo

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

Best price/performance ratio in EU & US.

View Deploy Instructions →
DigitalOcean$6.00/mo

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

Includes $200 free trial credits for 60 days.

View Deploy Instructions →

Plausible Community Edition

AGPL-3.0⭐ 20.1k+

Simple, lightweight, and open source web analytics built with Elixir and ClickHouse for massive scale.

Min RAM2 GB
Min CPU1 vCPU
GitHub Repo ↗

✅ Advantages

  • Handles huge scale seamlessly
  • Beautiful minimal UI
  • Native revenue tracking

⚠️ Trade-offs / Limitations

  • Requires at least 2GB RAM due to ClickHouse
  • Setup is slightly heavier than Umami

Core Features

Powered by ClickHouse for millions of monthly pageviews
One-page intuitive dashboard with real-time stats
Automated email and Slack traffic reports
Goal conversions and revenue tracking
📄 docker-compose.yml
Production Ready
version: '3.8'
services:
  plausible:
    image: plausible/analytics:latest
    restart: always
    command: sh -c "sleep 10 && /entrypoint.sh db createdb && /entrypoint.sh db migrate && /entrypoint.sh run"
    depends_on:
      - plausible_db
      - plausible_events_db
    ports:
      - "8000:8000"
    environment:
      - BASE_URL=https://stats.yourdomain.com
      - SECRET_KEY_BASE=YOUR_64_CHAR_SECRET_KEY_BASE_HERE
  plausible_db:
    image: postgres:16-alpine
    restart: always
    environment:
      - POSTGRES_PASSWORD=postgres
      - POSTGRES_DB=plausible
    volumes:
      - db-data:/var/lib/postgresql/data
  plausible_events_db:
    image: clickhouse/clickhouse-server:24.3-alpine
    restart: always
    volumes:
      - event-data:/var/lib/clickhouse
volumes:
  db-data:
  event-data:

🚀 5-Minute Deployment Guide

  1. 1Choose a VPS with at least 2GB RAM (e.g. Hetzner CX22).
  2. 2Install Docker & Git.
  3. 3Clone the official repo or use the docker-compose template above.
  4. 4Generate SECRET_KEY_BASE using `openssl rand -base64 48`.
  5. 5Run `docker compose up -d` and configure Nginx / Caddy SSL reverse proxy.

Recommended VPS for Running Plausible Community Edition

Hetzner Cloud€3.79/mo

CX22 (2 vCPU, 4GB RAM)

Effortlessly handles up to 500k monthly pageviews.

View Deploy Instructions →

Quick Specification Matrix

ToolLicenseMin RAMMin CPUGitHub RepoPrimary Benefit
Google Analytics (GA4) (Proprietary)Proprietary ClosedManaged CloudManaged CloudN/ATurnkey but vendor lock-in & paywalls
UmamiMIT512 MB1 vCPUumami-software/umamiExtremely lightweight
Plausible Community EditionAGPL-3.02 GB1 vCPUplausible/analyticsHandles huge scale seamlessly