---
title: "Deploy Langfuse"
description: "Langfuse v4: LLM tracing, evals and prompts, admin and keys set at deploy"
category: "AI/ML"
url: https://railway.com/deploy/langfuse-2
---

# Deploy Langfuse

Langfuse v4: LLM tracing, evals and prompts, admin and keys set at deploy

**[Deploy Langfuse on Railway](https://railway.com/template/langfuse-2)**

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

- **Creator:** Dektion
- **Category:** AI/ML
- **Total deploys:** 2

## Template content

### Langfuse https://raw.githubusercontent.com/langfuse/langfuse/fe82bdc24d3bbaac919b20d8fe8708920a9a81a8/web/public/icon512.png

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

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

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

### Langfuse Worker https://raw.githubusercontent.com/langfuse/langfuse/fe82bdc24d3bbaac919b20d8fe8708920a9a81a8/web/public/icon512.png

- **Image:** langfuse/langfuse-worker:4.83.0
- **Health check:** /api/health

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

- **Image:** redis:7.4
- **Start command:** `/bin/sh -c 'exec redis-server --requirepass "$REDIS_PASSWORD" --maxmemory-policy noeviction --save "" --appendonly no'`

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

- **Image:** clickhouse/clickhouse-server:26.3.62.3

## Buckets

- **Traces**

## Documentation

# Deploy and Host Langfuse on Railway

[Langfuse](https://github.com/langfuse/langfuse) (MIT core) is an open-source platform for LLM engineering: tracing of every model call and agent step, evaluations, prompt management and cost tracking. This template runs Langfuse v4 (4.83.0) on Railway, the same stack as upstream's Docker Compose file, with the first user and API keys set at deploy.

## About Hosting Langfuse

Langfuse v4 is six parts: the web app (UI and API), a worker that processes events in the background, ClickHouse for traces and observations, Postgres for users and projects, Redis for queues, and S3-compatible storage. Here the storage is a Railway Bucket, so there's no MinIO service to run. Web and worker are pinned to the same release, because they share database migrations.

A fresh Langfuse lets anyone who opens it sign up. This template sets Langfuse's headless initialization instead: the deploy form asks for your email, and the first start creates your user (with the generated `LANGFUSE_INIT_USER_PASSWORD`), an organization, a project and its API key pair. Sign-up is off (`AUTH_DISABLE_SIGNUP=true`); invite teammates from the organization settings. Put `LANGFUSE_INIT_PROJECT_PUBLIC_KEY` and `LANGFUSE_INIT_PROJECT_SECRET_KEY` into your app as `LANGFUSE_PUBLIC_KEY` / `LANGFUSE_SECRET_KEY`, with `LANGFUSE_URL` as the host, and traces start arriving.

Before publishing I tested it on Railway. The public API refused requests without keys, and a sign-up attempt was refused with "Sign up is disabled". The generated keys listed the project, and the first user signed in through the web login. I sent a trace with a generation over OpenTelemetry (v4's ingestion path); the worker picked it up from the bucket and it came back from ClickHouse through the observations API. A media upload went to the Railway Bucket through Langfuse's presigned URL and read back the same bytes. Then I restarted all five services at once; afterwards the user signed in again and the trace and the media file were still there.

Langfuse is heavier than most templates. Right after the first start the whole stack used about 2 GB of RAM; half an hour later ClickHouse alone had grown to 2.8 GB (its caches), with web and worker at 0.75 GB each, and after a restart the web app briefly held 2.6 GB. Plan on 3 to 4.5 GB, roughly $30 to $45 a month on Railway's usage pricing, so it needs a Hobby plan or higher. ClickHouse keeps every trace on its 5 GB volume (the Hobby limit). Automatic data retention is an Enterprise feature when you self-host Langfuse, so with heavy tracing plan for the volume: on Railway's Pro plan it can grow to 1 TB. Langfuse v4's API serves new traces through `/api/public/v2/observations`; the older v3 traces endpoint reads legacy tables.

## Common Use Cases

- Tracing an AI agent in production: every LLM call, tool call and cost in one timeline
- Managing prompts outside your code, with versions and A/B tests
- Running evaluations (LLM-as-a-judge or your own scores) on real traffic

## Dependencies for Langfuse Hosting

Your app or agent sends traces with a Langfuse SDK (Python, JS/TS) or any OpenTelemetry exporter. LLM keys are only needed for the playground and LLM-as-a-judge evaluations, set in Langfuse's UI.

### Deployment Dependencies

- Langfuse: https://github.com/langfuse/langfuse
- Self-hosting docs: https://langfuse.com/self-hosting
- Images: `langfuse/langfuse:4.83.0`, `langfuse/langfuse-worker:4.83.0`, `clickhouse/clickhouse-server:26.3.62.3`

### Implementation Details

```
LANGFUSE_URL                                   # open this; also the host for your SDKs
LANGFUSE_INIT_USER_EMAIL / _PASSWORD           # first user, created on the first start
LANGFUSE_INIT_PROJECT_PUBLIC_KEY / _SECRET_KEY # API keys for your app
AUTH_DISABLE_SIGNUP=true                       # invite teammates instead
Traces (Railway Bucket)                        # event and media storage
```

Keep `SALT` and `ENCRYPTION_KEY`: Langfuse can't verify API keys or read stored LLM credentials without them. If you add a custom domain, set `NEXTAUTH_URL` on the Langfuse service to it.

## Why Deploy Langfuse on Railway?

Your traces stay on infrastructure you control, with the whole stack (ClickHouse, Postgres, Redis, storage) wired together on Railway's private network and the first user claimed before the URL goes public. Railway bills the resources Langfuse uses, so a small team pays for a small instance.


## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [Weaviate](https://railway.com/deploy/weaviate-1) — Vector database with hybrid search and an API key-protected API
- [Möbius Personal AI OS](https://railway.com/deploy/mobius-v01-personal-ai-os) — Self-hosted AI agent that builds and runs apps for you, with memory.

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