Skip to content

Self-host LiteLLM

updated Oct 2026prices checked · Jul 2026Install verified on Ubuntu 26.04 · Oct 2026 · how we test
We earn commissions when you shop through the links below. Full disclosure →

An open-source LLM gateway: one OpenAI-compatible API in front of 100+ providers (OpenAI, Anthropic, Bedrock, Azure, Ollama and more), with virtual API keys, per-key budgets and spend tracking, routing and fallbacks, and an admin UI. It is a proxy for your apps and tools, not a chat interface.

Key facts

LicenseMIT core with proprietary enterprise modules
StackPython, FastAPI, PostgreSQL
Min RAM1024 MB
Official imageyes
Measured idle RAM610 MB
Difficulty
Our recommendation

Pick LiteLLM when several apps, teammates or tools need to call LLMs and you would rather have one OpenAI-compatible endpoint with your own keys, budgets and spend tracking than scatter provider keys everywhere. It is a gateway, not a chat interface — put it behind Open WebUI or any OpenAI-compatible client — so it is the right pick for the plumbing, and the wrong one if all you want is a chat window.

What you need

  • Any VPS with at least 1024 MB of RAM
  • A domain you control — most self-hosted setups need HTTPS in front of them
  • Under an hour if you've used Docker before
Where to host itaffiliate disclosure
Hetzner Cloudrun it on
From $23.59/mo · 2 vCPU / 4 GB / 80 GB · EU + US
Get Hetzner Cloud (opens in new tab)
Kamaterafree trial
From $4/mo · 1 vCPU / 1 GB / 20 GB · US + EU + Asia
Start free on Kamatera → (opens in new tab)
DigitalOceanalso works on
From $6/mo · 1 vCPU / 1 GB / 25 GB · US + EU + Asia
Deploy on DigitalOcean → (opens in new tab)

Paid link — we earn a commission if you shop through it.

Install

Run these commands on your server:

# LiteLLM — upstream quickstart compose (gateway + Postgres), pinned to release v1.105.0 instead of main-stable
curl -sSLo docker-compose.yml https://raw.githubusercontent.com/BerriAI/litellm/v1.105.0/docker/docker-compose.quickstart.yml
sed -i 's|litellm:main-stable|litellm:v1.105.0|' docker-compose.yml
# master key = root credential and the admin UI password; salt key encrypts provider keys stored in the DB (never regenerate it)
printf 'LITELLM_MASTER_KEY=sk-%s\nLITELLM_SALT_KEY=sk-%s\n' "$(openssl rand -hex 32)" "$(openssl rand -hex 32)" > .env
docker compose up -d  #  →  http://SERVER_IP:4000/ui  (user admin, password = LITELLM_MASTER_KEY from .env)
# port 4000 is published on all interfaces, no TLS; put a reverse proxy in front. Postgres is not published.

What you take on

LiteLLM is quick to start, but it sits in front of every model call you make, so its defaults are worth reading:

non-negotiableLITELLM_MASTER_KEY is the root credential: it authorises every management call and is the admin UI password (user admin). Treat it like a root password and keep .env out of source control.
non-negotiableLITELLM_SALT_KEY encrypts the provider API keys you add in the UI and has no in-place rotation — regenerating it makes stored credentials unreadable. Back up .env along with the Postgres volume.
non-negotiableThe quickstart publishes port 4000 on every interface with no TLS, and its Postgres uses fixed credentials (not published outside the compose network). Put a reverse proxy in front before the gateway holds real provider keys.
non-negotiableThe code is MIT except the enterprise/ directory, which has its own licence. Check that licence before relying on any feature the docs mark as enterprise.
non-negotiableThe project ships fast, with frequent releases. Pin a release tag as the install here does — the main-stable tag the upstream compose uses moves — and read the release notes before upgrading.

More in AI Chat Interfaces

We use analytics cookies (Google Analytics, PostHog) to see which guides are useful. No ad networks, no cross-site tracking. See our privacy policy.