Prerequisites
System Requirements
- macOS or Linux (Windows via WSL2)
- 16GB RAM minimum (32GB recommended)
- 20GB free disk space
- Docker Desktop (for infrastructure services)
Quick Start
The fastest way to get started is using the automated setup:The
./bin/start script uses mprocs to run all services in parallel. It will automatically install mprocs via Homebrew if not present.- Frontend: http://localhost:8000
- API: http://localhost:8000/api
- Dagster (data pipeline): http://localhost:3030
Detailed Setup
1. Environment Setup
Option A: Using Flox (Recommended)
Flox provides a reproducible development environment:- Python 3.11 with required packages
- Node.js and pnpm
- PostgreSQL and ClickHouse clients
- All development tools
Option B: Manual Setup
If not using Flox, install dependencies manually:2. Infrastructure Services
Start PostgreSQL, ClickHouse, and Redis using Docker:- PostgreSQL on
localhost:5432 - ClickHouse on
localhost:9000(HTTP: 8123) - Redis on
localhost:6379 - Kafka on
localhost:9092(for event ingestion) - Object Storage (MinIO) on
localhost:19000
If ports are already in use, you can modify them in
docker-compose.dev.yml.3. Database Setup
Initialize both PostgreSQL and ClickHouse:4. Environment Variables
Create a.env file for local configuration:
5. Frontend Setup
Install and build frontend assets:Running PostHog
Using bin/start (Recommended)
Thebin/start script runs all services in parallel:
- Django web server (port 8000)
- Celery workers (background tasks)
- Celery beat (scheduled tasks)
- Frontend dev server (hot reload)
- Plugin server (event processing)
- Temporal worker (workflows)
Use
Ctrl+A then K to navigate between services in mprocs. Press Q to quit all services.Running Services Individually
For debugging or targeted development:Development Workflow
Auto-Detection of Flox Environment
If using Flox, commands are automatically wrapped:Never use
flox activate in interactive sessions - it hangs. The auto-detection handles this for you.Code Formatting
Hot Reloading
- Frontend: Changes auto-reload at http://localhost:8000
- Backend: Django auto-reloads on Python file changes
- Styles: Tailwind CSS rebuilds automatically
Common Tasks
Create a New Product
Generate API Types
When you change Django serializers, regenerate TypeScript types:frontend/src/generated/core/api.tsproducts/*/frontend/generated/api.ts
Create Database Migrations
Reset Database
Troubleshooting
Port already in use
Port already in use
If you see
Address already in use errors:Database connection errors
Database connection errors
Ensure Docker services are running:
Frontend build fails
Frontend build fails
Clear caches and reinstall:
Python dependencies not found
Python dependencies not found
If using Flox:Without Flox:
Next Steps
Testing
Learn how to run and write tests
Contributing
Contribute code to PostHog