---
title: "Deploy Langfuse v3"
description: "Langfuse v3 (LLM Tracing, Evals & Prompt Management) Self Host"
category: "AI/ML"
url: https://railway.com/deploy/langfuse-v3-1
---

# Deploy Langfuse v3

Langfuse v3 (LLM Tracing, Evals & Prompt Management) Self Host

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

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

- **Creator:** onepush
- **Category:** AI/ML

## Template content

### langfuse-web

- **Image:** langfuse/langfuse:3
- **Public domain:** Yes

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

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

### ClickHouse

- **Image:** clickhouse/clickhouse-server:24.8

### Redis https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg

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

### langfuse-worker

- **Image:** langfuse/langfuse-worker:3

## Buckets

- **langfuse-bucket**

## Documentation

# Deploy and Host self hosted Langfuse v3 (Open-Source LLM Observability) on Railway

Langfuse v3 is the open-source stack for LLM tracing, evals, and prompt management. This guide covers the full self-hosted deploy on Railway: web, worker, Postgres, Redis, ClickHouse, and S3-compatible storage, so you get production observability without LangSmith pricing.

## About Hosting Langfuse v3 open-source software on Railway (self hosted Langfuse template)

Langfuse runs as Docker images plus supporting services: web UI and API, async worker, Postgres for metadata, Redis for queues, ClickHouse for traces, and a Railway Storage Bucket instead of MinIO. Railway's private network links them. The core repo is MIT licensed, so self-hosting has no usage fees, and you decide where prompts live and how long traces are kept.

## Why Deploy Langfuse v3, the LangSmith alternative on Railway (Railway Free Trial)

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 v3 on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.

### Railway vs Other Hosting Providers and VPS for Langfuse v3 self hosting

| Provider | Key differences for Langfuse v3 self-hosting | Best use case |
|---|---|---|
| DigitalOcean | Manual Docker Compose on one Droplet. You manage ClickHouse, Redis, S3, networking. | Small experiments, full control. |
| AWS | Full ECS/EKS with RDS, ElastiCache, S3; complex and costly idle ClickHouse. | Teams in AWS with compliance. |
| Hetzner | Cheap VPS. Install Docker, reverse proxy, MinIO, backups yourself. No managed ClickHouse. | Budget self-hosters who don't mind sysadmin. |

## Common Use Cases for hosted Langfuse v3

- **LLM tracing:** Capture prompts, completions, token counts, latency, cost.
- **Evaluation pipelines:** Run datasets and LLM-as-judge evals, compare prompt versions by score.
- **Prompt management:** Version prompts in UI, fetch by name/version from SDK, roll back without redeploy.
- **Self-hosted compliance:** Keep LLM data in your Railway project. No third-party SaaS stores your prompts or completions.

## Dependencies for Langfuse v3 Docker hosted on Railway

The stack has six services. Postgres stores users, projects, API keys, prompts. Redis queues jobs. ClickHouse holds traces, observations, scores. Railway Storage Bucket handles raw events and media. Langfuse web and worker run the app and async ingestion.

### Deployment Dependencies for Managed Langfuse v3 Service (LLM Observability)

- **langfuse-web:** `langfuse/langfuse:3`, port 3000. UI and API. Writes batches to S3, queues Redis refs.
- **langfuse-worker:** `langfuse/langfuse-worker:3`, port 3030. Consumes Redis, loads S3 batches, inserts ClickHouse, runs evals.
- **Postgres:** Transactional metadata. Set `DATABASE_URL` to internal connection string.
- **Redis:** Queue and cache. Use `REDIS_CONNECTION_STRING` with `?family=0` for Railway IPv6.
- **ClickHouse 24.8:** Columnar analytics. Volume at `/var/lib/clickhouse`. Set `CLICKHOUSE_URL`, `CLICKHOUSE_MIGRATION_URL`, `CLICKHOUSE_USER`, `CLICKHOUSE_PASSWORD`, `CLICKHOUSE_CLUSTER_ENABLED=false`.
- **Railway Storage Bucket:** S3-compatible. Configure `LANGFUSE_S3_EVENT_UPLOAD_*` and `LANGFUSE_S3_MEDIA_UPLOAD_*`. No MinIO.

### Implementation Details for Langfuse v3 (Using Langfuse official docker images)

Web receives SDK events, writes raw batches to S3, queues Redis refs. Worker downloads batches, inserts into ClickHouse. Secrets generated per deploy with `${{secret()}}`: `SALT`, `ENCRYPTION_KEY` (64 hex), `NEXTAUTH_SECRET`, `NEXTAUTH_URL`. On first deploy, web runs migrations. Worker may fail once before tables exist; restart worker after web is healthy.

## How does Langfuse v3 compare against other LLM observability platforms

### Langfuse vs LangSmith

- **License:** Langfuse core MIT, free self-host. LangSmith closed source, self-host only on Enterprise.
- **Architecture:** Both tracing, evals, prompt management.
- **Cost:** Self-hosted Langfuse costs only infra. LangSmith charges per trace and user, no free self-host.

### Langfuse vs Helicone

- **Focus:** Langfuse full observability with evals and prompt management. Helicone proxy/gateway-first.
- **Ingestion:** Langfuse uses SDK or OpenTelemetry. Helicone intercepts LLM calls at network layer, no code changes.
- **Self-host:** Both open source. Langfuse heavier (ClickHouse, Redis, Postgres, S3). Helicone self-host also uses ClickHouse and Postgres and suits teams who want zero SDK changes.

### Langfuse vs Arize Phoenix

- **License:** Langfuse MIT. Phoenix source-available Elastic License 2.0, restricts managed service.
- **Standard:** Langfuse own SDK and OpenTelemetry. Phoenix leans on OpenTelemetry/OpenInference.
- **Storage:** Langfuse ClickHouse plus S3. Phoenix runs as one container on SQLite or Postgres, lighter to host but less suited to very high volume.

