Langfuse v4 LLM Observability Stack

Deploys the full Langfuse v4 stack for tracing, evaluating and cost-tracking LLM applications: web app, background worker, ClickHouse, Postgres, Redis and a Railway Bucket. It suits teams that want LLM telemetry on their own infrastructure. The first admin, organization, project and API keys are created on first start.

What you get

  • Langfuse web and worker, both pinned to version 4.56.0 and wired together over Railway's private network
  • ClickHouse for traces and dashboards, Postgres for users, projects and prompts, Redis for queues, each on a volume
  • A Railway Bucket for raw events, media and batch exports
  • A pre-created admin account, project and API keys; all secrets are generated
  • Public sign-up disabled by default (AUTH_DISABLE_SIGNUP=true)
  • An OpenTelemetry endpoint at /api/public/otel for v4 SDKs and OTel exporters

Good for

  • Trace LLM calls, tool calls and agent steps with latency, token usage and cost per request
  • Keep a versioned prompt registry and compare prompt versions with datasets and experiments
  • Run LLM-as-a-judge or human annotation workflows to score answer quality
  • Act as the observability backend behind an LLM gateway such as LiteLLM

Cost

Cost follows memory across five services plus volumes and bucket storage. In the template author's tests, langfuse-web held about 720 MB live heap right after start and crash-looped at roughly 714 MiB, so it needs at least 1.5 GB; ClickHouse is the other main memory consumer as ingestion grows.

Services in this template

  • langfuse-worker · image langfuse/langfuse-worker:4.56.0
  • Redis · image redis:8.2
  • Postgres · image ghcr.io/railwayapp-templates/postgres-ssl:18
  • ClickHouse · from baranberkay96/langfuse-railway
  • langfuse-web · from baranberkay96/langfuse-railway

Questions people ask

How do I log in?

Enter your email in LANGFUSE_INIT_USER_EMAIL when deploying. After langfuse-web is healthy (first start runs migrations and can take several minutes), sign in with that email and the generated LANGFUSE_INIT_USER_PASSWORD from the langfuse-web variables, then change the password. The SDK keys are LANGFUSE_INIT_PROJECT_PUBLIC_KEY and LANGFUSE_INIT_PROJECT_SECRET_KEY.

Which Railway plan do I need?

Hobby or Pro. langfuse-web needs at least 1.5 GB of memory, so Trial (1 GB per service) and Free (0.5 GB) cannot run it; it stops with a JavaScript heap out of memory error.

Is my data kept across redeploys?

Yes. ClickHouse, Postgres and Redis each use a volume, and raw events, media and exports go to the Railway Bucket. Traces and login survive a redeploy of the database services.

How do I upgrade or let teammates sign up?

Web and worker are pinned to 4.56.0 and must be upgraded to the same version: change the image tag in the langfuse-web Dockerfile and on langfuse-worker, check the Langfuse changelog, and redeploy. Migrations run on web start. To let invited teammates create accounts, set AUTH_DISABLE_SIGNUP to false temporarily.

What is the licence?

Langfuse core is MIT. Code under its ee directories uses the Langfuse enterprise licence and is not enabled by this template. ClickHouse is Apache-2.0. This is a community template, not affiliated with Langfuse.

Full template README

Deploy and Host Langfuse with Railway

Langfuse is an open-source LLM engineering platform for tracing, evaluating and cost-tracking LLM applications and agents. This community template deploys the complete Langfuse v4 stack on Railway: web app, background worker, ClickHouse, Postgres, Redis and a Railway Bucket, with the first organization, project, API keys and admin account created automatically.

About Hosting Langfuse

Self-hosted Langfuse v4 is not a single container. The web service receives traces from the Langfuse SDKs, OpenTelemetry or integrations such as LiteLLM and stores each raw event in S3-compatible storage. A separate worker turns those events into rows in ClickHouse, the analytical database that powers the trace explorer, dashboards and full-text search. Postgres stores users, projects, prompts and API keys, and Redis carries the job queues and caches. This template wires all of it together over Railway's private network, generates every secret, keeps ClickHouse tuned for a small footprint and uses a Railway Bucket for event, media and export storage, so you get a production-shaped deployment without editing configuration files.

