Installation
PostHog offers two deployment options: PostHog Cloud (recommended) and self-hosted. Choose the option that best fits your needs.PostHog Cloud (Recommended)
PostHog Cloud is the fastest and easiest way to get started. We handle all infrastructure, scaling, and updates for you.Benefits
- No infrastructure to manage: We handle servers, scaling, and updates
- Generous free tier: 1 million events per month included
- Always up-to-date: Automatic updates with new features
- 99.9% uptime SLA: For paid plans
- EU and US regions: Choose where your data is stored
Sign Up
Choose the region closest to your users:PostHog Cloud US
Data stored in the United States
PostHog Cloud EU
Data stored in the European Union (Frankfurt)
Getting Started with Cloud
1
Create your account
Sign up at app.posthog.com/signup (US) or eu.posthog.com/signup (EU)
2
Create your organization
Set up your organization and first project
3
Install a library
Follow the onboarding to install a PostHog SDK in your app
4
Verify installation
Send a test event to confirm everything is working
Self-Hosted
Deploy PostHog on your own infrastructure for complete control over your data.When to Self-Host
Consider self-hosting if you:- Need to keep all data on your own servers
- Require air-gapped deployment
- Have strict compliance requirements
- Want to customize the PostHog codebase
Requirements
Before deploying PostHog, ensure you have: Minimum Requirements:- 4 CPU cores
- 8 GB RAM
- 200 GB storage (grows with usage)
- Docker and Docker Compose installed
- A domain name (for SSL/HTTPS)
- 8+ CPU cores
- 16+ GB RAM
- SSD storage for better performance
- Regular backups configured
- Monitoring and alerting set up
Docker Installation
The recommended way to self-host PostHog is with Docker Compose.1
Install Docker
Install Docker and Docker Compose on your server:
2
Clone the repository
Download PostHog’s deployment scripts:
3
Configure environment
Copy the example environment file and update settings:Edit
.env to set:POSTHOG_SECRET: A random secret keyDOMAIN: Your domain namePOSTHOG_DB_PASSWORD: Database password
4
Start PostHog
Launch all services with Docker Compose:This will start:
- PostgreSQL (data storage)
- ClickHouse (analytics database)
- Redis (caching)
- PostHog application server
- Worker processes
5
Set up SSL
Configure HTTPS with Let’s Encrypt:
6
Create admin account
Access PostHog at
https://yourdomain.com and create your admin account.Kubernetes Deployment
For larger deployments, use our Helm chart:Configuration
Key configuration options in your.env file:
Verify Installation
After installation, verify PostHog is working:1
Access the interface
Open PostHog in your browser:
- Cloud:
https://app.posthog.comorhttps://eu.posthog.com - Self-hosted:
https://yourdomain.com
2
Check system status
Navigate to Settings → System status to verify all services are running.
3
Send a test event
Install a library and send a test event to confirm event ingestion:
4
Verify in activity
Go to Activity to see your test event appear (may take a few seconds).
Next Steps
Install a library
Choose an SDK and integrate PostHog with your application
Quickstart guide
Follow our quickstart to capture your first events
Configure projects
Set up projects, teams, and data ingestion settings
Manage organizations
Manage organization members and access controls
Troubleshooting
Self-Hosted Issues
Services won’t start:- Increase RAM allocation (minimum 8 GB recommended)
- Reduce ClickHouse cache settings in
docker-compose.yml
- Check worker logs:
docker compose logs worker - Verify ClickHouse is running:
docker compose ps clickhouse - Check network connectivity between services
Getting Help
- Documentation: Self-hosting docs
- Community: Slack community
- GitHub: Report issues
- Support: Email hey@posthog.com