Skip to content
Kaiov0.8.0

Open WebUI and Ollama

Ollama runs open models on your own hardware, and Open WebUI is the chat interface in front of it. Together they are the most deployed local LLM stack, and a good one to run through Kaio: the images move fast, the models are large, and the GPU is easy to lose in a typo.

services:
ollama:
image: docker.io/ollama/ollama:${OLLAMA_TAG:-latest}
restart: unless-stopped
volumes:
- ollama:/root/.ollama
deploy:
resources:
reservations:
devices:
- driver: nvidia
count: all
capabilities: [gpu]
open-webui:
image: ghcr.io/open-webui/open-webui:${OPEN_WEBUI_TAG:-main}
restart: unless-stopped
environment:
- OLLAMA_BASE_URL=http://ollama:11434
- WEBUI_SECRET_KEY=${WEBUI_SECRET_KEY}
ports:
- "127.0.0.1:3080:8080"
volumes:
- open-webui:/app/backend/data
depends_on:
- ollama
volumes:
ollama:
open-webui:
  • Ollama is not published at all: Open WebUI reaches it on the stack’s network as http://ollama:11434, and nothing else on the host can.
  • The deploy.resources.reservations.devices block hands the NVIDIA GPUs to Ollama. It needs the NVIDIA Container Toolkit on the host; without a GPU, delete the block and Ollama runs on the CPU.
  • open-webui holds the users, chats and settings, ollama the models.
OLLAMA_TAG=latest
OPEN_WEBUI_TAG=main
WEBUI_SECRET_KEY=generate-with-openssl-rand-hex-32

WEBUI_SECRET_KEY signs the sessions. Set it once and keep it: without a fixed key, every recreated container logs everyone out, and an update recreates it. Kaio flags it as a secret and keeps it in every version, so a rollback does not log anyone out either.

Terminal window
kaio-cli stack deploy llm ./compose.yml --env-file .env
kaio-cli container ls
kaio-cli container shell <ollama-container>
ollama pull llama3.2

The UI answers on http://localhost:3080. The first account created there is the administrator.

Check the GPU reached the container before blaming the model for being slow:

Terminal window
kaio-cli stack logs llm --tail 100

Ollama logs the compute devices it found when it starts.

main and latest are moving tags, and both projects release often:

Terminal window
kaio-cli stack check-update llm # compares digests, pulls nothing
kaio-cli stack update llm
kaio-cli stack scan llm

check-update asks the registry whether the digest behind each tag moved, without downloading the image: worth it here, where the images run to gigabytes. To stop following them, pin both tags with stack env set and stack apply, and a later stack rollback takes you back to the pinned pair.

Terminal window
kaio-cli stack copy llm --to gpu-02 --with-volumes --dry-run

The plan lists each volume with its size before anything is sent. The ollama volume holds every model pulled, often tens of gigabytes: copying only open-webui and pulling the models again on the other side is often faster. The destination needs its own GPU and toolkit; the copy carries the Compose file that asks for them, not the hardware.

Kaio, built by Régis Gaidot