Web Analyticsdocker-ready
PostHog: the best Open Source alternative to Mixpanel in 2026
PostHog combines product analytics, session replay, feature flags, A/B testing and surveys in one self-hostable platform built for product teams.
Technical profile
- License
- MIT
- Category
- Web Analytics
- Replaces
- Mixpanel, Amplitude
- Tech stack
- DjangoReactClickHousePostgreSQL
Preview

Public image provided by PostHog on its own website.
Key features
- Session replay and heatmaps
- Feature flags and A/B experiments
- Funnels, retention and cohorts
PostHog vs. Mixpanel
Pros
- Replaces several SaaS tools at once
Things to consider
- Large-scale self-hosted deployment needs more pieces (ClickHouse, Kafka)
Quick Docker installation guide
Copy this docker-compose.yml, adjust the example passwords and run docker compose up -d on your server. See the full step-by-step guide →
docker-compose.yml
version: "3.9"
services:
posthog:
image: posthog/posthog:latest
restart: unless-stopped
ports:
- "8000:8000"
environment:
- DATABASE_URL=postgres://posthog:posthog@posthog-db:5432/posthog
- SECRET_KEY=change-me-super-secret
- REDIS_URL=redis://posthog-redis:6379
depends_on:
- posthog-db
- posthog-redis
posthog-db:
image: postgres:15-alpine
restart: unless-stopped
environment:
- POSTGRES_USER=posthog
- POSTGRES_PASSWORD=posthog
- POSTGRES_DB=posthog
volumes:
- posthog_pg_data:/var/lib/postgresql/data
posthog-redis:
image: redis:7-alpine
restart: unless-stopped
volumes:
posthog_pg_data: