PostHog Self-Hosting: The Real Setup Cost Nobody Tells You About
PostHog calls itself free to self-host. After 12 hours of Docker debugging, most founders have a different word for it.

You found PostHog. You read the docs. You saw the words "free to self-host" and felt that particular founder high — the one where you think you've found a way to get enterprise-grade tooling without the enterprise-grade bill. I have been there. Most founders building in 2026 have been there.
Then you cloned the repo, ran docker compose up, and watched your terminal fill with logs. Five minutes passed. Then twenty. Then an hour. The ClickHouse container was doing something. Or maybe it had died. You couldn't tell. You started Googling "PostHog self-hosting not working" at 11pm and found a GitHub issue from 2022 that may or may not still apply.
This is not a hit piece on PostHog. PostHog is genuinely good software, and I'll say that plainly. PostHog self-hosting is a real, working option for the right team. The problem is that the documentation buries the real costs, and most founders don't find out what those costs are until they're already three hours deep and committed. So let's be honest about what you're actually signing up for.
What PostHog Self-Hosting Actually Requires
PostHog is a product analytics platform with feature flags, session recording, A/B testing, and event tracking. It's comprehensive, and that comprehensiveness is exactly why PostHog self-hosting is resource-heavy.
The recommended setup uses Docker Compose, and the stack it runs is not light. You get PostHog itself, but underneath it you're running ClickHouse (PostHog's data warehouse), PostgreSQL, Redis, Kafka, and Zookeeper. Each of those services competes for the same memory on your server.
PostHog's official minimum specs are 4 CPU cores and 8GB RAM. Their own docs recommend 16GB for production and 32GB if you're enabling session recording. That's not a budget VPS. An 8GB RAM server on DigitalOcean, AWS, or Hetzner runs $40-80 per month. A 16GB machine runs $80-150. And that's before you've stored a single event.
The disk picture is just as important. ClickHouse is a column-store database, and it retains your event data indefinitely by default. Session recording stores raw DOM snapshots, so a moderate-traffic app can generate 1-5GB of session data per day. A 50GB disk disappears fast if you don't configure retention policies early.
In terms of networking, PostHog needs several ports open (typically 80, 443, and 8000 for the web UI), and you'll want a domain with SSL configured before you point real production traffic at it. That's another layer of setup — Nginx, Caddy, or a load balancer — that the "quick start" guide doesn't always flag clearly.
The official PostHog self-hosting docs live at posthog.com/docs/self-host. They're detailed. Reading them carefully before you start will save you several hours.
The 5 Things That Break First
Based on patterns in the PostHog community, GitHub issues, and the general DevOps gravity of running a ClickHouse-backed stack, here are the failure modes that catch founders first. These aren't edge cases. They're the usual path.
ClickHouse Initialization Looks Like a Hang
ClickHouse can take 20-45 minutes to initialize on first start. Most founders kill the process thinking it's broken, restart it, wait fifteen minutes, kill it again, and spend an hour in a loop. It wasn't broken. It was working. ClickHouse is doing real schema work on startup, and on an underpowered machine that work just takes time.
This is the single most common PostHog self-hosting failure mode in community forums. The symptom looks identical to a genuine crash, and there's no progress bar.
docker compose logs clickhouse. If you see "Application: Ready for connections" it worked. If you see repeated crashes, that's a different problem (usually RAM).Your Server Runs Out of Memory
PostHog's minimum recommendation is 4GB RAM. The reality is ClickHouse alone needs that. Run PostHog plus ClickHouse plus Postgres plus Redis on an 8GB machine and everything fights for memory. OOM kills happen overnight, silently, and you wake up to a PostHog dashboard that's frozen or returning 502s.
This is a compounding problem, because increasing RAM mid-run requires a server resize, which requires downtime, and your events queue during that window. On any machine below 16GB, treat this as a matter of when, not if.
If you value your time at $100/hour, that initial 12-hour setup is $1,200 of real cost that shows up nowhere in the "free to self-host" framing.
Session Recording Fills Your Disk in Days
Session recording in PostHog stores raw DOM snapshots, not compressed video. A moderate-traffic app with 100 daily active users recording sessions generates 1-5GB per day. A 50GB disk is gone in two weeks. Most founders enabling this feature don't realize what's happening until they get a "no space left on device" error and PostHog stops ingesting events entirely.
The disk fills quietly. PostHog does not alert you when you're approaching capacity in the default self-hosted setup. You find out when something breaks.
Schema Migrations Break on Upgrade
PostHog upgrades run ClickHouse migrations that can take hours and sometimes fail partway through, leaving your database in a half-migrated state. Unlike a typical Postgres migration where rollback is straightforward, ClickHouse schema changes are not trivially reversible. A failed upgrade can mean a broken PostHog instance and a partially corrupted schema that requires manual intervention.
This is one of the reasons the PostHog community recommends treating upgrades as major events, not routine maintenance. Major version upgrades are particularly fragile.
ClickHouse Silently Stops Ingesting at Volume
Under high event load (10,000+ events per hour), ClickHouse can queue events without processing them. The PostHog UI continues to show normally. There's no alert. You might not notice for days, until you observe suspiciously flat metrics in your dashboard and realize that PostHog stopped recording data three days ago.
This failure mode is particularly insidious for founders who check their analytics weekly rather than daily. Three days of missing data before you catch it is a meaningful gap in your understanding of what users actually did.
The Real Cost Calculation
Let's put real numbers on this, because "free to self-host" deserves an honest accounting.
Server cost: an 8GB RAM VPS runs $40-80/month on AWS, DigitalOcean, Hetzner, or Fly. That's the minimum, and it will OOM-kill on you. A 16GB machine (the honest production minimum) runs $80-150/month. If you enable session recording and don't cap it, add $10-30/month in storage. Call it $100-180/month for a PostHog self-hosting setup that doesn't embarrass you in front of users.
Now add your time. The initial setup takes 4-12 hours for a first-time installer who isn't already fluent in Docker, ClickHouse, and Linux networking. I've seen founders spend an entire weekend on it. Every major upgrade adds 2-4 hours. Debugging an OOM kill at 2am takes whatever it takes. If you value your time at $100/hour (conservative for a technical founder), that initial 12 hours is $1,200 of real cost that shows up nowhere in the "free to self-host" framing.
The comparison point is PostHog Cloud, which is free up to 1M events per month with no infrastructure to manage. For the majority of early-stage founders, that free tier covers everything they need. The question of PostHog self-hosting only makes economic sense once you're well past 1M events/month and have enough runway to justify the infrastructure overhead, or when you have regulatory requirements that mandate data residency.
Who PostHog Self-Hosting Is Actually Right For
I want to be clear about this: PostHog self-hosting is the right call for some teams. It's just not the right call for most teams at the stage where they first consider it.
You should seriously consider PostHog self-hosting if you have data sovereignty requirements, meaning your legal or compliance team has determined that event data cannot live in a third-party cloud. This is common in healthcare (HIPAA), financial services, and certain EU-based companies with strict interpretations of GDPR and data residency. If your data has to stay on your infrastructure, PostHog self-hosting is a real option worth the investment.
You should also consider it if you have a dedicated DevOps or platform engineering team that can maintain the stack, run the upgrades, monitor ClickHouse, and debug failures without pulling your product engineers off their work. The key word is dedicated. PostHog self-hosting should not be a side project for a solo full-stack founder who has a product to build.
And it makes sense if you're well past 1M events per month and the economics of PostHog Cloud's pricing at that scale genuinely exceed what self-hosting costs you on an all-in basis, including engineering time. At real scale, the math can flip. But do that math honestly, and include your time.
If none of those three conditions apply, PostHog Cloud is the better choice for you right now. That's not a knock on PostHog self-hosting. It's just an honest read of what PostHog self-hosting asks of you in return.
For Founders Who Just Wanted the Metrics
A lot of the founders who go down the PostHog self-hosting path didn't actually need event analytics at that level of depth. What they needed was a clear picture of their revenue metrics: what their MRR is, which cohorts are churning, where users are dropping out of onboarding, and whether this week's activation rate is improving or decaying. That's a different problem.
If that describes you, there are two cleaner paths worth knowing about.
The first is PostHog Cloud. It's the same product, fully managed by PostHog's team, free up to 1M events per month. No Docker, no ClickHouse, no disk management, no 3am OOM kill alerts. If you need PostHog's feature flags, session recording, and event analytics without the infrastructure burden, this is the honest recommendation. It covers most early-stage product analytics needs without any of the setup cost.
The second is Adtivity. If what you actually need is subscription revenue intelligence rather than raw event analytics, Adtivity is built for exactly that. Adtivity is the Growth Layer for Founders — Founder OS for AI-native founders building subscription products. You connect it to Stripe or Paystack directly, and your MRR Dashboard, Lifecycle Chart, Churn Prediction, and Cohort Retention charts are live in minutes. No Docker. No ClickHouse. No server. The SDK installs like any other npm package, and the MCP integration (Execution Intelligence, or EI) means you can query your metrics directly from Claude, Cursor, or ChatGPT — asking your actual growth data questions in plain language and getting real answers backed by your live numbers.
Adtivity also has Pulse Alerts, which surface anomalies in your subscription metrics automatically, and Share Cards, which let you share your growth numbers cleanly without exporting anything. There's a free tier. You can be live before you finish reading this article.
The honest framing is this: PostHog self-hosting is a serious infrastructure investment that makes sense for serious infrastructure teams. For the solo founder or small team who wanted to understand their product and their revenue without a DevOps background, the better moves are PostHog Cloud for event analytics or Adtivity for subscription growth intelligence.
Frequently Asked Questions
Is PostHog self-hosting really free?
The software license is free. The server is not. Expect $40-150/month for a machine with enough RAM to run ClickHouse reliably. Your DevOps time is also not free, and the initial setup can run 4-12 hours. For a solo founder, PostHog Cloud's free tier (1M events/month) is typically the better call. The self-hosting path makes more sense once you have compliance requirements or volume that justifies the investment.
What are the minimum specs for PostHog self-hosting?
PostHog officially recommends 4 CPU cores and 8GB RAM as a minimum. In practice, a production setup handling real traffic needs 16GB RAM and 4+ cores to avoid OOM kills, especially with session recording enabled. ClickHouse is the resource hog. Budget for more than the minimum if you want this to be reliable.
How long does PostHog self-hosting take to set up?
A clean Docker installation takes 2-4 hours including initial ClickHouse initialization. Add time for custom configuration, SSL, domain routing, and firewall rules. Budget 6-12 hours for a first install you're genuinely confident in. Each major version upgrade adds another 2-4 hours of careful migration work.
What is the best PostHog self-hosting alternative?
It depends on what you need. If you want to skip DevOps entirely, PostHog Cloud is free up to 1M events/month and gives you the full PostHog feature set without server management. If you need subscription revenue metrics (MRR, churn, cohort retention) without any self-hosting overhead, Adtivity connects directly to Stripe and installs via SDK with no server required.
Does PostHog self-hosting scale well?
It can, but it requires ongoing tuning. ClickHouse is a serious data warehouse that scales well, but it needs hands-on management as volume grows. Most teams that outgrow the basic Docker setup end up moving to PostHog Cloud or Kubernetes deployments, both of which are significantly more complex than the initial Docker setup. Plan for that transition from the start if you're expecting high growth.
Try Adtivity
See your product metrics in minutes.
No developer needed. Connect your app, get your dashboard, and understand your users from day one.
Sign up free →Land in your inbox.
We publish across the week and ship the highlights to Substack. Subscribe and the next piece lands the day it goes live.
Best PostHog Alternative for Founders in 2025
Adtivity vs PostHog — which one is actually built for founders?
Read nextProductsGA4 Not Showing Data? Here's Why (And What to Do)
The 9 most common reasons GA4 goes dark — and the exact fixes.
Read nextIdeologyBuilding in public outgrew screenshots!
Here is the thinking behind the Founder Wall, and what ships in a couple of weeks.