Self-hosted deployment - Kubernetes (Helm)
This guide will walk you through the steps to deploy Langfuse on Kubernetes using the Helm package manager. You will need access to a Kubernetes cluster and Helm installed on your local machine. For the purposes of this guide, we will use a local minikube instance, but each step should extend to a managed Kubernetes service like GKE, EKS, or AKS.
This guide covers a developer preview which is not suitable for production use. v3 is under active development and we plan to ship a production-ready version by the end of November 2024. We share this information to gather feedback from our awesome developer community.
If you are interested in contributing to our Kubernetes deployment guide or Helm chart, please reach out to us on Discord, contact the maintainers at support@langfuse.com, or join the GitHub Discussion.
Fetch the Helm chart and customize values
Fetch the langfuse-k8s
GitHub repository to your local machine to install the v3 preview using Helm.
git clone https://github.com/langfuse/langfuse-k8s.git
cd langfuse-k8s/charts/langfuse
Checkout the lfe-1348-v3-chart
branch that we use to develop the chart for v3.
git checkout lfe-1348-v3-chart
For local experimentation, the pre-configured variables in the values.yaml file are usually sufficient.
If you send any kind of sensitive data to the application or intend to keep it up for longer, we recommend that
you modify the values.yaml file and overwrite the following environment variables using the additionalEnv
field:
- SALT: A random string used to hash passwords. It should be at least 32 characters long.
- ENCRYPTION_KEY: Generate this via
openssl rand -base64 32
. - NEXTAUTH_SECRET: A random string used to sign JWT tokens.
- NEXTAUTH_URL: The URL where the application is hosted. Used for redirects after signup.
Deploy the helm chart
Create a new namespace for the Langfuse deployment, e.g.:
kubectl create namespace langfuse-v3-preview
Download the Helm chart dependencies:
helm dependency update
Install the Helm chart to our demo namespace:
helm install langfuse . -n langfuse-v3-preview
Our chart assumes that it’s installed as langfuse
.
If you want to install it with a different name, you will have to adjust the Redis hostname in the values.yaml
accordingly.
At this point, Kubernetes will start to deploy the Langfuse application and its dependencies.
This can take up to 5 minutes.
You can monitor the progress by checking kubectl get pods -n langfuse-v3-preview
- we expect all pods to be Running.
Smoke test UI
The Langfuse UI will be served on a NodePort service.
Use kubectl get services -n langfuse-v3-preview
and search for langfuse-web
to see the port mapping.
You can access the Langfuse UI by visiting http://<minikube-ip>:<nodeport>
in your browser.
Go ahead and register, create a new organization, project, and explore Langfuse.
Shutdown
You can delete the Helm release and the namespace to clean up the resources:
helm uninstall langfuse -n langfuse-v3-preview
kubectl delete namespace langfuse-v3-preview
How to Upgrade
Run the following commands to upgrade the Helm chart to the latest version:
helm dependency update
helm upgrade langfuse . -n langfuse-v3-preview