This page covers our free, open-source Docker compose deployment, which is available under a MIT license without guarantee. We continue to develop this version, but some premium features are only available on PostHog Cloud. We do not provide support for this "Hobby" version.
We no longer support paid, open-source deployments and it is no longer possible to buy licenses for self-hosted versions - we instead recommend migrating to PostHog Cloud.
Our MIT-licensed Docker compose deployment is best suited to internal tools, or evaluating features without vendor approval. It's also great for hobby projects which don't need advanced tools. For all other use cases, we recommend you use PostHog Cloud, which comes with a generous free tier.
Requirements
- You have deployed a Linux Ubuntu Virtual Machine.- We highly recommend an instance with at least 4GB of RAM to handle any surges in event volume
 
- You have set up an Arecord to connect a custom domain to your instance.- PostHog will automatically create an SSL certificate for your domain using LetsEncrypt
 
New deployments of PostHog's paid open source product using Kubernetes are no longer supported.
Configuration
There are various ways to configure and personalize your PostHog instance to better suit your needs. In this section you will find all the information you need about settings and options you can configure to get what you need out of PostHog.
Setting up the stack
To get started, all we need to do is run the following command, which will spin up a fresh PostHog deployment for us automatically!
You'll now be asked to provide the release tag you would like to use, as well as the domain you have connected to your instance.
This release tag is the DockerHub tag and doesn't refer to the sunsetted Helm chart releases
Once everything has been setup, you should see the following message:
PostHog will wait here on a couple of tasks that need to be completed, which should only take a couple minutes.
Once this is complete, you should be able to see your PostHog dashboard on the domain you provided!
If you notice this step taking longer than 10 minutes, it's best to cancel it with
Ctrl+Cand take a look at the troubleshooting section.
Customizing your deployment (optional)
By default, the docker-compose.yml file that gets run comes with a series of default config values that should work for most deployments.
If you need to customize anything, you can take a look at the full list of environment variables.
After making any changes, simply restart the stack with docker-compose.
Additionally, if you would like to run a different version of PostHog, you can change the tag for the web, worker, and plugins services. Check out here for a list of all available tags.
Troubleshooting
If you have already run the one-step deployment command above and something went wrong, this section covers a number of steps you can take to debug issues.
Checking that all containers are running
We can use docker ps to check that all of our services are running.
You should see all the same containers as above. If any containers aren't showing up or show that they've restarted recently, it's worth checking their logs to see what the issue is.
Checking the logs of each container
We can use the following command to check the logs for each of our containers.
The best place to start looking is in the web container, which runs all the database migrations and will produce an error if any have failed.
Running into issues with deployment? Ask a question here or check out our Slack to get help.
Upgrading
To upgrade, you can run the upgrade-hobby script from the PostHog repo.
Warning: Before upgrading, make sure you have created back-ups of all your data!
Our recommendation is to keep your PostHog deployment up-to-date. While we avoid breaking changes wherever possible we may sometimes deprecate or add features that require you to update to the latest version. You can track our latest updates in the changelog.
Migrating
If your server is struggling, you can either increase your instance size or move to PostHog Cloud for a hands-off experience