Local LLM Deployment

Local LLM Deployment with Docker Compose: One Command, Full Private AI Stack

Most local LLM guides stop at a single chat window on one laptop. That is fine for testing, but a small team needs more: a shared model server, a web chat interface everyone can use, and an API that other tools can call. Docker Compose turns those three pieces into one file and one command — and when the machine reboots, the whole stack comes back by itself.

FreeLast tested: 2026-11-21Audience: Small teams

Why Compose Instead of Installing Everything by Hand

A local LLM setup has three moving parts that need to agree with each other. The inference engine runs the model. The chat interface talks to the engine. The API gateway lets scripts, editors, and other apps use the same models. Installed by hand, each part has its own version, its own port, and its own way of breaking after an update. Docker Compose pins all three in one file, so the setup you test on Monday is the setup still running on Friday.

The stack in this guide is deliberately boring: Ollama runs the models, Open WebUI gives the team a ChatGPT-style web interface, and LiteLLM exposes an OpenAI-compatible API so existing tools work without rewrites. All three are free and open source, and none of them sends your prompts to a cloud provider. If you only need the engine and nothing else, our practical local LLM deployment guide for small teams covers the minimal path first.

What you get when it is done

What Hardware You Actually Need

Compose does not change the physics: a model still needs memory. What it changes is how little effort the setup takes. Pick the tier that matches the models you plan to run, not the tier you wish you had.

SetupHardwareGood for
CPU only16 GB RAM, 4 cores, 50 GB disk7–8B models at a few tokens per second; fine for drafting and summaries
One consumer GPU24 GB VRAM (e.g. RTX 3090/4090), 32 GB RAM14–32B models at comfortable speed for a team of 5–10
Small server GPU48 GB VRAM, 64 GB RAM70B-class quantized models, or several smaller models at once

Start with the smallest model that does the job — usually a 7B or 8B instruct model — and only move up when the team hits a real quality wall. A bigger model that answers slowly helps nobody. Our model comparison for budget hardware maps popular models to the memory they need, so you can size the machine before you buy anything.

The Compose File

Create a folder for the project, save this as docker-compose.yml, and change only the two passwords. The ollama service runs the models, open-webui is the chat front end, and litellm is the API gateway. A named volume called ollama-data keeps downloaded models safe across restarts and upgrades.

services: ollama: image: ollama/ollama:latest container_name: ollama restart: unless-stopped ports: - "11434:11434" volumes: - ollama-data:/root/.ollama deploy: resources: reservations: devices: - driver: nvidia count: 1 capabilities: [gpu] open-webui: image: ghcr.io/open-webui/open-webui:main container_name: open-webui restart: unless-stopped depends_on: - ollama ports: - "3000:8080" environment: - OLLAMA_BASE_URL=http://ollama:11434 - WEBUI_SECRET_KEY=change-me-to-a-long-random-string volumes: - open-webui-data:/app/backend/data litellm: image: ghcr.io/berriai/litellm:main-latest container_name: litellm restart: unless-stopped depends_on: - ollama ports: - "4000:4000" environment: - LITELLM_MASTER_KEY=change-me-to-another-random-string volumes: - ./litellm-config.yaml:/app/config.yaml command: ["--config", "/app/config.yaml", "--port", "4000"] volumes: ollama-data: open-webui-data:

Two notes before you run it. First, the GPU reservation block is optional — delete the whole deploy section if the machine has no NVIDIA GPU and Ollama will simply run on CPU. Second, the LiteLLM config file is tiny: it just lists the Ollama models you want to expose and the API key your tools will send.

# litellm-config.yaml model_list: - model_name: team-chat litellm_params: model: ollama/qwen3:8b api_base: http://ollama:11434 general_settings: master_key: change-me-to-another-random-string

Start It and Run the First Test

From the project folder, one command starts the whole stack. The first pull downloads a few gigabytes of images, so expect a couple of minutes; after that, restarts take seconds.

  1. docker compose up -d — start all three services in the background.
  2. docker compose exec ollama ollama pull qwen3:8b — download your first model (about 5 GB).
  3. docker compose exec ollama ollama run qwen3:8b "Summarize this in one sentence: local models keep data on your own hardware." — confirm the engine answers.
  4. Open http://your-server:3000, create the admin account, and send your first chat message in Open WebUI.
  5. Test the API: curl http://your-server:4000/v1/models -H "Authorization: Bearer change-me-to-another-random-string" should list team-chat.

If step 3 answers and step 4 shows the model in the web UI, the stack is working end to end. If the UI shows no models, check that Open WebUI can reach Ollama with docker compose logs open-webui — nine times out of ten it is a typo in the OLLAMA_BASE_URL or a container that has not finished starting yet.

Daily commands worth memorizing

Making It Safe for a Real Team

A stack that only you use can be loose. A stack the whole team uses needs three rules, all cheap to add now and painful to add later.

One more habit: keep a one-page note in the project folder with the model list, the admin login location, and the backup command. The person who fixes this stack at 9 pm on a Friday will not be you — or it will be you, and you will be glad the note exists.

Related reading

Limits and notes

Docker Compose is a deployment convenience, not a performance fix: it will not make a 7B model on a slow CPU fast, and it will not make a model smarter. GPU passthrough needs the NVIDIA Container Toolkit installed on the host, and Apple Silicon Macs run this stack through Docker Desktop with CPU inference only — for a Mac-first setup, see our Mac guide instead. Finally, treat model downloads as part of your disk budget: a handful of 8B models plus one 32B model easily passes 60 GB, so check disk space before pulling a new one.