Langfuse

Deploy self-hosted Langfuse for LLM tracing, prompts and evaluations. Covers Docker Compose, Helm, ClickHouse requirements, SSO, backups and the v3 to v4 upgrade.

On this page

What self-hosted Langfuse records and why teams run it themselves

Self-hosted Langfuse is an open-source LLM engineering platform that runs in infrastructure you control. It records traces of model calls, retrieval steps and agent actions, versions prompts, runs evaluations and manages test datasets. Teams use it to see what an AI feature did for a request and how a prompt change affected quality.

Traces usually contain user prompts, retrieved documents and model outputs, so a Langfuse deployment is a store of sensitive data. Self-hosting keeps that content next to your private model runtimes. The self-hosting overview states Langfuse can run locally, on cloud infrastructure or on-premises, including inside a VPC, and that internet access is optional. That makes isolated networks workable, with the extra steps covered below.

The repository README states the project is MIT licensed except for the ee folders, which have separate terms. It lists Langfuse Cloud, Docker Compose, Kubernetes (Helm) and Terraform templates for AWS, Azure and GCP as deployment options, and describes Helm as the preferred production deployment. Langfuse announced on January 16, 2026 that ClickHouse acquired it, and stated there are no planned licensing changes and that it stays open source and self-hostable.

This page walks through the decisions in order: architecture, license tier, topology, access controls, backups and upgrades.

Langfuse self hosting architecture: two containers and four data services

Langfuse Web and Worker sit in front of PostgreSQL, ClickHouse, Redis or Valkey and S3-compatible blob storage. Only the web container must be reachable by users and applications.

Web container

Langfuse Web (langfuse/langfuse) serves the UI and the public APIs, including ingestion and the OpenTelemetry endpoint. It is the only container users and applications must reach, on port 3000 by default, changed with PORT. For heavy ingestion, the scaling docs suggest a second identical web deployment for /api/public/ingestion*, /api/public/media* and /api/public/otel*. Minimum size is 2 CPU and 4 GiB.

Worker container

Langfuse Worker (langfuse/worker) processes ingested events asynchronously, so its throughput decides how fast traces appear under load. The scaling docs call it saturated when sustained CPU load exceeds 50% on a 2 CPU container and recommend scaling on the langfuse.queue.ingestion.depth metric with tag type:waiting. The minimum is 2 CPU and 4 GiB. It must share ENCRYPTION_KEY with web.

PostgreSQL

Holds transactional data such as users, projects, prompts and API keys. Per the PostgreSQL docs, Langfuse supports PostgreSQL 12 and later, with 15 as the minimum and 16 recommended for v4. Official managed options are Amazon RDS, Azure Database for PostgreSQL, GCP Cloud SQL and Aurora PostgreSQL. Use a managed service where policy allows. The minimum is 2 CPU and 4 GiB.

ClickHouse

Stores traces, observations and scores, and is usually the largest sizing and backup concern. Per the ClickHouse docs, v4 requires ClickHouse 25.12 or newer running in UTC, and multi-shard clusters are not supported. The minimum is 2 CPU and 8 GiB, and the scaling docs recommend at least 16 GiB of memory for larger deployments.

Redis or Valkey

Cache and job queue between web and worker. v4 requires Redis 7.0 or newer, and 7.2 is recommended. Valkey is the other documented option. The minimum is 1 CPU and 1.5 GiB. If Redis CPU exceeds 90%, the scaling docs advise at least 4 CPUs and Redis Cluster mode. Include it in capacity monitoring, because queue pressure shows up as trace delay.

S3-compatible blob storage

Holds raw events, multi-modal attachments and large exports. The blob storage docs list Amazon S3, Google Cloud Storage, Azure Blob Storage, Cloudflare R2, SeaweedFS and MinIO/AIStor as officially supported. LANGFUSE_S3_EVENT_UPLOAD_BUCKET is the only mandatory variable and must be set on both Web and Worker. Data retention needs s3:DeleteObject on all buckets.

Langfuse open source license (MIT) and enterprise license key features

The repository is MIT licensed except for its ee folders. Per the license key docs, all core features and APIs work without a key, and a key unlocks the additional features below.

FeatureWithout a keyWith an Enterprise or Government key
Core features and APIsWork without a key.Same core, plus the features listed below.
Single sign-onProviders and enforcement are set with environment variables, as the authentication docs describe.SSO is not on the list of features a key unlocks.
Project-level roles and protected prompt labelsNot included.Unlocked by the key.
Data retention policies and server-side data maskingNot included. Mask in the application or collector and keep a tested deletion procedure.Unlocked by the key. Retention needs s3:DeleteObject on all buckets.
Audit logs, SCIM and Organization Management APINot included.Unlocked by the key.
Instance Management API and UI customizationNot included.Unlocked by the key.
FIPS mode and no telemetryTelemetry can be turned off with TELEMETRY_ENABLED=false.The Government key adds FIPS mode and no telemetry. Government keys start with lf_gov_.
ActivationNothing to configure.Set LANGFUSE_EE_LICENSE_KEY on both the web and worker containers.

