Deploy Langfuse CrewAI

Trace CrewAI crews, agents and tool calls in Langfuse

Deploy Langfuse CrewAI

Just deployed

/var/lib/clickhouse

/var/lib/postgresql/data

Just deployed

Just deployed

Just deployed

/data

langfuse-bucket

Bucket

Just deployed

Deploy and Host self hosted Langfuse CrewAI (Open-Source Tracing for CrewAI Crews) on Railway

Self-hosted Langfuse on Railway for Python teams tracing CrewAI crews.

About Hosting Langfuse CrewAI open-source software on Railway (self hosted Langfuse tracing for CrewAI crews template)

Every kickoff, agent, task and tool call from your CrewAI crew lands in a Langfuse instance in your own Railway project, so trace data stays on your infrastructure.

The template runs langfuse-web, langfuse-worker, Postgres, Redis, ClickHouse and a Railway Storage Bucket.

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

If you want CrewAI traces without shipping every kickoff, agent and tool call to a vendor's cloud, self hosting Langfuse on Railway is the honest route.

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 CrewAI 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 CrewAI self hosting

Self-hosted Langfuse for CrewAI is six services including ClickHouse, so hosting choice matters.

ProviderWhat You Get with RailwayWhat You Get with the Other Provider
DigitalOceanOne-click template deploys web, worker, Postgres, Redis, ClickHouse and bucket, with secrets generated.A droplet you manage, so you install Docker, wire compose and handle upgrades.
AWSNo VPC, IAM or load balancer setup, and the S3-compatible bucket is provisioned for you.Finer networking and scaling control, but you assemble ECS, RDS, ElastiCache and S3 yourself.
HetznerManaged wiring and private networking without touching the host OS.Cheap hardware with generous specs, but you own patching, backups and ClickHouse setup.

Railway trades some low-level control for a faster path to a working Langfuse instance.

Common Use Cases for hosted Langfuse CrewAI

  • Debugging a researcher agent's handoffs: When a researcher agent's task output lands in the wrong downstream agent, the span tree shows exactly which task fed which agent, so you can fix the prompt or the task wiring without guessing from logs.
  • Timing slow tool calls inside a crew run: Tool call spans sit under their parent agent and task, so you can see which search or scraping tool is dragging a kickoff out and whether the latency is the tool or the model.
  • Tracking per-user token usage across kickoffs: Tagging each run with a user or session ID lets you total token spend per customer across many crew kickoffs.
  • Keeping crew traces in-house: Running Langfuse on your own Railway services means prompts, outputs and tool payloads stay on your infrastructure instead of a hosted agent platform.
  • Building eval datasets from real runs: Captured crew runs can be turned into datasets for regression testing, so your evals reflect actual agent behavior rather than hand-written cases.

Dependencies for Langfuse CrewAI Docker hosted on Railway

This template runs the full Langfuse stack on Railway, so your CrewAI process only needs one public endpoint: langfuse-web on port 3000.

Deployment Dependencies for Managed Langfuse CrewAI Service (LLM Observability)

  • langfuse-web: image langfuse/langfuse:3, public, port 3000, serves the UI and API.
  • langfuse-worker: image langfuse/langfuse-worker:3, port 3030, ingests batches into ClickHouse.
  • Postgres: holds transactional data such as projects and API keys.
  • Redis: the queue linking web to worker.
  • ClickHouse 24.8: stores traces, observations and scores at /var/lib/clickhouse.
  • Railway Storage Bucket: S3-compatible storage for raw events and media.

Implementation Details for Langfuse CrewAI (Using Langfuse official docker image)

Set DATABASE_URL, REDIS_CONNECTION_STRING (with ?family=0 for Railway private IPv6), CLICKHOUSE_URL, CLICKHOUSE_MIGRATION_URL, CLICKHOUSE_USER, CLICKHOUSE_PASSWORD, CLICKHOUSE_CLUSTER_ENABLED=false, the LANGFUSE_S3 bucket references, SALT, ENCRYPTION_KEY, NEXTAUTH_SECRET and NEXTAUTH_URL.

How does Langfuse CrewAI compare against other ways to trace CrewAI crews

Langfuse CrewAI vs CrewAI AMP (Commercial CrewAI Platform Alternative)

  • Scope: CrewAI AMP is the commercial platform from the CrewAI team that hosts and manages crews. Langfuse only observes them, so you keep your existing crew code and runtime.
  • Hosting: AMP runs the deployment for you, which is simpler if you want one vendor. Langfuse CrewAI keeps every kickoff, agent, task and tool call on your own Railway project.
  • Where AMP wins: if you want one vendor to build, deploy and operate crews, AMP is the easier story.

