
PostHog
Product analytics with session recordings and feature flags
Deploy PostHog in 3 Steps
Connect Your VPS
Add your server credentials to Server Compass
Select PostHog
Choose from our template library
Deploy & Configure
Fill in settings and click Deploy
Manual PostHog Setup
For terminal enthusiasts: deploy PostHog manually with these simple steps.
Connect to Your Remote Server
Begin by establishing a secure connection to your server through the terminal.
# Access your VPS
ssh root@YOUR_SERVER_IP
# With SSH key authentication
ssh -i ~/.ssh/your-private-key root@YOUR_SERVER_IPFirst time? Ensure Docker is installed first: curl -fsSL https://get.docker.com | sh
Set Up Your App Folder
Create a dedicated folder for your application files.
# Create and navigate to project directory
mkdir -p ~/apps/posthog
cd ~/apps/posthogSet Up Docker Compose
Create the following docker-compose.yml in your project directory:
services:
posthog:
image: posthog/posthog:latest
ports:
- "8000:8000"
environment:
- DATABASE_URL=postgres://posthog:<your-db-password>@db:5432/posthog
- REDIS_URL=redis://redis:6379
- SECRET_KEY=<your-secret-key>
- SITE_URL=<your-site-url>
restart: unless-stopped
depends_on:
- db
- redis
- clickhouse
db:
image: postgres:16-alpine
environment:
- POSTGRES_USER=posthog
- POSTGRES_PASSWORD=<your-db-password>
- POSTGRES_DB=posthog
volumes:
- postgres_data:/var/lib/postgresql/data
restart: unless-stopped
redis:
image: redis:7-alpine
restart: unless-stopped
clickhouse:
image: clickhouse/clickhouse-server:latest
volumes:
- clickhouse_data:/var/lib/clickhouse
restart: unless-stopped
volumes:
postgres_data:
clickhouse_data:
PORTHost port(default: 8000)SITE_URLSite URLSECRET_KEYSecret keyDB_PASSWORDDB passwordSpin Up the Stack
Run Docker Compose to launch your application.
# Launch the stack
docker compose up -d
# Verify container status
docker compose ps
# Follow the logs
docker compose logs --followOpen the Application Port
Configure UFW to allow traffic to your application.
# Allow the application port through firewall
sudo ufw allow 8000/tcp
sudo ufw reload
# Access your app at:
# http://your-server-ip:8000Make it simple with Server Compass.
Deploy PostHog without touching the command line. Server Compass gives you a clean UI for one-click deployments.
- No terminal required
- Point-and-click setup
- Auto SSL certificates
- Rolling deployments
- Health monitoring
- Instant rollbacks
After Deployment
After deploying PostHog with Server Compass, complete these steps to finish setup
Create admin account
Create project
Install tracking snippet
Need help? Check out our documentation for detailed guides.
PostHog FAQ
Common questions about self-hosting PostHog
How do I deploy PostHog with Server Compass?
Simply download Server Compass, connect to your VPS, and select PostHog from the templates list. Fill in the required configuration and click Deploy. The entire process takes under 3 minutes.
What are the system requirements for PostHog?
PostHog requires a minimum of 2048MB RAM. We recommend a VPS with at least 4096MB RAM for optimal performance. Any modern Linux server with Docker support will work.
Can I migrate my existing PostHog data?
Yes! Server Compass provides volume mapping that allows you to import existing data. You can also use standard PostHog backup and restore procedures.
How do I update PostHog to the latest version?
Server Compass makes updates easy. Simply click the Update button in your deployment dashboard, and the latest PostHog image will be pulled and deployed with zero downtime.
Is PostHog free to self-host?
PostHog is open-source software. You only pay for your VPS hosting (typically $5-20/month) and optionally Server Compass ($29 one-time). No subscription fees or per-seat pricing.
Ready to Self-Host PostHog?
Download Server Compass and deploy PostHog to your VPS in under 3 minutes. No Docker expertise required.
Download Server Compass


