The complete docker-compose.yml
This stack runs Ollama as the backend and Open WebUI as the ChatGPT-like frontend.
yaml
version: "3.8"
services:
ollama:
image: ollama/ollama:latest
container_name: ollama
volumes:
- ollama_data:/root/.ollama
restart: unless-stopped
# For NVIDIA GPU:
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
open-webui:
image: ghcr.io/open-webui/open-webui:main
container_name: open-webui
ports:
- "3000:8080"
environment:
- OLLAMA_BASE_URL=http://ollama:11434
depends_on:
- ollama
volumes:
- webui_data:/app/backend/data
restart: unless-stopped
volumes:
ollama_data:
webui_data:Start and pull a model
Bring up the stack, then pull your first model into the running Ollama container.
bash
docker compose up -d
# Open http://localhost:3000 in your browser
# Pull a model into the running container
docker exec ollama ollama pull llama3.1:8bRelated guides
IntermediateDocker9 min read
Docker: Ollama with NVIDIA GPU Passthrough
Containerised Ollama with GPU access — isolate models, pin versions, and run alongside other services.
BeginnerMac / Apple6 min read
Mac M3 Max: The Ultimate Local LLM Setup
Maximise your Apple Silicon with Ollama. Run multiple models, set up an OpenAI-compatible API, and tune Metal GPU layers.
BeginnerEdge / Local8 min read
8GB GPU Starter Guide: 3060 / 4060 / 3070
The most common local LLM hardware tier — which models, quants, and context lengths actually fit in 8GB VRAM.
Deployment guides are educational. Each model is subject to its own license — read the official Hugging Face model card before downloading or deploying.