Common Use Cases

  • Trace every LLM call, tool call and agent step in production, with latency, token usage and cost per request.
  • Version and deploy prompts from a central prompt registry, then compare prompt versions with datasets and experiments.
  • Run LLM-as-a-judge and human annotation workflows to score answer quality over time.
  • Keep LLM telemetry inside your own infrastructure for data-residency or compliance reasons.
  • Act as the observability backend for an LLM gateway such as LiteLLM.

Dependencies for Langfuse Hosting

  • Langfuse web (langfuse/langfuse) and worker (langfuse/langfuse-worker) images, version 4.56.0
  • ClickHouse 26.8 LTS (Langfuse v4 needs 25.12 or newer)
  • PostgreSQL (Railway Postgres 18)
  • Redis (Railway Redis 8.2)
  • S3-compatible object storage (Railway Bucket)

Deployment Dependencies

Implementation Details

Service Role Public Storage
langfuse-web UI, public API, OTLP endpoint, migrations (upstream image plus a start script that sizes the Node heap) Yes (port 3000) –
langfuse-worker Queue processing, evaluations, exports No –
ClickHouse Traces, observations, scores No Volume /var/lib/clickhouse
Postgres Users, projects, prompts, keys No Volume
Redis Queues and cache No Volume
Bucket Raw events, media, batch exports – Railway Bucket

First login

  1. Enter your email in LANGFUSE_INIT_USER_EMAIL when deploying (the only required input).
  2. Wait for langfuse-web to become healthy (first start runs database migrations and can take several minutes).
  3. Open the web domain and sign in with that email and the generated LANGFUSE_INIT_USER_PASSWORD from the langfuse-web variables. Change the password in your profile.
  4. Use LANGFUSE_INIT_PROJECT_PUBLIC_KEY and LANGFUSE_INIT_PROJECT_SECRET_KEY with LANGFUSE_HOST=https://{your-web-domain} in the Langfuse SDKs. Langfuse v4 accepts traces from v4 SDKs and OpenTelemetry (/api/public/otel); the legacy /api/public/ingestion endpoint only takes scores.

Public sign-up is disabled (AUTH_DISABLE_SIGNUP=true). To let invited teammates create accounts, set it to false, invite them, and switch it back once they have joined.

Plans and memory: use the Hobby or Pro plan. langfuse-web needs at least 1.5 GB of memory (its live heap is about 720 MB right after start), so Railway's Trial (1 GB per service) and Free (0.5 GB) plans cannot run it: web stops with "JavaScript heap out of memory" and the log says why. When a service is limited to 2 GB or less, a start script sets the Node heap to 75% of the limit, because Node's default is too small there; LANGFUSE_NODE_HEAP_MB overrides it.

Scaling: add replicas to langfuse-worker for higher ingestion throughput and to langfuse-web for more API/UI traffic; both are stateless. ClickHouse scales vertically (more RAM/CPU) on Railway.

Pinning and upgrades: web and worker are pinned to 4.56.0; always upgrade both to the same version. Change the image tag in services/langfuse-web/Dockerfile (tag and digest) and on langfuse-worker, check the Langfuse changelog for breaking changes, and redeploy; migrations run automatically on web start. ClickHouse is pinned in services/clickhouse/Dockerfile.

Why Deploy Langfuse on Railway?

Railway runs the five services and the bucket as one project with private networking, generated secrets, volumes and per-second usage billing, so you can operate a full Langfuse v4 stack without managing servers or Kubernetes. Scaling the worker or web service is a replica setting, and upgrades are an image tag change.

Guides for this template

View Langfuse v4 LLM Observability Stack on railway.com

Similar templates

TemplateCategoryDeploymentsDeploys
9Router
Self-hosted AI router for Claude, Gemini, Cursor & OpenAI tools.
AI/ML9,734
flowise-railway
Flowise - low-code LLM apps builder
AI/ML8,512
LibreChat
Open-source ChatGPT clone: multi-model, agents, search, multi-user auth
AI/ML6,762
Hermes Agent by Nous Research
Template for Hermes Agent by Nous Research
AI/ML6,413
OpenClaw
[Homebrew support] The AI that actually does things
AI/ML5,167
Hermes Agent
Self Host Hermes Agent. Autonomous AI agent w/ self-improving, tools & more
AI/ML4,092