How encryption in transit and at rest works in self-hosted Langfuse
Encryption in a self-hosted Langfuse is split between three places: the load balancer or service mesh that terminates TLS, the data stores that hold prompts and traces, and three application secrets that protect API keys, console sessions and stored provider credentials. Langfuse does not terminate HTTPS itself. Its docs describe TLS termination at a load balancer or a service mesh sidecar such as Istio or Linkerd, and set LANGFUSE_CSP_ENFORCE_HTTPS=true so browsers are restricted to HTTPS. The security team should therefore treat the ingress layer as part of the Langfuse boundary and confirm that TLS is enforced on every client path, including the OTLP endpoint at /api/public/otel that SDKs call from application servers.
Langfuse stores its data in PostgreSQL, ClickHouse, Redis or Valkey and S3-compatible blob storage. The Langfuse docs recommend database-level encryption at rest, typically through managed cloud services, but they do not configure it for you. Each store has its own encryption setting, key management model and backup copies, and the reviewer should ask the platform team to confirm encryption for every one of them, including the backups and any blob bucket used for media uploads. Where the infrastructure is self-managed, the same questions apply to the volumes and object store underneath.
The three application secrets are the part most often left at default values, so they need an owner before go-live. SALT is used to hash API keys, NEXTAUTH_SECRET encrypts console JWTs, and ENCRYPTION_KEY encrypts the LLM API and integration credentials stored in Langfuse. Generate each value separately, store it in your secrets manager, and document how a rotation would be handled. The Langfuse encryption docs cover what each secret protects, but you should verify with your Langfuse version how changing ENCRYPTION_KEY affects existing stored credentials before you plan any rotation.
Where TLS ends and where data is encrypted at rest
The diagram starts with browsers and SDK clients sending requests to a load balancer or service mesh sidecar, which is where TLS ends. Traffic then passes to Langfuse Web and Langfuse Worker inside your network, and both write to PostgreSQL, ClickHouse, Redis or Valkey and S3-compatible storage. Langfuse does not terminate HTTPS itself, so confirm the TLS hop and the internal path for every entry point. At-rest encryption is applied by each data store or its managed cloud service, so check each store's encryption setting separately.
Where TLS ends and where each data store applies encryption at rest.
TLS termination options for Langfuse traffic
Terminating TLS at a cloud load balancer is the most common pattern for a self-hosted Langfuse on a VM or in a managed Kubernetes cluster. Langfuse does not terminate HTTPS itself, so the load balancer holds the public certificate, handles the TLS handshake and forwards requests to Langfuse Web over the private network. The cloud provider's certificate service or your own certificate authority typically supplies the certificate, and renewal is handled either by the provider's managed certificate feature or by your team's automation.
- Certificate ownership: The platform or cloud team usually owns the certificate, its renewal and the listener configuration.
- Plaintext segment: Traffic between the load balancer and Langfuse Web is HTTP unless you configure a backend TLS option, so decide whether that private hop is acceptable.
- Browser enforcement: Set
LANGFUSE_CSP_ENFORCE_HTTPS=trueso browsers are restricted to HTTPS for the UI. - Forwarded headers: Confirm the load balancer passes the protocol and host headers that Langfuse uses to build URLs.
- Audit visibility: Load balancer access logs and TLS policy settings are often the evidence an assessor asks for first.
Before go-live, confirm the minimum TLS version and cipher policy your security team requires on the listener, and that the certificate chain is complete for the hostname users will open.
When Langfuse runs on Kubernetes with the Helm chart or Terraform-based deployments, many teams terminate TLS at an ingress controller. The ingress holds a certificate stored as a Kubernetes secret, routes requests to the Langfuse Web service and can be paired with a certificate manager that requests and renews certificates automatically. Certificate ownership is shared: the platform team runs the controller and the issuer, while the application team decides the hostname and routing.
- Certificate automation: A certificate manager in the cluster can issue and renew certificates, but the issuer's credentials and access to the secret need an owner.
- Controller choice: Confirm which ingress controller and annotations your cluster uses, because TLS settings differ between them.
- Internal path: The hop from the ingress to the Langfuse pods usually stays on the cluster network unencrypted unless you add an internal TLS layer.
- Browser enforcement: Keep
LANGFUSE_CSP_ENFORCE_HTTPS=trueset so browsers still require HTTPS even though the ingress handles the handshake. - Multiple deployments: If you split langfuse-web into ingestion and user interface deployments, route both through the same TLS policy.
Check with your Kubernetes team who renews the certificate, what happens to ingestion if renewal fails, and whether the secret is readable only by the controller namespace.
A service mesh such as Istio or Linkerd can terminate TLS at a sidecar proxy and encrypt traffic between pods with mutual TLS. This moves certificate issuance for workload identities into the mesh control plane, so the Langfuse containers do not manage TLS themselves. The mesh pattern fits organizations that already run a mesh and want encryption on the internal hops, including between Langfuse Web, Langfuse Worker, PostgreSQL, ClickHouse and Redis, where the mesh can apply policy.
- Certificate ownership: The mesh control plane issues short-lived workload certificates, and the mesh operators own rotation and trust roots.
- Internal encryption: Mutual TLS covers pod-to-pod traffic, which is the main reason to choose this option over an edge-only setup.
- Compatibility checks: Confirm each Langfuse dependency works correctly with the sidecar injection and protocol detection your mesh applies, especially the ClickHouse and Redis connections.
- Edge still needed: A mesh does not replace a public edge certificate for browser traffic, so an ingress or load balancer is usually still present.
- Operational load: The mesh adds components to upgrade and troubleshoot, and its failures can look like Langfuse ingestion problems.
Confirm with your mesh team which trust domain and certificate lifetime apply, and test the Langfuse health endpoints after injection before you rely on the mesh for enforcement.
Encrypting traffic between Langfuse components is a separate decision from terminating TLS at the edge. The public connection can be HTTPS while the connections to PostgreSQL, ClickHouse, Redis or Valkey and S3-compatible storage remain unencrypted inside a private network. Each data store has its own TLS settings, certificate authority and client configuration, so this choice affects several teams at once and should be written down with the other data store settings.
- Data store connections: Decide, per store, whether client connections require TLS and which certificate authority the clients trust.
- Blob storage: Confirm whether your S3-compatible endpoint is reached over HTTPS and how the certificate is validated.
- Network isolation: A private subnet, security groups or network policies may be the control you rely on instead of encryption, and that choice needs an owner and evidence.
- Certificate rotation: Internal certificates expire too, so each one needs a renewal process and an alert before expiry.
- Verification: Test that connections fail when TLS is required but missing, rather than assuming the setting took effect.
Record the decision for each hop in your architecture review, including who approves an unencrypted internal path, because auditors and security reviewers often ask for it explicitly.
Encryption controls and the settings that govern them
This table compares each encryption control in a self-hosted Langfuse deployment: what it protects, where it is set and when it fits. Read it as a checklist, since TLS, at-rest encryption and the three application secrets cover different parts of the data path and none replaces the others.
| Control | What it protects | Where it is set | When it fits |
|---|---|---|---|
| TLS at the edge | Traffic between users, SDKs and the Langfuse Web container | Load balancer or ingress certificate, or a service mesh sidecar such as Istio or Linkerd | Always. Langfuse does not terminate HTTPS itself, so the edge must be configured before any user or SDK connects |
| LANGFUSE_CSP_ENFORCE_HTTPS | Browser sessions by restricting content to HTTPS | Environment variable on the Langfuse Web container | When the public URL is HTTPS and you want browsers to refuse insecure content |
| PostgreSQL encryption at rest | Users, projects, prompts and configuration metadata | Database service settings, typically through a managed cloud service | Recommended in the Langfuse docs. Confirm the storage encryption option with your database platform |
| ClickHouse encryption at rest | Traces, observations and scores, the largest data store | Disk or volume encryption on the ClickHouse nodes, or the storage layer you run | Required for stored trace content in regulated settings. Confirm how your ClickHouse disks are encrypted before go-live |
| Redis or Valkey encryption at rest | Queue and cache data used by Langfuse Worker | Service or volume encryption for the Redis or Valkey instance | Applies when the instance persists data to disk. Confirm persistence settings with your platform team |
| Object storage encryption at rest | Uploaded media, exports and event files in S3-compatible storage | Bucket default encryption or the storage platform's encryption settings | Applies to every bucket Langfuse writes to, including media upload and export buckets |
| SALT | API key hashing | Environment variable set before first start; it must stay stable across restarts | Always. Changing it after keys exist affects how stored keys are checked, so plan it with your secrets process |
| NEXTAUTH_SECRET | Signing and encryption of console session JWTs | Environment variable on the web container, shared with any replicas | Always. Rotating it signs out active console sessions, so schedule changes |
| ENCRYPTION_KEY | Stored LLM API keys and integration credentials | Environment variable; keep a copy in your secrets manager and back it up with the database | Always. Losing this key makes stored credentials unreadable, so treat it as a recovery-critical secret |
Setup sequence for encrypting every layer
This sequence takes a self-hosted Langfuse from plain configuration to a state where traffic is encrypted at the edge, every data store is encrypted at rest, and the three application secrets are generated, stored and verified outside configuration files. Each step ends with a check you can record as evidence.
Confirm the edge TLS design
Decide where HTTPS terminates before changing any Langfuse setting. Langfuse does not terminate HTTPS itself, so the design is either a load balancer in front of Langfuse Web or a service mesh sidecar such as Istio or Linkerd. The platform or network team owns this decision, and the output is a written diagram showing each hop from the browser and SDK clients to Langfuse Web, including which hops are encrypted and where certificates are issued and renewed. Confirm that SDK traffic, including OpenTelemetry traces sent to the /api/public/otel endpoint, uses the same HTTPS path as the UI.
Enable HTTPS-only browser enforcement
Set LANGFUSE_CSP_ENFORCE_HTTPS to true on the Langfuse Web container so browsers are restricted to HTTPS. Apply the change in the same deployment definition used for production, whether that is a Helm values file, a Terraform module or a Compose file. Verify the result by loading the UI over HTTP, confirming that it does not serve a working session, and checking the response headers in the browser developer tools for the expected policy. Record the change in version control so the setting survives redeployments.
Choose at-rest encryption for each store
Langfuse stores data in PostgreSQL, ClickHouse, Redis or Valkey, and S3-compatible blob storage, and the Langfuse documentation recommends database-level encryption at rest, typically through managed cloud services. For each store, the platform team selects the encryption option offered by the cloud provider or self-hosted platform, sets the key management approach (provider-managed or customer-managed keys), and confirms that backups and snapshots inherit the same encryption. Ask the provider in writing whether replicas, temporary files and backup copies are encrypted. The output is a table with one row per store, its encryption setting and its key owner.
Generate and store the application secrets
Generate values for SALT, NEXTAUTH_SECRET and ENCRYPTION_KEY with a cryptographically secure random source, and store each one in your secrets manager, such as a cloud key vault or a self-hosted secrets service. Langfuse hashes API keys with SALT, encrypts console JWTs with NEXTAUTH_SECRET, and encrypts stored LLM API and integration credentials with ENCRYPTION_KEY. Record which team holds each value and who can read it. Plan the rotation procedure now, because changing these values affects existing data, so confirm the behavior for each secret against the Langfuse encryption documentation before any rotation.
Inject secrets at runtime
Configure the Langfuse Web and Worker containers to read SALT, NEXTAUTH_SECRET and ENCRYPTION_KEY from the secrets manager at runtime, using your orchestrator's secret integration such as Kubernetes secrets synced from an external vault, or the cloud platform's secret injection. Do not place the values in Compose files, Helm values committed to a repository, or environment blocks in infrastructure code. Restart the containers and confirm that both Web and Worker start successfully and that a test LLM credential saved in the UI is encrypted at rest in PostgreSQL.
Verify certificates and transport
Check the certificate presented at the edge for validity period, chain completeness, hostname match and the expected issuer. Test the TLS version and cipher configuration with a scanner your security team trusts, and confirm that certificate renewal is automated or has an owner and alert. Send a trace from an instrumented application over HTTPS and confirm it is accepted. The output is a dated verification record that your security team can file with the deployment.
Scan configuration for plain-text secrets
Search the deployment repository, the container image environment, the Helm release history and the Langfuse configuration export for the names SALT, NEXTAUTH_SECRET and ENCRYPTION_KEY followed by a literal value. Check container logs and CI job output as well, since build pipelines often echo environment variables. Confirm that the Kubernetes or platform API returns the secrets only as references and that access to the secrets manager is limited to the service accounts that need it. Any hit is a finding to fix and rotate, and the clean scan result is recorded with the date and the tool used.
What happens to the three secrets when they change
Three application secrets decide whether a self-hosted Langfuse keeps working after a change, and each one fails in a different way. SALT is used to hash API keys, so the stored values are not the keys themselves. NEXTAUTH_SECRET is used to encrypt console JWTs, which are the session tokens signed-in users hold in the browser. ENCRYPTION_KEY encrypts the LLM API keys and integration credentials that Langfuse stores so it can call model providers on your behalf. Before anyone plans a rotation, record which of these three values is set in each environment, where it is stored, and who can read it. Treat all three as secrets in your vault, not as entries in a shared configuration file.
The operational consequences differ. Changing NEXTAUTH_SECRET mainly signs users out, since existing console sessions can no longer be verified, which is disruptive but recoverable. Changing SALT can break existing API key verification, so SDKs and integrations that rely on current keys may start failing, and the fix is planned key reissue rather than a quiet swap. Losing ENCRYPTION_KEY is the most serious case: stored provider and integration credentials can no longer be decrypted, so scheduled jobs and evaluators that call those providers stop until the credentials are re-entered. Your backup plan should therefore keep these values alongside the database backups they protect, in a store that is itself backed up and access-controlled.
Before writing any rotation plan, confirm the exact behavior of each variable in the Langfuse encryption documentation. Check whether the docs describe a supported rotation procedure for each secret, whether old values can be kept for a transition period, and which stored data needs re-encryption or re-entry. Also confirm which Langfuse version your deployment runs, because behavior around these settings can change between releases. Ask the vendor or your deployment partner to test the procedure on a staging copy with restored data first, and record the result as evidence for your change board.
Security risks to review before go-live
Encryption for a self-hosted Langfuse depends on several layers working together: TLS at the edge, encryption inside the cluster, encrypted data stores and backups, and protected application secrets. The cards below cover the gaps that most often leave trace data or credentials exposed, and the control that closes each one.
Secrets in Helm values or env files
The application secrets SALT, NEXTAUTH_SECRET and ENCRYPTION_KEY protect API key hashes, console sessions and stored LLM provider credentials. If they sit in plain Helm values, committed .env files or shell history, anyone with repository or cluster read access can use them. Load them from your secrets manager or a Kubernetes secret that is managed outside the chart, restrict who can read it, and confirm that the same values are used by every Web and Worker replica. Record where each value is kept before go-live.
Unencrypted backup copies
Backups of PostgreSQL, ClickHouse and blob storage contain the same prompts, traces and credentials as the live system, often in places with looser access rules. A dump written to an unencrypted bucket or a laptop undoes encryption at rest on the primary. Confirm that every backup target uses server-side encryption with keys you control, that retention and deletion of backups are defined, and that restore tests run with the same secrets. Ask who can read backup storage and whether that list matches the production list.
Internal traffic in plain text
TLS at the load balancer protects users on the public edge, but traffic from Langfuse Web and Worker to PostgreSQL, ClickHouse, Redis or Valkey and S3-compatible storage can still cross the cluster unencrypted. Where your policy requires encryption between services, enable TLS on each data store connection or enforce it through a service mesh such as Istio or Linkerd, and verify that connections negotiate TLS. Check this with a packet capture or the mesh's own status tooling, not only with configuration files.
SDK clients connecting over HTTP
Applications that send traces to an HTTP endpoint expose API keys and prompt content on every request. A reverse proxy that accepts port 80 and forwards traffic without redirecting it leaves this path open. Set LANGFUSE_CSP_ENFORCE_HTTPS=true so browsers are restricted to HTTPS, redirect all HTTP requests to HTTPS at the load balancer, and point SDK base URLs at the HTTPS host name. Test one instrumented application from each team against the production URL before go-live.
Storage buckets without encryption
Media uploads and exported or archived objects in S3-compatible buckets may hold base64 attachments, images and full observation payloads. A bucket created without default encryption, or one readable through a broad policy, exposes that content even when the database is encrypted. Enable default server-side encryption on every bucket Langfuse uses, block public access, and review bucket policies and access keys against the roles that Langfuse needs. Ask your cloud or storage team to show the encryption setting for each bucket.
Access to the secrets manager
Whoever can read the secrets manager can read SALT, NEXTAUTH_SECRET and ENCRYPTION_KEY, and with them decrypt stored provider credentials and forge sessions. Treat this as a privileged path: limit read access to the deployment identity and a small operator group, log every read, and separate the people who deploy Langfuse from those who approve secret changes. Rotating ENCRYPTION_KEY also needs a plan, because stored credentials depend on it. Confirm the rotation procedure in the Langfuse encryption docs before you need it.
Questions buyers ask about Langfuse encryption
What does it cost to set up encryption for a self-hosted Langfuse?
The cost depends on how much of the encryption layer you already run and how much of it needs to be built. Langfuse itself is MIT licensed and its core features are available without a license fee, so the spend is on infrastructure and labor: the load balancer or service mesh that terminates TLS, the database and storage encryption settings in your cloud account or data center, and the secrets tooling that holds SALT, NEXTAUTH_SECRET and ENCRYPTION_KEY. Ask a partner for a quote that separates one-time work (design, configuration, verification, documentation) from recurring work (key rotation procedures, certificate renewal, periodic review). Any Enterprise license key is a separate decision covered by the Langfuse pricing pages, and the encryption configuration itself does not require it.
How long does an encryption review and configuration take?
Duration is set by the number of data stores and the state of your environment, not by Langfuse alone. A review goes faster when PostgreSQL, Redis or Valkey, ClickHouse and object storage already use encryption at rest through managed services with documented keys, and when TLS is already terminated at a load balancer with certificate automation. It slows down when ClickHouse runs on self-managed volumes, when blob storage is an on-premises S3-compatible system, or when the secrets must be imported into a vault for the first time. Ask any partner for the timeline in the written scope, and confirm which of these conditions apply to your environment before agreeing to dates.
What must our team provide before encryption work starts?
The work needs access and decisions from your side. Typically this includes:
- A TLS certificate and private key for the public hostname, or access to the certificate authority that issues them, plus the load balancer or service mesh where termination will happen.
- Access to the cloud accounts, Kubernetes clusters or data center hosts that run PostgreSQL, Redis or Valkey, ClickHouse and blob storage, with permission to change their encryption settings.
- A secrets store your organization approves, such as a managed cloud secrets service or a self-hosted vault, and an owner who can approve rotation and storage of SALT, NEXTAUTH_SECRET and ENCRYPTION_KEY.
- Your key management policy, so that customer-managed keys are used where your rules require them.
Confirm each item with your security and platform teams early, because waiting for an approval often sets the critical path.
Can our internal team configure Langfuse encryption without a partner?
Yes, if your team already operates the data stores and the TLS layer and can read the Langfuse encryption documentation carefully. The steps are configuration, not custom code: terminate HTTPS at the load balancer or service mesh, set LANGFUSE_CSP_ENFORCE_HTTPS=true, enable encryption at rest on each data store, and generate and store the three application secrets. The risk sits in the details: losing ENCRYPTION_KEY makes stored LLM and integration credentials unreadable, changing SALT invalidates existing API key hashes, and rotating NEXTAUTH_SECRET signs out users. A partner adds value when the internal team lacks someone who has done this across all data stores, or when an independent verification and written evidence are required.
Does Langfuse issue a compliance certificate for encryption?
No. Langfuse provides documentation and open-source software, and it does not issue audit reports, attestations or certifications for your deployment. Encryption evidence for a compliance review comes from your own configuration records, cloud provider documentation for managed encryption at rest, and the findings of an independent auditor or certification body. Langfuse's documentation on encryption and its buyer-facing pages describe the controls, but a statement that Langfuse itself is certified should not be accepted as evidence for your environment. Ask your auditor which artifacts they expect, such as configuration exports, key policies and TLS settings.
What are the first things to verify after encryption is configured?
Verify each layer separately and keep the results as evidence. Check that browsers and SDK clients reach Langfuse only over HTTPS and that LANGFUSE_CSP_ENFORCE_HTTPS=true is active. Check the encryption status of PostgreSQL, ClickHouse, Redis or Valkey and the blob bucket in your cloud console or infrastructure tooling. Confirm that the three application secrets are stored in your secrets tool, are not written to container images or shell history, and have a documented owner and rotation procedure. Finally, test a restore in a separate environment to confirm that the backed-up data remains readable with the same ENCRYPTION_KEY.
What happens to encrypted data if a secret is rotated or lost?
The effect depends on which secret changes, so plan each one before it is touched. ENCRYPTION_KEY protects stored LLM API and integration credentials, so losing it means re-entering those credentials, and rotating it requires a documented re-encryption step that your team must test first. SALT is used to hash API keys, so changing it breaks existing keys, which will need to be reissued. NEXTAUTH_SECRET encrypts console JWTs, so rotating it ends active sessions. Keep a secure, access-controlled backup of each value, and confirm the rotation procedure against the current Langfuse encryption documentation for your version before running it in production.
Does encryption change how our Langfuse backups are handled?
Yes. Backups of PostgreSQL, ClickHouse and blob storage carry the encryption state of their source, so the backup target must also be encrypted, and the keys needed to read it must be recoverable. A backup is only useful if the matching ENCRYPTION_KEY, SALT and NEXTAUTH_SECRET values are preserved in a separate, controlled location. Store the secret copies apart from the database dumps, restrict who can read both, and test a restore in a non-production environment. Your backup and key recovery procedure should be written and reviewed before go-live.
What evidence a security review will ask for
A security review of a self-hosted Langfuse will mostly ask for written, current records of each control, not for a single certificate. Start with a TLS document that names the termination point (the load balancer or the service mesh sidecar such as Istio or Linkerd), the certificate issuer and renewal process, the minimum TLS version and cipher configuration your platform enforces, and confirmation that LANGFUSE_CSP_ENFORCE_HTTPS=true is set on the Langfuse Web container. Reviewers will also ask whether any internal hop between the proxy and Langfuse Web, and between Langfuse Web and Langfuse Worker, is encrypted, so record that decision explicitly even where the answer is that traffic stays on a private network.
Next, produce an at-rest register with one row per store: PostgreSQL, ClickHouse, Redis or Valkey, and the S3-compatible bucket. For each row, record whether encryption is provided by the managed service or the storage layer, which key management system holds the keys, who can rotate them, and where the backup copies are encrypted. Langfuse's documentation recommends database-level encryption at rest, typically through managed cloud services, so confirm the exact setting in your environment rather than assuming it. Check the Langfuse encryption page for the current guidance before you finalize the register.
Finally, document secret ownership. Each of SALT, NEXTAUTH_SECRET and ENCRYPTION_KEY needs a named owner, a storage location in your secrets manager, a rotation procedure and a record of which environments hold copies. Be explicit that rotating ENCRYPTION_KEY or SALT affects stored credentials and API key hashes, so the reviewer will expect a tested procedure, not a promise. DeployOpen can plan the systems, configure these controls and assemble this evidence package for your security and compliance teams. An independent auditor or certification body issues any report or attestation, so ask your auditor early which artifacts they will sample.
How DeployOpen scopes and delivers Langfuse encryption work
DeployOpen plans, builds and documents Langfuse encryption in your own infrastructure, from TLS at the load balancer or service mesh to at-rest encryption across PostgreSQL, ClickHouse, Redis and blob storage. Each secret is placed, stored and rotated under a written plan so your security and compliance teams can review the result.
How we scope
- The written scope lists each data store, its encryption setting and the team that owns it.
- We confirm where TLS terminates, whether a load balancer or a service mesh such as Istio or Linkerd handles it.
- Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.
How we build
- We enable HTTPS-only browser access with LANGFUSE_CSP_ENFORCE_HTTPS and verify the setting in place.
- We configure database-level encryption at rest for PostgreSQL, ClickHouse, Redis and S3-compatible storage in your cloud or data center.
- We set SALT, NEXTAUTH_SECRET and ENCRYPTION_KEY from your secret store and test each one before go-live.
How we hand over
- You receive a written record of every encryption layer, the secret owners and the place each key is stored.
- Test results show TLS configuration, encryption status of each data store and the secret values' storage locations.
- We walk your operations team through what breaks if a secret is lost or changed, and how to plan a rotation.
How we support
- Ongoing support, upgrades and continuous testing are available as retainers after handover.
- We can retest encryption settings after Langfuse upgrades, infrastructure changes or certificate renewals.
- Retainer scope, response commitments and service levels are defined in writing and quoted from the agreed scope.

