---
title: "Deploy Langfuse Observability Stack"
description: "Langfuse LLM tracing with ClickHouse, Postgres, Redis and MinIO"
category: "Observability"
url: https://railway.com/deploy/langfuse-observability-stack
---

# Deploy Langfuse Observability Stack

Langfuse LLM tracing with ClickHouse, Postgres, Redis and MinIO

**[Deploy Langfuse Observability Stack on Railway](https://railway.com/template/langfuse-observability-stack)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/langfuse-observability-stack/manifest.json

- **Creator:** Protemplate
- **Category:** Observability
- **Total deploys:** 7

## Template content

### ClickHouse https://devicons.railway.app/i/clickhouse.svg

- **Image:** clickhouse/clickhouse-server:25.12
- **Start command:** `bash -c "echo '<clickhouse><listen_host>::</listen_host></clickhouse>' > /etc/clickhouse-server/config.d/listen.xml && exec /entrypoint.sh"`

### langfuse-worker https://avatars.githubusercontent.com/u/134601687?v=4

- **Image:** langfuse/langfuse-worker:4.38.0

### MinIO https://devicons.railway.app/i/minio.svg

- **Image:** quay.io/minio/minio:RELEASE.2025-03-12T18-04-18Z
- **Start command:** `/bin/sh -c "mkdir -p /data/langfuse && exec minio server /data --address :9000 --console-address :9001"`

### Redis https://devicons.railway.app/i/redis.svg

- **Image:** redis:7.4.2-alpine
- **Start command:** `/bin/sh -c "rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --maxmemory-policy noeviction --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH"`

### langfuse-web https://avatars.githubusercontent.com/u/134601687?v=4

- **Image:** langfuse/langfuse:4.38.0
- **Health check:** /api/public/health
- **Public domain:** Yes

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:17

## Documentation

# 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](https://github.com/langfuse/langfuse)
- [Langfuse self-hosting documentation](https://langfuse.com/docs/deployment/self-host)
- [Langfuse configuration reference](https://langfuse.com/docs/deployment/configuration)
- [langfuse/langfuse Docker image](https://hub.docker.com/r/langfuse/langfuse)
- [langfuse/langfuse-worker Docker image](https://hub.docker.com/r/langfuse/langfuse-worker)

### 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.


## Similar templates

- [Rootprint](https://railway.com/deploy/rootprint-1) — Open-source logs and traces with full-text search on object-storage.
- [Pyroscope profiling](https://railway.com/deploy/pyroscope-profiling) — Protected continuous profiling with durable Pyroscope storage.
- [SigOnly](https://railway.com/deploy/sigonly) — Deploy SigNoz with a working demo app & config in one click

Open this page in a browser: https://railway.com/deploy/langfuse-observability-stack
