---
title: "Deploy LiteLLM AI Gateway"
description: "Pinned LiteLLM gateway + Postgres + Redis: 100+ LLMs, keys, budgets"
category: "AI/ML"
url: https://railway.com/deploy/litellm-ai-gateway-1
---

# Deploy LiteLLM AI Gateway

Pinned LiteLLM gateway + Postgres + Redis: 100+ LLMs, keys, budgets

**[Deploy LiteLLM AI Gateway on Railway](https://railway.com/template/litellm-ai-gateway-1)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/litellm-ai-gateway-1/manifest.json

- **Creator:** talharamzan's Projects
- **Category:** AI/ML

## Template content

### LiteLLM

- **Image:** ghcr.io/berriai/litellm:v1.108.13@sha256:65a9631f79329779a3371f4bdf185c3a4a93653254743b8722c5cbd9b9dd8a65
- **Start command:** `/bin/sh -c "export NUM_WORKERS=${NUM_WORKERS:-1} UI_USERNAME=${UI_USERNAME:-admin} STORE_MODEL_IN_DB=${STORE_MODEL_IN_DB:-True} REDIS_PORT=${REDIS_PORT:-6379} LITELLM_MODE=${LITELLM_MODE:-PRODUCTION} LITELLM_LOG=${LITELLM_LOG:-ERROR} NO_DOCS=${NO_DOCS:-True} ROOT_REDIRECT_URL=${ROOT_REDIRECT_URL:-/ui}; exec /app/docker/prod_entrypoint.sh --port ${PORT:-8080}"`
- **Health check:** /health/readiness
- **Public domain:** Yes

### Postgres

- **Image:** postgres:17.11@sha256:ff87138949ad9a46f32ff23bd6852b52ce024a13dffe9b4087be98292cdd3b4f

### Redis

- **Image:** redis:8.6.8@sha256:8b30009c0de4fdb3fb67deb8afab050fe454e9b233c6a2c142ec34fcc51fa7f5
- **Start command:** `/bin/sh -c "exec docker-entrypoint.sh redis-server --requirepass \"$REDIS_PASSWORD\" --save '' --appendonly no --maxmemory 64mb --maxmemory-policy allkeys-lru"`

## Documentation

# Deploy and Host LiteLLM AI Gateway on Railway

LiteLLM is an open-source AI gateway: one OpenAI-compatible API in front of 100+ LLM providers (OpenAI, Anthropic, OpenRouter, Gemini, Bedrock, Ollama...), with virtual keys, per-key budgets, rate limits and spend tracking.

## About Hosting LiteLLM AI Gateway

This template runs the official LiteLLM proxy image **pinned by digest** (v1.108.13, after the 2026 supply-chain incidents that hit floating tags), with Postgres for keys, models and spend logs and Redis for rate-limit/budget coordination. It deploys with zero inputs: all secrets are generated for you.

## Common Use Cases

- One API key per app/team with budgets, instead of sharing provider keys
- Switch or load-balance between OpenAI, Anthropic, OpenRouter and others without code changes
- Track and cap LLM spend per key, user or team

## Dependencies for LiteLLM AI Gateway Hosting

- Postgres 17 (included, private network)
- Redis 8 (included, private network, 64 MB cap)

### Deployment Dependencies

- Upstream project: https://github.com/BerriAI/litellm
- Template repo with docs, upgrade and backup guide: https://github.com/TalhaRamzan/railway-litellm-gateway

### Implementation Details

- Admin UI at `/ui`: username `admin`, password in **LiteLLM → Variables → `UI_PASSWORD`** (separate from the master key).
- `LITELLM_SALT_KEY` encrypts stored provider keys: back it up and never change it.
- Swagger is hidden and the root URL opens the login page. Lean defaults: 1 worker. Expect roughly $9–14/month on Railway at light traffic.
- Any default (workers, log level, docs) can be overridden by adding the variable to the `LiteLLM` service.

## Why Deploy LiteLLM AI Gateway 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 AI Gateway 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.

_Unofficial community template, not affiliated with BerriAI. LiteLLM is MIT-licensed._


## 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-ai-gateway-1
