Product Analytics & Recordings⭐ 25k+ GitHubLicense: MIT

How to Self-Host PostHog Open-Source with Docker Compose

Open-Source Alternative to: Mixpanel & Hotjar ($100+/mo)

PostHog Community Edition gives engineering teams complete control over their analytics telemetry. Track user actions, record user sessions, and manage A/B experiments without US cloud compliance concerns.

MINIMUM HARDWARE
8 GB RAM, 4 vCPU, 100 GB Disk
ESTIMATED SAVINGS
$2,000/year
OFFICIAL REPOSITORY
github.com/PostHog/posthog ↗

Production Docker Compose File

Copy this tested configuration directly into your server's directory:

🐳 docker-compose.yml
# PostHog provides a dedicated deployment repo for Docker Compose / Kubernetes:
# git clone https://github.com/posthog/posthog.git
# cd posthog && docker compose -f docker-compose.dev.yml up

Quick Deployment Steps

1. Recommended for production via PostHog Helm chart or Hobby Docker deployment. 2. docker run -t -i --rm -v /var/run/docker.sock:/var/run/docker.sock -v /opt/posthog:/posthog posthog/posthog:latest 3. Access PostHog dashboard at http://localhost:8000

Key Advantages & Trade-Offs

✓ Why Self-Host PostHog Open-Source?

  • Unmatched feature breadth: analytics, recordings, and feature flags
  • Stores raw ClickHouse event data on your private infrastructure
  • Zero event sampling on self-managed clusters

⚠ What to Keep in Mind

  • Heavy resource footprint (requires at least 8 GB RAM)
  • Upgrades require maintaining Kafka and ClickHouse pipelines

More Self-Hosted Alternatives

Knowledge & Workspace
AppFlowy
Replaces Notion ($10/seat/mo)
Project Management
Plane
Replaces Jira ($8.50/seat/mo) & Linear
No-Code Database
NocoDB
Replaces Airtable ($20/seat/mo)