PostHog
Open-source product analytics with event tracking, session recording, feature flags, and A/B testing. Self-host to keep all user data on your own infrastructure with no per-event fees
Quick Start
curl -fsSL https://raw.githubusercontent.com/PostHog/posthog/HEAD/bin/deploy-hobby && bash ./deploy-hobby Overview
PostHog is a product analytics platform that puts event tracking, session recording, feature flags, A/B testing, and user surveys under a single roof. The appeal of self-hosting is straightforward: all user behaviour data stays on your own infrastructure, there is no per-event billing, and you own the database. For products with strict data residency requirements or significant event volume, those are meaningful advantages over Mixpanel or Amplitude.
The backend is built on ClickHouse, which gives PostHog the ability to query millions of events in seconds without pre-aggregating data. Funnel analysis, retention curves, and cohort breakdowns run against raw event data. This is the same architecture cloud analytics services use, running on your own server.
Feature flags are fully integrated with the analytics layer. Rather than managing flags in a separate tool like LaunchDarkly, you can tie a flag’s rollout to a user property or cohort that already exists in your PostHog data. A/B test analysis uses the same event data, so you see the full funnel impact of a variant rather than a single conversion metric.
Session recordings let you watch individual user sessions with a redaction system that masks form inputs and sensitive elements by default. Combining this with funnels lets you go from “users are dropping off at step 3” to actually watching what happens at step 3.
The operational reality is worth setting expectations around. The self-hosted stack requires ClickHouse, Kafka, Postgres, Redis, and several worker processes. The minimum comfortable hardware is 4 CPU cores and 8GB RAM. PostHog Cloud on the free tier covers 1 million events per month, which makes it a reasonable starting point before taking on the infrastructure overhead.
PostHog: Pros & Cons
| Pros (The Wins) | Cons (The Friction) |
|---|---|
| All-in-one: Analytics, recordings, flags, and A/B tests in one tool. | Resource heavy: 4 CPU cores and 8GB RAM minimum for self-hosting. |
| Data ownership: All user data stays on your own infrastructure. | Complex stack: ClickHouse, Kafka, Postgres, Redis: 8+ containers minimum. |
| ClickHouse backend: Raw event queries at scale; no pre-aggregation needed. | Upgrade complexity: ClickHouse migrations can require manual steps. |
| 34.7k stars: Active development with cloud option as fallback. | Feature rough edges: Some reports less polished than Mixpanel or Amplitude. |
Use Cases
Specific ways to use PostHog for your workflow.
Deployment Strategy
Recommended ways to host PostHog in your own environment.