Langfuse Docker Compose or Kubernetes Helm chart: choose a topology and size the data stores

The Docker Compose guide requires a VM with at least 4 cores, 16 GiB memory and 100 GiB disk, and states it has no high availability, scaling or backup. It publishes ports 3000 (web), 9090 (MinIO) and 3031 (AI Gateway) on the host. Restrict incoming traffic to 3000 and 9090, and block 3031 or bind it to 127.0.0.1. The health check is /api/public/health on port 3000, and upgrades use docker compose up -d --pull always. Use Compose to evaluate features, then move to a production topology before storing sensitive traces.

Langfuse OpenTelemetry endpoint, SSO and access controls

Applications send data through the Langfuse SDKs or any OpenTelemetry exporter. Langfuse accepts OTLP over HTTP, as JSON or protobuf, at /api/public/otel with Basic Auth of the base64 public_key:secret_key. It does not support gRPC. Send the header x-langfuse-ingestion-version: 4 to avoid up to 10 minutes of delay. The endpoint arrived in self-hosted v3.22.0. Issue keys per project and environment, and route exporters through an internal collector if you want one place to filter attributes.

Decide before go-live which fields may be traced, and mask personal data and credentials in the application or collector before export. Server-side masking and data retention policies need a license key, so an OSS deployment needs a tested procedure for deleting trace data.

Email and password sign-in is on by default. The authentication docs list providers including Auth0, Authentik, AWS Cognito, Entra ID, GitHub, GitLab, Google, Keycloak, JumpCloud, Okta, OneLogin, WorkOS and custom OAuth. Once SSO works, set AUTH_DISABLE_USERNAME_PASSWORD, block sign-up with AUTH_DISABLE_SIGNUP, or enforce SSO by domain with AUTH_DOMAINS_WITH_SSO_ENFORCEMENT. Enable AUTH_<PROVIDER>_ALLOW_ACCOUNT_LINKING only where emails are verified, because the docs warn it can create security issues otherwise. AUTH_SESSION_MAX_AGE defaults to 43200 minutes.

The configuration reference lists NEXTAUTH_URL, NEXTAUTH_SECRET, SALT and ENCRYPTION_KEY as required. ENCRYPTION_KEY must be 256 bits, 64 hex characters, generated with openssl rand -hex 32. Keep these in a secret manager and include them in backups. Use TLS on the web endpoint and on data store connections, and limit network access to the data stores.

Langfuse backup plan for each data store

State is spread across several services. A restore is complete only when all of them return to a consistent point.

Data storeApproachCheck
ClickHouseManaged backups on ClickHouse Cloud or BYOC. Self-run: volume snapshots including coordination volumes, or native BACKUP to S3.Restore in isolation and confirm recent traces and scores load.
PostgreSQLManaged service backups, or scheduled pg_dump plus volume snapshots.Projects, prompts and API keys return, and SSO sign-in works.
Blob storageProvider versioning or replication. For MinIO or SeaweedFS, mirror the bucket or snapshot the volume.Attachments referenced by restored traces open.
Secrets and configurationHelm values or environment files in version control, secrets in a secret manager.A rebuilt deployment connects to restored data with the same ENCRYPTION_KEY.
Before a version upgradeThe v3 to v4 guide says to back up PostgreSQL and ClickHouse immediately before upgrading.Both backups are taken at the same point and are restorable.
Rollback pathA plain image swap back to v3 fails. Rewind the ClickHouse schema to version 37 with the migrate binary, or restore both databases from backup.The chosen rollback has been rehearsed outside production.

Langfuse v4 upgrade: v3 to v4 migration steps

Langfuse states v4 is generally available for self-hosted deployments with no forced cutover date. v3 receives security patches until January 2027, and Langfuse Cloud becomes v4-only on November 16, 2026. Langfuse follows semantic versioning and requires a major bump for infrastructure changes, but publishes no regular release interval. The releases page shows v4.94.0, v4.93.0 and v4.92.0 on consecutive days in early December, so expect near daily releases.

The migration guide sets minimums of ClickHouse 25.12, PostgreSQL 15 (16 recommended) and Redis 7.0 (7.2 recommended). Upgrade ClickHouse first while still on v3. Confirm the v3 background migrations have finished, then back up PostgreSQL and ClickHouse before upgrading. If you use the Helm chart, the guide requires Langfuse v3.224.1 or later before the chart v1 to v2 upgrade.