### Langfuse vs Opik

- **License:** Langfuse MIT, Opik Apache 2.0. Both free self-host.
- **Backend:** Langfuse ClickHouse for high-volume analytics. Opik also uses ClickHouse, with MySQL and a Java backend; similar weight to host.
- **Features:** Langfuse prompt management, evals, mature SDK. Opik is strong on evals and CI test suites; pick by SDK fit.

## How to use Langfuse v3 (the OSS LLM observability platform)?

1. **Sign up and create keys:** Open the public langfuse-web domain, create the first user, an organization, and a project, then copy the public and secret API keys.
2. **Instrument:** Install the Python or JS/TS SDK, or use the OpenAI SDK, LangChain, LlamaIndex, or LiteLLM integrations. Set `LANGFUSE_PUBLIC_KEY`, `LANGFUSE_SECRET_KEY`, and `LANGFUSE_HOST` to your Railway URL.
3. **View traces:** Send a test request. Open UI to see input, output, tokens, latency, cost.
4. **Create prompts:** Define versioned templates in UI. Call `langfuse.get_prompt("name")` in code. Update without redeploy.

## How to self host Langfuse v3 on other VPS Services (Langfuse v3 self hosting guide)

For a single VPS, use Docker Compose. Minimum 4 cores, 16 GiB RAM, 100 GiB disk. The official Compose file targets a single VM with no HA.

### Clone the Repository

Run `git clone https://github.com/langfuse/langfuse.git && cd langfuse`. The main branch is v3 and includes `docker-compose.yml` for web, worker, Postgres, Redis, ClickHouse, MinIO. Replace MinIO with any S3 endpoint on a VPS.

### Install Dependencies

Install Docker and Compose. Expose only port 3000 through Caddy or Nginx with HTTPS; keep 3030, Postgres, Redis, and ClickHouse off the public interface.

### Configure Environment Variables

Edit the environment block in `docker-compose.yml` (every value marked CHANGEME). Set `DATABASE_URL`, `REDIS_CONNECTION_STRING` (`redis://redis:6379?family=0` if IPv6), `CLICKHOUSE_URL=http://clickhouse:8123`, `CLICKHOUSE_MIGRATION_URL=clickhouse://clickhouse:9000`, `CLICKHOUSE_USER`, `CLICKHOUSE_PASSWORD`, generate 64-hex `ENCRYPTION_KEY`, set `NEXTAUTH_SECRET`, `SALT`, and S3 upload vars.

### Start the Langfuse v3 Application

Run `docker compose up -d`. Web runs migrations on first boot; watch `docker compose logs -f langfuse-web`, then `docker compose restart langfuse-worker` if it errored early. Open `http://your-vps-ip:3000` to create admin and project.

## Official Pricing of Langfuse v3 (Langfuse v3 pricing)

Langfuse Cloud: Hobby free (50k units/mo, 30 days, 2 users). Core $29/mo (100k units, 90 days). Pro $199/mo (3 years, higher rate limits; SSO and project RBAC sit in a $300/mo Teams add-on). Enterprise $2,499/mo (audit logs, SCIM, SLAs). Extra units $8 per 100k. Self-hosted OSS has no usage limits or per-seat fees; pay only infrastructure.

## Langfuse v3 cloud vs self hosted comparison (Pricing, features, costs, and more)

Cloud is faster to start and has no ClickHouse or backups to run, but retention is capped by plan and cost scales with units. At a few million units a month, Core plus overage passes a typical Railway stack. Self-hosting on Railway gives unlimited traces and users, full retention control, no extra fees.

### Monthly cost of self hosting Langfuse v3 on Railway

At low traffic, the six-service stack costs roughly $15 to $40 per month. Railway bills per second for CPU, RAM, volume storage, and egress, so the bill tracks real trace volume. ClickHouse is usually the largest line item. The $5 Railway trial is enough to deploy, send test traces, and see the usage graph before committing.

### System Requirements for Hosting Langfuse v3 on a VPS

Official docs recommend 4 cores, 16 GiB RAM, 100 GiB disk for single-node. Smaller boxes work until ClickHouse hits memory pressure. Back up Postgres and the ClickHouse volume separately. On Railway, watch ClickHouse memory in the metrics tab and raise its limit before raising web or worker.

## Frequently Asked Questions (FAQs)

### Is Langfuse v3 really free to self-host?

Yes. Core repo is MIT. Full stack, no license key, no usage limits. `ee` folders need paid license, but OSS includes tracing, evals, prompts, core APIs.

### Why does the worker need a restart after first deploy?

Web runs migrations on startup. Worker may start before tables exist and fail. Restart worker after web is healthy; one-time step.

### Can I use the Railway Storage Bucket instead of MinIO?

Yes. Bucket is S3-compatible. Set `LANGFUSE_S3_EVENT_UPLOAD_*` and `LANGFUSE_S3_MEDIA_UPLOAD_*` to endpoint, access key, secret. No MinIO container.

### What's the difference between the web and worker images?

Web serves UI and API on port 3000. Worker runs async ingestion and evals on port 3030.

### Does Langfuse v3 support OpenTelemetry?

Yes. Native OTLP support. Langfuse exposes an OTLP endpoint and maps spans onto traces and observations.


## Similar templates

- [Chat Chat](https://railway.com/deploy/-WWW5r) — Chat Chat, your own unified chat and search to AI platform.
- [stella](https://railway.com/deploy/stella) — Self-host stella with web, API, Postgres, Redis, and object storage.
- [Hermes Agent | OpenClaw Alternative with Dashboard](https://railway.com/deploy/hermes-agent-or-openclaw-alternative-wit) — Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

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