Langfuse CrewAI vs LangSmith (LangChain Tracing Alternative)

  • License: LangSmith is closed source and self-hosting is Enterprise only. Langfuse's core is MIT and self-hosting the open-source build is free with no usage limits.
  • Instrumentation: the guide uses the OpenInference CrewAI instrumentor over OpenTelemetry, so the traces are vendor-neutral.
  • Where LangSmith wins: if your stack is already deep in LangChain and LangGraph, its native integration is less work.

Langfuse CrewAI vs Arize Phoenix (OpenTelemetry Observability Alternative)

  • Foundation: Phoenix is also built on OpenTelemetry and OpenInference, so the plumbing overlaps. Phoenix uses the Elastic License 2.0, while Langfuse's core is MIT.
  • Focus: Phoenix leans toward span inspection and evaluation. Langfuse adds prompt management, datasets and scores around the traces, all self hosted here.
  • Where Phoenix wins: for a lighter tool focused on inspecting spans during development, Phoenix is quick to start.

Langfuse CrewAI vs AgentOps (AI Agent Monitoring Alternative)

  • Hosting model: AgentOps is primarily a hosted observability service for agent apps. Langfuse CrewAI gives you similar agent visibility on infrastructure you control.
  • Data location: with AgentOps your session data lives on their side. With Langfuse, the worker writes traces into ClickHouse on your own Railway services.
  • Where AgentOps wins: if you want session replays and a hosted dashboard with nothing to run, it asks far less of you than a six-service stack.

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

  1. Open the project settings page on your Langfuse instance and copy the public and secret keys.
  2. In your shell, set LANGFUSE_PUBLIC_KEY, LANGFUSE_SECRET_KEY and LANGFUSE_BASE_URL to your langfuse-web public domain, not cloud.langfuse.com.
from openinference.instrumentation.crewai import CrewAIInstrumentor
from langfuse import get_client
from crewai import Agent, Task, Crew

CrewAIInstrumentor().instrument(skip_dep_check=True)
langfuse = get_client()
print("Authenticated:", langfuse.auth_check())

agent = Agent(role="Researcher", goal="Summarize the index", backstory="Reads docs.")
task = Task(description="Summarize how the index is built.", expected_output="Three sentences.", agent=agent)
crew = Crew(agents=[agent], tasks=[task])

with langfuse.start_as_current_observation(as_type="span", name="crewai-index-trace"):
    result = crew.kickoff()

print(result)
langfuse.flush()

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

This path suits a VM you run yourself instead of Railway.

Clone the Repository

Grab the official repo and move into it.

git clone https://github.com/langfuse/langfuse.git
cd langfuse

Install Dependencies

Docker and the Compose plugin must be on the host.

docker --version
docker compose version

Plan for 4 cores, 16 GiB RAM and 100 GiB disk, since ClickHouse is the heavy part.

Configure Environment Variables

Generate real secrets rather than reusing sample values.

openssl rand -hex 32   # SALT, NEXTAUTH_SECRET
openssl rand -hex 32   # ENCRYPTION_KEY

Point LANGFUSE_BASE_URL in your CrewAI shell at the same public address.

Start the Langfuse CrewAI Application

Bring the containers up and check that web and worker are healthy.

docker compose up -d
docker compose ps

Open your-domain, create the project, and copy its keys.

Railway handles the wiring, secrets, and volumes for you, which is the part you otherwise maintain yourself.

Official Pricing of Langfuse CrewAI (Langfuse pricing)

Langfuse self hosting is free and open source, with no usage limits on the OSS build.

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

Langfuse Cloud bills by units, so the cost climbs with every crew kickoff, agent step and tool call you trace.

Monthly cost of self hosting Langfuse CrewAI on Railway

Railway is usage based, and this six-service stack with ClickHouse runs roughly $15 to $40 per month at low traffic.

System Requirements for Hosting Langfuse CrewAI on a VPS

The official self-host guidance for a single VM is 4 cores, 16 GiB RAM and 100 GiB disk.

Frequently Asked Questions (FAQs)

Do I still need the CrewAI AMP dashboard?

No, traces land in your own Langfuse.

Why are spans missing after a short script?

Usually the process exited before the client flushed its buffer.

How do I tag user_id and session_id on a crew run?

Wrap the kickoff in propagate_attributes(user_id=..., session_id=..., tags=[...]).

Are agents, tasks and tool calls all captured?

Yes, the instrumentor emits spans for crew.kickoff(), agents, tasks and tool calls.

Will it work when CrewAI changes versions?

The upstream install is unpinned, so a new CrewAI release could change span output.


Template Content

More templates in this category

View Template
Chat Chat
Chat Chat, your own unified chat and search to AI platform.

okisdev
117
View Template
NEW
Weaviate
Vector database with hybrid search and an API key-protected API

zer0person
1
View Template
Möbius v0.1 Personal AI OS
Self-hosted AI agent that builds and runs apps for you, with memory.

bento
1