What is Langfuse?
The moment agents ship, tracing volume explodes: every LLM call, tool invocation, and retry becomes a span you want to see when something goes weird. Langfuse is the open-source standard for that - traces, evaluations, prompt management, cost and latency dashboards - with SDKs and OpenTelemetry support across every framework.
This template mirrors the official v3 self-host topology: web and worker on a managed Postgres, single-node ClickHouse for the analytics volume (CLICKHOUSE_CLUSTER_ENABLED=false, no Keeper), a Valkey wrapper pinned to maxmemory-policy=noeviction (Langfuse queues jobs there - eviction would lose events), and a MinIO blob store with the bucket pre-created.
Hosted LLM observability meters by the unit - and a busy agent emits thousands per hour. Self-hosted Langfuse meters nothing; ClickHouse compression eats traces for breakfast, and the catalogue’s sizing gives it room to.
What you get
- Tracing for LLM apps and agents: spans, generations, costs, latencies
- Evals: LLM-as-judge, human annotation queues, datasets and experiments
- Prompt management with versioning and deployment labels
- SDKs (Python/JS), OpenTelemetry, and integrations for every framework
- Official v3 topology: web + worker + Postgres + ClickHouse + Valkey + S3
- No tracing-unit metering - volume costs disk, not dollars
How it runs on Lyngbak
| Service | Role | Public |
|---|---|---|
web | Langfuse UI + API (:5000) | yes |
worker | async ingestion/processing | no |
db | Postgres - managed service on Lyngbak | no |
clickhouse | single-node ClickHouse (traces, analytics) | no |
cache | Valkey, noeviction (queue) | no |
blob | MinIO S3 store (events/media), bucket pre-created | no |
Before you deploy
NEXTAUTH_SECRET / SALTauth + API-key hashing (openssl rand -base64 32 each)
ENCRYPTION_KEYexactly 64 hex chars (openssl rand -hex 32)
CLICKHOUSE_PASSWORD / REDIS_AUTH / MINIO_ROOT_PASSWORDinternal service credentials
NEXTAUTH_URLset to the web app’s https domain after first deploy
Sizing and billing
ClickHouse is the scaling dial - 2 GiB suits steady team usage; raise it (and its 20 GB volume) as trace volume grows. Web and worker scale independently at 1 GiB each.
A resource is a flat monthly price, with RAM and disk add-ons when the stack needs a little more than a tier, and room for your own apps on a larger one. On Usage Billing each service takes the smallest size that fits it and is billed by the second it runs, so a stopped stack stops costing CPU and RAM. Its 34.3 GiB of volumes cost $0.15 per GiB a month ($5.15/mo) for as long as they exist. One workspace can use both. See pricing
Compared with the managed service
| Service | Plan | Price | Includes |
|---|---|---|---|
| Langfuse Cloud | Core | $29/mo | 100k tracing units/mo, then graduated overage from $8/100k; Pro $199/mo |
| LangSmith | Plus | $39/mo | per seat + 10k traces included, then $2.50 per 1k base traces |
LLM tracing volume explodes the moment agents ship - every span is a unit. Self-hosted Langfuse meters nothing; ClickHouse compression eats traces for breakfast. Prices from each vendor's pricing page, June 2026.
Run it locally first
The same compose file runs with plain Docker Compose. Clone the template source, copy .env.example to .env, and run docker compose up -d.
Questions
How does self-hosting compare to Langfuse Cloud pricing?
Langfuse Cloud prices by tracing units (Core includes 100k, with graduated overage per 100k) - and agentic apps burn units fast, since every span counts. Self-hosted, tracing units are not metered at any volume - you pay for the compute the stack reserves.
Is self-hosted Langfuse the full product?
The core platform - tracing, evals, datasets, prompt management, dashboards - is MIT-licensed and fully included. A few enterprise features (SSO enforcement, audit logs) sit behind a commercial license, same as the cloud tiers gate them.
Why does the stack need six services?
It mirrors the official v3 architecture: Postgres for transactional state, ClickHouse for the analytical trace volume, a queue (Valkey) between API and worker so ingestion never blocks, and S3 (MinIO) for raw event and media payloads. The template wires all of it - you deploy one stack.
How do my apps send traces to it?
Point the Langfuse SDK (or OpenTelemetry exporter) at your web app domain with keys from project settings. Apps inside the same Lyngbak project can use http://web:5000 and skip the public hop entirely.
Does single-node ClickHouse limit me?
Not until serious scale - single-node handles hundreds of millions of spans with compression. The template sets CLICKHOUSE_CLUSTER_ENABLED=false accordingly; if you ever outgrow it, the catalogue’s 3-node clickhouse template is the upgrade path.