Deploy LangWatch | Open Source LangSmith Alternative for Agent Testing
Self-hosted LangWatch: LLM tracing, evals, guardrails and agent testing
LangWatch
Just deployed
Just deployed
/data
ClickHouse
Just deployed
/var/lib/clickhouse
Just deployed
Postgres
Just deployed
/var/lib/postgresql/data
LangEvals
Just deployed
Workers
Just deployed
Storage
Bucket
Just deployed
Deploy and Host LangWatch on Railway
LangWatch is an open-source platform for testing and monitoring LLM applications and AI agents: tracing, evaluations and guardrails, datasets, prompt management, agent simulations and the Optimization Studio. This template runs the complete self-hosted stack in one click, on the same images upstream ships in its own Docker Compose file and Helm chart.
About Hosting LangWatch
LangWatch is not a single container. The application needs a background worker, two sidecar services and three datastores, and this template wires all of them together over Railway's private network:
- LangWatch — the web app and API (port 5560). It runs the PostgreSQL and ClickHouse migrations on every boot, after waiting for both databases to accept connections, and is the only service with a public domain.
- Workers — the same image running the background worker: trace processing, evaluations, topic clustering, alerts and scheduled jobs.
- NLP — the Go engine behind the Optimization Studio and workflow execution.
- LangEvals — the Python evaluators and guardrails (PII detection, language detection, LLM-as-judge and more).
- PostgreSQL 18 — users, organizations, projects, prompts and settings, on a volume.
- ClickHouse — traces, spans, evaluations and analytics, on a volume. This is upstream's own
clickhouse-serverlessimage, which sizes its memory limits and thread pools fromCH_CPUandCH_RAM. - Valkey — the job queue, with a generated password and an append-only file on a volume, so queued work survives a restart.
- Storage bucket — a Railway object storage bucket for datasets and stored objects, instead of the container's local disk.
Every image is pinned to a full version (LangWatch 3.17.0), so a redeploy months from now installs exactly what was tested rather than whatever latest has become.
Common Use Cases
- Tracing LLM apps and agents: send traces from the Python or TypeScript SDK, OpenTelemetry, LangChain, LangGraph, Vercel AI SDK, DSPy and many more.
- Evaluations and guardrails: run evaluators on production traffic or as real-time guardrails, including PII detection, off-topic, jailbreak and LLM-as-judge checks.
- Agent testing: simulate conversations with your agent before it reaches users, and track regressions over time.
- Datasets and experiments: build datasets from real traces, run batch evaluations and compare prompts and models.
- Keeping data in-house: prompts, completions and user data stay on infrastructure you control.
Dependencies for LangWatch Hosting
Deployment Dependencies
- LangWatch documentation: https://docs.langwatch.ai
- Self-hosting guide: https://docs.langwatch.ai/self-hosting/overview
- Source code: https://github.com/langwatch/langwatch
Implementation Details
Getting started. Open the public domain of the LangWatch service, create your account and your first project, and copy the project's API key. Then point the SDK at your deployment:
export LANGWATCH_API_KEY="sk-lw-..."
export LANGWATCH_ENDPOINT="https://your-langwatch-domain.up.railway.app"
LLM provider keys (OpenAI, Anthropic, Azure and others) are set per project under Settings → Model Providers, and are encrypted at rest with CREDENTIALS_SECRET.
Sign-up is open. LangWatch has no setting to turn off self-registration. Anyone who finds your URL can create an account and their own organization on your deployment. They cannot see your organization's data, but they do use your resources. Create your own account right after deploying, and do not publish the URL if the deployment is private. For a locked-down instance, configure SSO (Auth0, Azure AD, Okta, Cognito, OneLogin or any OIDC provider) with NEXTAUTH_PROVIDER — see the upstream SSO guide.
Secrets. All secrets are generated on deploy. CREDENTIALS_SECRET is an AES-256 key and must stay exactly 64 hexadecimal characters: LangWatch decodes it as hex and refuses anything that is not 32 bytes, and a value of the wrong shape breaks every save of an API key or project secret. Do not change it after deploying — values already encrypted with it can no longer be read.
Resources and cost. Measured on this template at idle: about 4.5 GB of RAM across the seven services — LangEvals 1.5 to 1.9 GB depending on which evaluators have been loaded, the app about 1 GB, ClickHouse about 800 MB, the worker about 700 MB, PostgreSQL about 60 MB, NLP and Valkey a few tens of MB. Expect roughly $45–55 per month at idle on Railway's usage pricing, growing with trace volume and evaluator use. LangEvals runs one worker process (CPU_COUNT=1); each extra worker adds about 1.8 GB, so raise it only if evaluations queue up. ClickHouse is sized by CH_CPU and CH_RAM (2 CPUs, 4 GiB by default); raise both for large trace volumes.
Email. Invitations and password reset need an email provider. Set SENDGRID_API_KEY, or EMAIL_PROVIDER with the SMTP_* variables, on the LangWatch and Workers services. Without one, add teammates by having them sign up.
Telemetry. Anonymous usage statistics are turned off (DISABLE_USAGE_STATS=true). Remove the variable to send them to the LangWatch team.
Upgrading. The LangWatch, Workers, NLP and LangEvals images come from one release and must be moved together to the same version. Read the release notes first: the app migrates both databases on boot.
Why Deploy LangWatch 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 LangWatch 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.
Template Content
LangWatch
langwatch/langwatch:3.17.0ClickHouse
langwatch/clickhouse-serverless:0.4.0Postgres
postgres:18.6-alpineLangEvals
langwatch/langevals:3.17.0Workers
langwatch/langwatch:3.17.0Storage
Bucket
