Skip to main content

Command Palette

Search for a command to run...

PostHog Self-Hosted Review: Worth Running Yourself?

Published
4 min read
J
Building autonomous AI systems for digital products

If you’re searching for a posthog self hosted review, you’re probably stuck between two annoying realities: SaaS analytics is convenient but pricey, and self-hosting can turn “simple tracking” into an ops tax. I’ve run PostHog in self-hosted setups and audited teams moving from tools like mixpanel and amplitude—here’s the honest take for engineers who want control without signing up for endless maintenance.

What you actually get with self-hosted PostHog

PostHog’s self-hosted offering is compelling because it’s not “just events.” In one stack you can cover:

  • Product analytics (events, cohorts, funnels, retention)
  • Feature flags & experiments (ship + measure)
  • Session replay (debug UX issues)
  • Autocapture (track clicks/pageviews without instrumenting everything)

The biggest practical win of self-hosting is data residency and ownership. If your compliance team wants “keep it in our VPC,” PostHog fits the checkbox without you building your own pipeline.

The trade-off: self-hosted PostHog is effectively a data platform. You’re running ClickHouse (and friends), managing storage growth, and owning performance tuning. If you’re used to mixpanel being “set-and-forget,” this is a mindset shift.

Deployment reality: Docker is easy; scale is not

Most teams start with the official Docker Compose. That’s fine for a proof-of-concept, internal tools, or early-stage products. But self-hosting becomes real when:

  • Event volume rises (ClickHouse disk and query performance become your problem)
  • Session replay ramps up (storage and bandwidth spike)
  • Multiple environments appear (staging, prod; separate projects; RBAC)

Common operational concerns I’ve seen:

  1. Disk I/O and retention policies: You need to be intentional about event retention and replay retention.
  2. Backups and restores: If PostHog is now “source of truth,” you need tested restore procedures.
  3. Upgrades: PostHog ships quickly. Self-hosters should pin versions and schedule upgrades.
  4. PII hygiene: Autocapture and replay are powerful, but you must configure masking and filtering.

If you already run Kafka/ClickHouse/ELK-like systems, PostHog fits naturally. If not, be honest: you are adopting a mini data infrastructure.

How PostHog compares to mixpanel, amplitude, hotjar, and fullstory

These tools overlap, but their center of gravity differs.

  • mixpanel: Still one of the cleanest product analytics UIs for funnels and retention. It’s mature, polished, and optimized for SaaS convenience. But you’re paying for that convenience, and self-hosting isn’t the default story.
  • amplitude: Strong on behavioral analytics and governance at larger orgs. Great if you’re already deep into experimentation and want enterprise workflows.
  • hotjar: Primarily UX insights (heatmaps, surveys, lightweight recordings). Great for marketing/product teams, less “event warehouse.”
  • fullstory: Session replay-first, with powerful debugging features. Typically heavier on privacy review and cost.
  • posthog: The “engineer-friendly” hybrid: product analytics + flags + experiments + replay, with self-hosting as a first-class option.

Opinionated take: if your priority is best-in-class session replay, fullstory often feels sharper. If your priority is pure product analytics UX, mixpanel and amplitude are very hard to beat. PostHog wins when you want breadth + control and you don’t mind owning the plumbing.

Actionable setup: privacy-first event capture (client + server)

Self-hosting doesn’t automatically make you privacy-safe. The fastest way to stay out of trouble is to (a) avoid sending PII, and (b) keep “identity” on the server.

Here’s a simple pattern using PostHog’s JS for anonymous capture, then linking on the backend:

// client.js (browser)
import posthog from 'posthog-js'

posthog.init('PH_PROJECT_API_KEY', {
  api_host: 'https://analytics.yourdomain.com',
  capture_pageview: true,
  autocapture: false, // turn off until you audit what you collect
  mask_all_text: true,
  mask_all_element_attributes: true,
})

// Track a non-PII event
posthog.capture('signup_started', {
  plan: 'free',
  referrer: document.referrer || 'direct'
})

Then, on your server (conceptually), do the identify/link once you have a user ID you control. The key idea: don’t send raw emails in events; store them in your DB, not your analytics stream.

This setup keeps your client events useful while reducing accidental leakage via DOM text, input fields, or URL query params.

Who should (and shouldn’t) self-host PostHog

Self-hosted PostHog is a good fit if:

  • You need data residency (regulated industries, strict security review)
  • You want analytics + feature flags + experiments in one tool
  • You have enough infra maturity to own ClickHouse performance and retention
  • You want to customize pipelines and integrate deeply with your stack

It’s a poor fit if:

  • You want “no-ops analytics” and are allergic to on-call pages
  • Your team needs a very polished analyst workflow out of the box
  • You’re going heavy on replay without planning storage and masking

Soft recommendation: if you’re currently paying a lot for mixpanel or amplitude and you have even a modest platform team, PostHog self-hosted can be a pragmatic middle path—especially when you treat it like infrastructure, not a widget you install and forget.

More from this blog

G

GhostBrand

100 posts