
Deploy Langfuse Prompt Management
Versioned LLM prompts with labels, rollback and tracing
Redis
Just deployed
/data
ClickHouse
Just deployed
/var/lib/clickhouse
langfuse-web
Just deployed
langfuse-worker
Just deployed
Just deployed
/var/lib/postgresql/data
langfuse-bucket
Bucket
Just deployed
Deploy and Host self hosted Langfuse Prompt Management (Open-Source Prompt Versioning) on Railway
Langfuse Prompt Management takes prompts out of your codebase: every edit becomes an immutable version, labels decide what production serves, and the SDK fetches it at runtime. This template runs the full Langfuse v3 stack, so prompts, traces and per-version metrics live in one self-hosted, MIT-licensed place.
About Hosting Langfuse Prompt Management open-source software on Railway (self hosted Langfuse prompt management template)
The template deploys six services. Prompts, versions, labels and config live in Postgres. langfuse-web serves the UI and the public prompts API on port 3000, with Redis as a server-side prompt cache. The worker ingests traces into ClickHouse 24.8, and a Railway Storage Bucket replaces MinIO for raw events and media. Shipping a prompt means moving the production label, not pushing code.
Why Deploy Langfuse Prompt Management, the PromptLayer alternative on Railway (Railway Free Trial)
PromptLayer is a closed-source SaaS registry, so your prompt text lives on someone else's servers. Self-hosted Langfuse gives you versions, movable labels, SDK caching, versioned config, a playground and trace-linked metrics, and prompts stay in your Railway project.
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 Prompt Management 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 Prompt Management self hosting
| Provider | Langfuse self-hosting experience |
|---|---|
| DigitalOcean | Compose on a Droplet; you handle ClickHouse volumes, HTTPS and Spaces or MinIO. |
| AWS | ECS or EKS plus RDS, ElastiCache, S3 and a self-run ClickHouse. Lots of wiring. |
| Hetzner | Cheap and solid, but bare. Docker, DNS, certs, backups and upgrades are yours. |
Common Use Cases for hosted Langfuse Prompt Management
- Prompt deploys without code deploys: move
productionfrom version 3 to 4 in the UI, and move it back if replies get worse. - Model config in the prompt: keep
model,temperature,max_tokens,response_formatand tools in each version'sconfigJSON. - Tenants and A/B splits: custom labels like
staging,tenant-aorprod-b, fetched withget_prompt("support", label="tenant-a"). - Per-version metrics: link the prompt to a generation and its Metrics tab shows latency, tokens, cost and scores by version.
- Non-engineers editing prompts: product people iterate in the UI and playground.
Dependencies for Langfuse Prompt Management Docker hosted on Railway
All six services are required even if prompts are all you care about; v3 web won't run without Postgres, Redis, ClickHouse and the bucket. Secrets are generated per deploy with ${{secret()}}. The one first-deploy chore: restart the worker once after web finishes migrations.
Deployment Dependencies for Managed Langfuse Prompt Management Service (Prompt Versioning)
- langfuse-web:
langfuse/langfuse:3, port 3000, UI plus the API your SDK calls for prompts. - langfuse-worker:
langfuse/langfuse-worker:3, port 3030, trace ingestion and evals. - Postgres: prompts, versions, labels, users, API keys.
- Redis: prompt cache and ingestion queue, via
REDIS_CONNECTION_STRINGwith?family=0for Railway's IPv6 network. - ClickHouse: traces and scores linked to prompt versions, volume
/var/lib/clickhouse. - Railway Storage Bucket: S3-compatible raw events and media.
Implementation Details for Langfuse Prompt Management (Using Langfuse official docker images)
Key variables: DATABASE_URL, the CLICKHOUSE_* set with CLICKHOUSE_CLUSTER_ENABLED=false, LANGFUSE_S3_EVENT_UPLOAD_*, LANGFUSE_S3_MEDIA_UPLOAD_*, SALT, ENCRYPTION_KEY (64 hex), NEXTAUTH_SECRET, NEXTAUTH_URL. On a cache miss the API reads Redis, then Postgres. Playground provider keys are LLM connections added under Project Settings, encrypted at rest with ENCRYPTION_KEY, so keep that value stable.
How does Langfuse Prompt Management compare against other prompt management tools
Langfuse vs LangSmith Prompt Hub
- License: Langfuse core is MIT. LangSmith is closed source and self-hosts only on Enterprise.
- Deploy model: Langfuse labels are pointers you move; no label in the request means
production.
Langfuse vs PromptLayer
- Hosting: PromptLayer is SaaS. Langfuse keeps prompt text in your own Postgres.
- Config: Langfuse versions model parameters, schemas and tools alongside the prompt text.
Langfuse vs Agenta
- Both open source: Agenta is an LLMOps platform with a prompt playground and evals.
- Langfuse's edge: ClickHouse-backed tracing plus SDK caching and fallbacks for runtime fetches.
Langfuse vs prompts in Git
- Cadence: Git prompts need a PR, merge and deploy. A label move reaches apps in about a minute.
- Metrics: Git can't show cost or scores per version. Langfuse links every generation to its prompt version.
- Review: Git has PR review built in. In Langfuse, use the version diff view and decide who may move
production.
How to use Langfuse Prompt Management (the OSS prompt management platform)?
- Sign up on the web domain, create a project, and set
LANGFUSE_PUBLIC_KEY,LANGFUSE_SECRET_KEYandLANGFUSE_HOSTin your app. - Create a prompt in the UI or with
langfuse.create_prompt(name="support", type="text", prompt="Help a {{plan}} customer: {{question}}", labels=["production"]). Text or chat type can't change later. - Fetch with
prompt = langfuse.get_prompt("support"), which servesproduction. Passlabel="staging"orversion=3instead, never both (that's a 400). A missing label returns 404 with no silent fallback. - Fill variables with
prompt.compile(plan="pro", question=q). Reuse shared text with@@@langfusePrompt:name=tone|label=production@@@, and insert chat history with message placeholders. - Link it:
start_as_current_observation(as_type="generation", name="answer", prompt=prompt)in Python. - Ship: save a new version, check the diff, move
productionin the UI or withupdate_prompt(name="support", version=4, new_labels=["production"]). Roll back the same way.
How to self host Langfuse Prompt Management on other VPS Services (Langfuse self hosting guide)
Upstream's Docker Compose file targets one VM, with no high availability.
Clone the Repository
Run git clone https://github.com/langfuse/langfuse.git && cd langfuse. docker-compose.yml sits in the root.
Install Dependencies
Install Docker and Compose. The file runs web, worker, Postgres, Redis, ClickHouse and MinIO. Expose only port 3000 through a reverse proxy with HTTPS.
Configure Environment Variables
Edit every value marked CHANGEME: database and ClickHouse passwords, a 64-hex ENCRYPTION_KEY, SALT, NEXTAUTH_SECRET and NEXTAUTH_URL set to your public URL.
Start the Langfuse Prompt Management Application
Run docker compose up -d, wait for web migrations, then docker compose restart langfuse-worker if it errored early. Open port 3000 and create your project.
Official Pricing of Langfuse Prompt Management (Langfuse pricing)
Langfuse Cloud: Hobby free (50k units/mo, 30 days, 2 users), Core $29/mo (100k units, 90 days), Pro $199/mo (3 years), Enterprise $2,499/mo. Extra units are $8 per 100k. Self-hosted MIT has no usage or seat limits. Prompt versions, labels, caching, config, the playground and experiments are all MIT. Protected prompt labels and project-level RBAC need an Enterprise license.
Langfuse Prompt Management cloud vs self hosted comparison (Pricing, features, costs, and more)
Cloud has nothing to patch, but plans cap retention and units, and prompt text sits on Langfuse's servers. Self-hosting keeps prompts in your Railway project with unlimited versions and traces; you own upgrades and backups. Without EE, anyone with member access can move production, so keep people who shouldn't ship prompts on the viewer role.
Monthly cost of self hosting Langfuse Prompt Management on Railway
Expect roughly $15-40/mo at low traffic, mostly ClickHouse memory. The $5 Railway trial covers a test deploy.
System Requirements for Hosting Langfuse Prompt Management on a VPS
Upstream suggests 4 cores, 16 GiB RAM and 100 GiB disk for a single VM. ClickHouse is the memory hog; on Railway, raise its limit first. Back up Postgres separately, since that's where every prompt version lives.
Frequently Asked Questions (FAQs)
What happens if Langfuse is down when my app fetches a prompt?
The SDK serves its cached copy, even a stale one. A process starting with an empty cache gets an error unless you pre-fetch on startup or pass a fallback prompt, so do both in production.
How fast does a label move reach production?
The default SDK cache TTL is 60 seconds, and stale prompts are served while refreshing in the background, so expect about a minute. Set cache_ttl_seconds=0 in dev with label="latest".
What's the difference between labels and versions?
Versions are immutable snapshots numbered 1, 2, 3. Labels are movable pointers: production is the default, latest tracks the newest version, and custom labels cover environments or tenants.
Can I lock the production label?
Protected prompt labels exist, but self-hosted they're an Enterprise Edition feature. In the MIT build, control it with org roles.
Does fetching prompts add latency?
Cache hits are in-memory with no network call. Langfuse's own benchmark with caching disabled averaged about 40 ms per fetch against Cloud.
Template Content
Redis
redis:8.2ClickHouse
clickhouse/clickhouse-server:24.8langfuse-web
langfuse/langfuse:3langfuse-worker
langfuse/langfuse-worker:3langfuse-bucket
Bucket
