---
title: "Deploy LiteLLM Agent Control Plane"
description: "One control plane and UI for OpenCode, Hermes and Claude agents"
category: "AI/ML"
url: https://railway.com/deploy/litellm-agent-control-plane
---

# Deploy LiteLLM Agent Control Plane

One control plane and UI for OpenCode, Hermes and Claude agents

**[Deploy LiteLLM Agent Control Plane on Railway](https://railway.com/template/litellm-agent-control-plane)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/litellm-agent-control-plane/manifest.json

- **Creator:** My Projects
- **Category:** AI/ML

## Template content

### LiteLLM Agent Control Plane https://raw.githubusercontent.com/LiteLLM-Labs/litellm-agent-control-plane/main/src/ui/src/app/icon.svg

- **Source:** LiteLLM-Labs/litellm-agent-control-plane
- **Start command:** `sh -c 'export ANTHROPIC_API_KEY="${ANTHROPIC_API_KEY:-}"; printf "%s" "$LAP_CONFIG" > /app/railway.config.yaml && exec lite serve --config /app/railway.config.yaml'`
- **Health check:** /health
- **Public domain:** Yes

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

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

## Documentation

# Deploy and Host LiteLLM Agent Control Plane on Railway

[LiteLLM Agent Control Plane](https://github.com/LiteLLM-Labs/litellm-agent-control-plane) (LAP) is one place to create, run and manage AI agents across runtimes such as Claude Managed Agents, OpenCode, Hermes, OpenClaw, Deep Agents and the Cursor Agents API. It gives your team a single web UI and API for agents, persistent sessions, cron schedules, memory, MCP tools and an Anthropic/OpenAI compatible LLM gateway.

## About Hosting LiteLLM Agent Control Plane

This template runs the control plane itself (web UI + API) backed by Postgres:

- **LiteLLM Agent Control Plane**: built from the official repository's Dockerfile (Rust server + Next.js UI), listening on port 4000 behind a public HTTPS domain, health check on `/health`.
- **Postgres**: Railway's standard Postgres service with a persistent volume. It stores agents, sessions, schedules and the encrypted provider and runtime credentials.
- **Generated secrets**: `LITELLM_MASTER_KEY` (admin login and API bearer key) and `LITELLM_SALT_KEY` (encrypts stored credentials).
- **Auth**: every API route requires the master key (`Authorization: Bearer` or `x-api-key`); the UI asks for it at sign-in.

**After deploy:**

1. Open the service's **Variables** tab and copy `LITELLM_MASTER_KEY`.
2. Open `https://YOUR-RAILWAY-DOMAIN` and sign in with that key.
3. Go to **Settings** and add your Anthropic API key (and any other providers). Runtimes such as Claude Agents read their credentials from Settings, not from environment variables.
4. To use self-hosted runtimes (OpenCode, Hermes, Deep Agents, OpenClaw), deploy them separately from the repo's `templates/` folder and register each one as a runtime in the UI (or with `POST /api/runtime-harnesses` using the master key).

## Common Use Cases

- Give a team one UI to create, run and monitor agents without handing out Anthropic or Bedrock console access.
- Run agents on a cron schedule with persistent sessions and memory.
- Switch the same agent between runtimes (Claude Managed Agents, OpenCode, Hermes, Deep Agents).
- Use the built-in `/v1/messages` and `/v1/responses` gateway for Claude Code, Codex and other tools behind one master key.

## Dependencies for LiteLLM Agent Control Plane Hosting

- Source: [LiteLLM-Labs/litellm-agent-control-plane](https://github.com/LiteLLM-Labs/litellm-agent-control-plane) (MIT), built from its root Dockerfile (no official prebuilt image is published).
- Postgres 16+.
- An Anthropic API key (`ANTHROPIC_API_KEY`), entered at deploy time. OpenAI and other provider keys can be added later in Settings.

### Deployment Dependencies

- [LiteLLM Agent Control Plane on GitHub](https://github.com/LiteLLM-Labs/litellm-agent-control-plane)
- [Documentation](https://docs.litellm-agent-platform.ai)
- [Deployment guide](https://github.com/LiteLLM-Labs/litellm-agent-control-plane/blob/main/deployment.md)
- [Anthropic API keys](https://console.anthropic.com/settings/keys)

### Implementation Details

- The gateway config lives in the `LAP_CONFIG` variable (single-line JSON, which is valid YAML). The start command writes it to a file at boot and runs `lite serve`. The default has an `anthropic/*` wildcard route using `ANTHROPIC_API_KEY` plus a `gpt-5.5` route whose key comes from Settings; edit `LAP_CONFIG` to add models. Keys stored in Settings take precedence over the environment key. Every `os.environ/NAME` in the config must exist as a variable, or boot fails.
- `LITELLM_SALT_KEY` is generated separately from the master key, so you can rotate `LITELLM_MASTER_KEY` without losing the stored, encrypted provider credentials. Do not change `LITELLM_SALT_KEY` after first use.
- `DATABASE_URL` references the Postgres service over Railway's private network; `LITELLM_PUBLIC_BASE_URL` is set to the service's public domain so MCP proxy URLs point at the public address.
- The first build compiles Rust from source and can take several minutes.
- The optional agent runtimes and the docker-compose `register-*` sidecars are not included; register runtimes after deploy as described above.

## Why Deploy LiteLLM Agent Control Plane 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 LiteLLM Agent Control Plane 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.

## 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/litellm-agent-control-plane