LANGFUSE_MIGRATION_V4_WRITE_MODE takes events_only (the default), dual or legacy, and legacy and dual will be removed in an upcoming major version. Plan SDK upgrades with application teams. Plan roughly 3x current ClickHouse data volume for backfill.

Rollback needs a rewound ClickHouse schema or restored backups, so rehearse it. Pin exact image versions for web and worker so each change goes through your release process instead of arriving with a pull.

Langfuse operating ownership

Platform, AI engineering and security teams each own part of Langfuse, and the trace data needs a named owner of its own.

Platform team

  • Run the containers and four data stores.
  • Monitor ingestion queue depth, worker CPU and ClickHouse disk.
  • Run backups and restore tests.

AI engineering

  • Instrument applications and keep SDKs current.
  • Own prompts, datasets and evaluations.
  • Keep trace content to the agreed field list.

Security and privacy

  • Approve traced fields and masking rules.
  • Review SSO roles, API keys and project access.
  • Confirm the deletion procedure runs.

Change record

  • Record pinned versions of every component.
  • Log upgrade steps, write modes and backfill status.
  • Note license key status.

Langfuse self hosting questions

What are the Langfuse requirements for self-hosting?

Langfuse documents minimums of 2 CPU and 4 GiB for Web, Worker and PostgreSQL, 1 CPU and 1.5 GiB for Redis or Valkey, and 2 CPU and 8 GiB for ClickHouse. v4 needs ClickHouse 25.12, PostgreSQL 15 and Redis 7.0 or newer. You also need S3-compatible blob storage and the required variables NEXTAUTH_URL, NEXTAUTH_SECRET, SALT and ENCRYPTION_KEY.

What are the Langfuse ClickHouse requirements?

Langfuse v4 requires ClickHouse 25.12 or newer, ClickHouse must run in UTC, and multi-shard clusters are not supported. Officially supported options are ClickHouse Cloud, ClickHouse BYOC and the ClickHouse Kubernetes Operator. The Helm bundled ClickHouse is community supported. Production Helm guidance is 3 ClickHouse replicas and 3 Keeper replicas, and larger deployments should have at least 16 GiB of memory.

How does SSO work in self-hosted Langfuse?

Langfuse documents providers including Keycloak, Okta, Entra ID, Google, GitHub and custom OAuth. Email and password sign-in is on by default. Use AUTH_DISABLE_USERNAME_PASSWORD to turn it off, AUTH_DISABLE_SIGNUP to block sign-up and AUTH_DOMAINS_WITH_SSO_ENFORCEMENT to enforce SSO by domain. SSO is not on the license key list of unlocked features.

What does a Langfuse license key enterprise tier unlock?

Enterprise or Government keys unlock project-level roles, protected prompt labels, data retention policies, server-side data masking, audit logs, UI customization, the Organization Management API, SCIM and the Instance Management API. The Government key adds FIPS mode and no telemetry. Set LANGFUSE_EE_LICENSE_KEY on both web and worker. Core features and APIs work without a key.

Does the Langfuse OpenTelemetry endpoint support gRPC?

No. Langfuse accepts OTLP over HTTP, as JSON or protobuf, at /api/public/otel with Basic Auth of the base64 public_key:secret_key. A collector that receives gRPC should export to Langfuse over HTTP. Add the header x-langfuse-ingestion-version: 4 to avoid up to 10 minutes of delay. The endpoint is available from self-hosted v3.22.0.

Can Langfuse run as an air-gapped deployment?

The self-hosting overview states Langfuse can run on-premises, including inside a VPC, and that internet access is optional. Use MinIO or SeaweedFS for blob storage and an internal model gateway such as LiteLLM for evaluations. Set TELEMETRY_ENABLED=false to stop the aggregated usage event to PostHog Cloud. Web and worker need access to your configured LLM endpoints.

When should we do the Langfuse v3 to v4 migration?

Before v3 security patches end in January 2027. There is no forced cutover date for self-hosted users, but Langfuse Cloud becomes v4-only on November 16, 2026. The ClickHouse upgrade can start while you are still on v3. Back up PostgreSQL and ClickHouse first, and plan roughly 3x current ClickHouse data volume for backfill.

Scope and handover

DeployOpen deploys Langfuse and its data stores inside your cloud account, data center or isolated network. We integrate SSO, set network and secret controls, connect internal model gateways and set up backups for each store.

We plan and rehearse upgrades, including v3 to v4, document the platform and can provide ongoing support. Instrumenting applications is scoped with the teams that own them.

Handover includes topology and sizing assumptions, Helm values in version control, the SSO and role mapping, the approved trace field list with masking rules, restore results for each store, pinned versions and named owners for each operating area.

Sources and further reading

More on Langfuse

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.