-
Notifications
You must be signed in to change notification settings - Fork 11
Posthog Unlocked Setup
Primarily docker compose is supported to run Posthog Installation. Use Posthog Official installation docs and change the docker image of posthog for web, worker and async migration to: ghcr.io/karambir/posthog-unlocked:latest
.
Use the docker-compose.hobby.yml file.
Some helpful environment vars to be set in .env
file for docker compose:
IS_DOCKER="true"
NODE_ENV="production"
# Django Web service
SECRET_KEY="randomkey"
SITE_URL="https://posthog.example.com"
DISABLE_SECURE_SSL_REDIRECT=True
IS_BEHIND_PROXY=True
# Trust all proxies or only trust host nginx
TRUST_ALL_PROXIES=True
# TRUSTED_PROXIES
DEPLOYMENT="onprem"
# Enable self capture
# See posthog/utils.py:206 line
# Capture posthog events in the same instance, not posthog.com
SELF_CAPTURE=True
Also add email related settings(in .env
) for password reset and user invites to work:
EMAIL_ENABLED=True
EMAIL_HOST="smtphost.com"
EMAIL_PORT=587
EMAIL_HOST_USER="smtpuser"
EMAIL_HOST_PASSWORD="smtppassword"
EMAIL_USE_TLS=True
EMAIL_DEFAULT_FROM="user@example.com"
Once docker compose
Posthog unlocked has hard disabled signup, so you can't signup from web ui. Instead we have a small django management script to create a user. Checkout https://github.com/karambir/posthog-unlocked/blob/master/posthog/management/commands/create_staff_user.py
docker compose exec web python manage.py create_staff_user --first-name ExampleUser --email user@example.com --password examplePassword --org-name ExampleOrg
Once this is created, you can login, create and invite other users from web ui.