Deploying with helm directly

Last updated:

For all other platforms, we suggest setting up Kubernetes first and using the helm chart directly to deploy a PostHog instance with Nginx ingress controller.

Prerequisites

Installing the chart

Here's the minimal required values.yaml that we'll be using later. You can find an overview of the parameters that can be configured during installation under configuration.

cloud: <your-deployment-platform>
ingress:
hostname: <your-hostname>
nginx:
enabled: true
certManager:
enabled: true

To install the chart with the release name posthog in posthog namespace, run the following:

helm repo add posthog https://posthog.github.io/charts-clickhouse/
helm repo update
helm install -f values.yaml --timeout 20m --create-namespace --namespace posthog posthog posthog/posthog

Lookup external IP

kubectl get svc --namespace posthog posthog-ingress-nginx-controller

Setting up DNS

Create a record from your desired hostname to the external IP.

I cannot connect to my PostHog instance after creation

As a troubleshooting tool, you can allow HTTP access by setting these values in your values.yaml, but we recommend always accessing PostHog via https.

ingress:
nginx:
redirectToTLS: false
letsencrypt: false
web:
secureCookies: false

After upgrading you can run the following to get the IP to access PostHog:

export INGRESS_IP=$(kubectl get --namespace posthog ingress posthog -o jsonpath="{.status.loadBalancer.ingress[0].ip}")
echo "Visit http://$INGRESS_IP to use PostHog\!"

Upgrading the chart

To upgrade the chart using Helm >= v3 with the release name posthog in posthog namespace, run the following:

helm repo update
helm upgrade -f values.yaml --timeout 20m --namespace posthog posthog posthog/posthog --atomic

When upgrading major versions, see Upgrade notes.

See the Helm docs for documentation on the helm upgrade command.

Uninstalling the chart

To uninstall the chart using Helm >= v3 with the release name posthog in posthog namespace, run the following:

$ helm uninstall posthog --namespace posthog

See the Helm docs for documentation on the helm uninstall command.

The command above removes all the Kubernetes components associated with the chart and deletes the release. Sometimes everything doesn't get properly removed. If that happens try deleting the namespace:

kubectl delete namespace posthog