Deploy Langfuse Observability Stack
Langfuse LLM tracing with ClickHouse, Postgres, Redis and MinIO
ClickHouse
Just deployed
langfuse-worker
Just deployed
Just deployed
Redis
Just deployed
langfuse-web
Just deployed
Just deployed
Deploy and Host Langfuse on Railway
Langfuse is the open-source LLM engineering platform for tracing, evaluating, and debugging AI applications. It captures every prompt, completion, latency, and cost, manages versioned prompts, and runs evaluations. This template deploys the full Langfuse v3 stack — web, async worker, Postgres, Redis, ClickHouse, and MinIO — pre-wired in minutes.
About Hosting Langfuse
Langfuse v3 is not a single container — it is a distributed system. The Next.js web app serves the UI and ingestion API, an async worker drains a Redis-backed BullMQ queue, ClickHouse stores high-volume trace and observation events for fast analytics, Postgres holds transactional data (projects, users, prompts), and an S3-compatible object store (MinIO) buffers raw event batches. Self-hosting this by hand means provisioning four backing stores, generating a 256-bit hex encryption key, keeping shared secrets identical across web and worker, running ClickHouse in single-node mode, and configuring Redis with a no-eviction policy so queued jobs are never dropped. This template wires all six services over Railway's private network and generates every secret for you, so the only post-deploy step is creating your first account.
Common Use Cases
- Production LLM tracing — capture every prompt, tool call, completion, latency, and token cost across providers
- Prompt management — version, label, and A/B test prompts, then fetch them at runtime via the SDK
- Evaluation pipelines — score model outputs with LLM-as-judge or custom evaluators and track regressions over time
- Cost and usage analytics — break down spend by model, user, and feature from the ClickHouse-backed dashboards
- Debugging agentic apps — inspect nested spans of multi-step agents and RAG chains to find where they go wrong
Dependencies for Langfuse Hosting
- PostgreSQL 12+ — transactional store for projects, users, API keys, and prompts (provisioned by this template)
- Redis 7 — BullMQ queue and cache, run with
--maxmemory-policy noeviction(provisioned by this template) - ClickHouse 24.x — columnar analytics store for traces and observations, single-node (provisioned by this template)
- MinIO — S3-compatible object storage for buffering raw ingestion event batches (provisioned by this template)
Deployment Dependencies
- Langfuse GitHub repository
- Langfuse self-hosting documentation
- Langfuse configuration reference
- langfuse/langfuse Docker image
- langfuse/langfuse-worker Docker image
Implementation Details
All inter-service connections use Railway reference variables, and the three security-critical settings are pre-applied:
DATABASE_URL = ${{Postgres.DATABASE_URL}}
REDIS_CONNECTION_STRING = ${{Redis.REDIS_URL}}
CLICKHOUSE_URL = http://${{ClickHouse.RAILWAY_PRIVATE_DOMAIN}}:8123
LANGFUSE_S3_EVENT_UPLOAD_ENDPOINT = http://${{MinIO.RAILWAY_PRIVATE_DOMAIN}}:9000
ENCRYPTION_KEY = ${{secret(64, "abcdef0123456789")}} # 64 HEX chars, not alphanumeric
CLICKHOUSE_CLUSTER_ENABLED = false # single-node on Railway
langfuse-worker references NEXTAUTH_SECRET, SALT, and ENCRYPTION_KEY from langfuse-web so the two app services always share identical secrets. Redis is started with --maxmemory-policy noeviction so queued jobs are never silently evicted. Media upload (LANGFUSE_S3_MEDIA_UPLOAD_*) is deferred because it needs a browser-reachable public MinIO endpoint; event upload runs entirely over the private network.
Why Deploy Langfuse on Railway?
Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.
By deploying Langfuse on Railway, you get a six-service distributed observability stack — web, worker, Postgres, Redis, ClickHouse, and MinIO — wired together over private networking with persistent volumes and generated secrets, instead of hand-assembling a docker-compose file. Host your servers, databases, AI agents, and more on Railway.
Template Content
ClickHouse
clickhouse/clickhouse-server:25.12langfuse-worker
langfuse/langfuse-worker:4.38.0Redis
redis:7.4.2-alpinelangfuse-web
langfuse/langfuse:4.38.0
