Deploy open-webui-litellm-template

Open WebUI + LiteLLM. BYO LLM keys. Optional Postgres.

Deploy open-webui-litellm-template

Postgres

postgres:16

Just deployed

/var/lib/postgresql/data

Just deployed

/app/backend/data

Just deployed

Deploy and Host Open WebUI + LiteLLM on Railway

Team chat over your models: Open WebUI talks only to LiteLLM. This is the ChatGPT Team replacement on c17.io/stacks/open-webui-litellm.

Provider API keys are BYO and optional. The stack boots without OPENAI_API_KEY / ANTHROPIC_API_KEY. You add keys in LiteLLM (or as optional env vars) when you want models to answer.

About Hosting Open WebUI + LiteLLM

Open WebUI is the ChatGPT-style UI. LiteLLM is an OpenAI-compatible proxy: one URL, many providers, virtual keys, spend logs. Agents (Cursor, n8n, your bots) should point at LiteLLM, not at Open WebUI.

On Railway this is three services:

ServiceSourcePublicNotes
open-webuighcr.io/open-webui/open-webuiYesPORT native. Health GET /health. Volume /app/backend/data.
litellmdocker.litellm.ai/berriai/litellm:main-stableYesSo agents can hit the proxy. Health GET /health/liveliness.
PostgresRailway pluginNoLiteLLM models, virtual keys, spend. Open WebUI stays on SQLite on the volume unless you later set DATABASE_URL.

Open WebUI is pre-wired to LiteLLM over Railway private networking. First Open WebUI signup becomes admin; then disable public signup. LiteLLM admin UI is /ui on the LiteLLM domain; password is LITELLM_MASTER_KEY.

Common Use Cases

  • Replace ChatGPT Team seats: one UI, many models, your keys
  • Shared proxy for Cursor, n8n, and bots (OPENAI_API_BASE = LiteLLM)
  • Add a local Ollama later without changing the UI (LiteLLM model row)
  • Audit prompts on a box you own instead of a vendor log

Dependencies for Open WebUI + LiteLLM Hosting

Required (wired or generated — you do not type these)

VariableServiceSource
PORTboth appsInjected. Open WebUI reads PORT. LiteLLM start: litellm --port $PORT --host 0.0.0.0 (or target port 4000).
WEBUI_SECRET_KEYopen-webuiGenerated. JWT / session secret.
WEBUI_AUTHopen-webuitrue
ENABLE_OLLAMA_APIopen-webuifalse (no host Ollama on Railway)
OPENAI_API_BASE_URLopen-webuihttp://${{litellm.RAILWAY_PRIVATE_DOMAIN}}:${{litellm.PORT}}/v1
OPENAI_API_KEYopen-webui${{litellm.LITELLM_MASTER_KEY}} (the proxy key, not OpenAI)
LITELLM_MASTER_KEYlitellmGenerated. Prefix sk-. Admin UI password.
LITELLM_SALT_KEYlitellmGenerated. Encrypts stored provider keys.
STORE_MODEL_IN_DBlitellmTrue
DATABASE_URLlitellm${{Postgres.DATABASE_URL}}

Optional — BYO provider keys

None of these are required to boot. The UI comes up with an empty model list until you add a key in LiteLLM or set one of these.

VariableRequiredWhy
OPENAI_API_KEYNoOpenAI / compatible. Set on litellm, then add the model in LiteLLM UI (os.environ/OPENAI_API_KEY).
ANTHROPIC_API_KEYNoAnthropic. Same pattern.
GEMINI_API_KEYNoGoogle Gemini. Same pattern.
AZURE_API_KEY / AZURE_API_BASENoAzure OpenAI. Same pattern.
OPEN_WEBUI_DATABASE_URLNoOnly if you move Open WebUI off SQLite. Do not reuse LiteLLM's DATABASE_URL — different schemas.

Volume

MountServiceWhy
/app/backend/dataopen-webuiUsers, chats, uploads, SQLite. Without it, the admin account resets every deploy.

LiteLLM state is in Postgres. It does not need a volume.

Why Deploy Open WebUI + LiteLLM on Railway?

ChatGPT Team is $30/user/month and you still cannot point it at last week's bench winner. This stack is a UI + a proxy. You pay Railway plus the tokens you burn. Ten seats of ChatGPT Team is the ~$3,600/year line on the c17 stack page. Trial credits cover the first deploy for most people. c17 never charges you — Railway usage is the referral / template kickback.

See TEMPLATE.md for the marketplace / composer shape.

Run locally

cp .env.example .env
# set WEBUI_SECRET_KEY, LITELLM_SALT_KEY (openssl rand -hex 32)
# set LITELLM_MASTER_KEY=sk-$(openssl rand -hex 32)
# set POSTGRES_PASSWORD
# optional: OPENAI_API_KEY / ANTHROPIC_API_KEY
docker compose up

The UI works without provider keys. Chats fail until you add a model in LiteLLM.

License

Open WebUI and LiteLLM keep their upstream licenses. This repo is config and docs only.


Template Content

Postgres

postgres:16

More templates in this category

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

okisdev
117
View Template
stella
Self-host stella with web, API, Postgres, Redis, and object storage.

Jan Kubica
7
View Template
Hermes Agent | OpenClaw Alternative with Dashboard
Self-Hosted Hermes AI Agent for Telegram, Discord & Slack

codestorm
87