Self-host PostHog
agent-skills-v0.4893.0Product analytics, replay, flags and errors in one platform
- Stars
- 40 814
- CPU
- 4 vCPU
- RAM
- 16GB RAM
- Storage
- more than 30GB storage
- Ports
- 8000 (web service (UI and API) inside the deployment stack), 80 (HTTP through the bundled Caddy proxy in the hobby docker-compose deployment), 443 (HTTPS through the bundled Caddy proxy, with LetsEncrypt certificates)
posthog/posthogWhat is PostHog?
PostHog bundles the tooling a product team usually buys separately: event-based product analytics with autocapture and SQL, GA-style web dashboards, session replay and heatmaps, error tracking, logs and distributed tracing, feature flags, experiments, surveys, plus a warehouse layer with a SQL editor for BI work. The same repo also ships AI observability for LLM apps, an assistant that writes SQL and locates replays, and "self-driving" reports and pull requests generated from product signals.
Self-hosting is offered as an explicitly unsupported hobby deploy: a single bash line pulled from the repo stands up a Docker Compose stack (Caddy in front of the web service, a background worker, Node plugin/ingestion services, PostgreSQL, ClickHouse, Kafka, ZooKeeper, Redis/Valkey and SeaweedFS for object storage). Per the docs you need an Ubuntu VM in the ballpark of 4 vCPU and 16GB of memory with over 30GB of disk, a domain with an A record, and TLS is issued automatically through LetsEncrypt. The code is MIT licensed apart from the ee directory, and multi-tenancy demands a premium license, so parts of the cloud product are missing on your own instance: group analytics, data pipelines, insight and dashboard subscriptions, advanced paths, correlation and lifecycle insights, SAML and RBAC, unlimited alerting and richer survey options. There are no tagged releases aimed at self-hosters - changes flow continuously from master - so running the newest image is the advice, and hobby deployments are expected to top out near 100k events a month with no product or infrastructure support.
PostHog alternatives
FormbricksSelf-hosted, open-source survey and experience-management platform: link, website, in-app and email surveys with no-code builder, webhooks, API, and analytics dashboards.CompareFormbricks with PostHog
ArgillaOpen-source, self-hosted collaboration tool where AI engineers and domain experts label, curate and export high-quality datasets for NLP, LLM and multimodal work.CompareArgilla with PostHog
laudspeakerSelf-hosted, open-source customer engagement platform for building visual onboarding journeys and sending event-triggered email, SMS, push and webhook messages.Comparelaudspeaker with PostHog
openpanelOpen-source, self-hosted web and product analytics in the spirit of Mixpanel: funnels, cohorts, session replay, A/B testing, revenue tracking, cookieless by default.Compareopenpanel with PostHog
confab-webSelf-hosted, open-source platform for archiving and analyzing AI coding sessions with cost tracking, AI recaps, and team sharing.Compareconfab-web with PostHog
Big-AGISelf-hosted, open-source AI workspace for experts: run 2 to 24 models in parallel with Beam, personas, image generation, voice and BYO API keys via Docker.CompareBig-AGI with PostHog
LimeJourneySelf-hosted open-source platform for AI-driven user journeys, visual builder, dynamic segmentation, and BYOI integrations — a Customer.io alternative.CompareLimeJourney with PostHog
quackbackQuackback is a self-hosted, open-source customer feedback platform with boards, roadmap, changelog, chat, help center, and status page.Comparequackback with PostHog
Should you self-host PostHog?
PostHog scores 81/100 on selfhost.directory (how scoring works) and ranks #1 of 26 in Analytics. It has 40 814 GitHub stars, +567 in the last 30 days.
It shipped 4409 stable releases in the past year. The latest, agent-skills-v0.4893.0, came out on 16 November 2026.
Setup is advanced: plan for several services and some ongoing maintenance. An official Docker image is available. It is MIT-licensed and written mostly in Python.
Its closest alternative on selfhost.directory is Apache DevLake (67/100, 3 199 stars). PostHog scores higher overall. See PostHog vs Apache DevLake side by side.
Features
- A/B Testing
- AI AssistantOn self-hosted deployments it needs ANTHROPIC_API_KEY (and OpenAI keys for SQL/regex assistance); without them it shows a not-configured message.
- AI Observability
- Data warehouse and SQL editor
- Distributed Tracing
- Error TrackingMore than two alerts is listed as lost when self-hosting.
- Feature FlagsMulti-environment support is not included in the open-source deploy.
- Heatmaps
- Log Management
- Product Analytics
- REST API
- SDKs for many languages
- Session ReplayDownloading recordings is not part of the open-source deploy.
- SurveysMultiple questions, custom colors/positioning, recurring and event-based surveys are listed as things lost when self-hosting.
- Web analytics
PostHog README
Docs - Community - Roadmap - Why PostHog? - Changelog - Bug reports
PostHog ingests and stores your analytics, errors, replays, and business data so you and your agents can query and act on it. It gives you every tool you need to build a successful product, and captures the context agents need to diagnose problems, uncover opportunities, and ship fixes:
Analytics
- Product analytics: Autocapture or manually instrument event-based analytics to understand user behavior. Analyze your data with visualizations or SQL.
- Web analytics: Monitor web traffic and user sessions with a GA-like dashboard. Track conversion, web vitals, and revenue.
- Group analytics: Analyze multi-seat accounts and other groups of users.
Session replay
- Session replay: Watch real user sessions from your website or mobile app to diagnose issues and understand user behavior.
- Replay Vision: Let AI watch your recordings for you and turn them into queryable observations.
- Heatmaps: See where users click, scroll, and move on your site.
Observability
- Error tracking: Track errors, get alerts, and resolve issues to improve your product.
- Logs: Ingest, search, and analyze log data alongside the rest of your product data.
- Tracing: Follow distributed traces straight to the line of code that broke.
Ship and iterate
- Feature flags: Safely roll out features to select users or cohorts.
- Experiments: Test changes and measure their statistical impact on goal metrics. Set up experiments with no code, too.
- Early access features (beta): Let users opt into betas and register interest in upcoming features.
Talk to users
- Surveys: Ask anything with our collection of no-code survey templates, or build custom surveys with our survey builder.
- Support: Run customer support with a chat widget and a unified inbox, next to the product data behind each ticket.
- Workflows: Automate actions and messages to your users, triggered by your product data.
Data
- Warehouse: Collect, store, transform, and query all the context behind your product. Includes a managed warehouse, 120+ sources, and a SQL editor with BI and data visualization.
- Data pipelines: Run custom filters and transformations on your incoming data. Send it to 25+ tools or any webhook in real time, or batch export large amounts to your warehouse.
- Endpoints: Build custom API endpoints powered by your PostHog data.
AI and agents
- AI observability: Capture traces, generations, latency, and cost for your LLM-powered app. Run LLM-as-a-judge evaluations to catch regressions.
- MCP analytics (beta): See how agents actually use your MCP server.
- PostHog AI: Ask your product data anything. PostHog AI builds insights, writes SQL, and finds replays for you.
- Self-driving: Turn signals in your product data (errors, rage clicks, failed queries, and more) into researched reports and pull requests, delivered to your Inbox for you to review and merge.
You can steer it all from Slack, web, desktop (PostHog Desktop), or your own editor via the MCP.
What is this, a readme for agents?
The remote MCP server is https://mcp.posthog.com/mcp. It routes to the correct data region (US or EU) when your human logs in. Install it into Claude Code, Cursor, Codex, VS Code, Zed, or PostHog Desktop with:
npx @posthog/wizard mcp add
The docs are indexed for you at posthog.com/llms.txt, the changelog is plain Markdown at posthog.com/changelog.md, and the setup guides for every MCP client are in the docs.
All of this is free to use with a monthly free tier for each product. No card is required, and 97% of users pay $0. Join the 500,000+ teams already shipping with PostHog by signing up for PostHog Cloud US or PostHog Cloud EU.
- PostHog is your product's context layer
- Table of Contents
- Getting started with PostHog
- Setting up PostHog
- Learning more about PostHog
- Contributing
- Open-source vs. paid
- We’re hiring!
The fastest and most reliable way to get started with PostHog is signing up for free to PostHog Cloud or PostHog Cloud EU. Your first 1 million events, 5k recordings, 1M flag requests, 100k exceptions, 10GB of logs, and 1500 survey responses are free every month, after which you pay based on usage.
If you want to self-host PostHog, you can deploy a hobby instance in one line on Linux with Docker (recommended 4GB memory):
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/posthog/posthog/HEAD/bin/deploy-hobby)"Open source deployments should scale to approximately 100k events per month, after which we recommend migrating to a PostHog Cloud.
We do not provide customer support or offer guarantees for open source deployments. See our self-hosting docs, troubleshooting guide, and disclaimer for more info.
Once you've got a PostHog instance, the fastest way to set it up is the setup wizard, which installs and configures PostHog in your app for you:
npx -y @posthog/wizard@latest
You can also install our JavaScript web snippet, one of our SDKs, or use our API. You can also connect the MCP to bring PostHog into Claude Code, Cursor, or any MCP-compatible agent.
We have SDKs and libraries for popular languages and frameworks like:
| Frontend | Mobile | Backend |
|---|---|---|
| JavaScript | React Native | Python |
| Next.js | Android | Node |
| React | iOS | PHP |
| Vue | Flutter | Ruby |
Beyond this, we have docs and guides for Go, .NET/C#, Django, Angular, WordPress, Webflow, and more.
Once you've installed PostHog, see our product docs for more information on how to set up product analytics, web analytics, session replays, feature flags, experiments, error tracking, surveys, data sources, and more.
Our code isn't the only thing that's open source 😳. We also open source our company handbook which details our strategy, ways of working, and processes.
Curious about how to make the most of PostHog? We wrote a guide to winning with PostHog which walks you through the basics of measuring activation, tracking retention, and capturing revenue.
We <3 contributions big and small:
- Vote on features or get early access to beta functionality in our roadmap
- Open a PR (see our instructions on developing PostHog locally)
- Submit a feature request on our roadmap or a bug report
For an overview of the codebase structure, see monorepo layout and products.
This repo is available under the MIT expat license, except for the ee directory (which has its license here) if applicable.
Need absolutely 💯% FOSS? Check out our posthog-foss repository, which is purged of all proprietary code and features.
The pricing for our paid plan is completely transparent and available on our pricing page.
Hey! If you're reading this, you've proven yourself as a dedicated README reader.
You might also make a great addition to our team. We're growing fast and would love for you to join us.
If you're looking for easter eggs or abandoned ideas, please check the trash.
More in Analytics
Prisme AnalyticsPrisme Analytics is a self-hosted, open-source web analytics service replacing Google Analytics with privacy-friendly tracking, custom events, and Grafana dashboards.
quant-uxSelf-hosted UX prototyping tool with user testing and data-driven insights. Features visual editors, AI assistants, screen recordings, A/B testing, heatmaps.
questdbSelf-hosted, open-source time-series database with SAMPLE BY and ASOF join SQL, QuestDB Wire Protocol ingestion, PGWire support and a web console.
RedashOpen-source, self-hosted business intelligence tool: query over 35 database and API back ends, build dashboards, schedule refreshes, and get data alerts.
RejourneySelf-hosted product analytics with session replay, crash reporting, and revenue tracking for web and mobile apps. Lighter alternative to PostHog and Sentry.
RichySelf-hosted, open-source portfolio manager for stocks, ETFs, indexes and crypto, with a transactional ledger, performance charts and market news.
RotkiSelf-hosted, open-source crypto portfolio tracker that decodes on-chain and exchange history into readable events and local profit/loss tax reports.
rushomonRushomon is a self-hosted, open-source URL shortener on Cloudflare Workers with fast edge redirects, per-link analytics, OAuth auth, and multi-organization support.
SearchMirrorOpen-source, self-hosted SEO rank tracker monitoring Google positions and AI assistant mentions using your own DataBlue and AI provider keys.
Self-Hosted Metrics (SHM)Self-hosted telemetry server collecting aggregate metrics from distributed apps without user data. Features cryptographic identity, dynamic dashboards, Go/Node.js SDKs.
SendPortalOpen-source, self-hosted email marketing app for newsletters: subscriber lists, tags, campaigns, tracking and a REST API, sending via SES, Mailgun, Postmark and more.
SerpBearSelf-hosted, open-source Google rank tracker: unlimited keywords, email alerts, CSV export, a built-in API, plus SERP scraper and Search Console integrations.

0 comments