ARTIFACT // DOCKER-COMPOSE.OLLAMA-WEBUI.YML (YAML)
Ollama + Open WebUI Persistent Stack with Backup & Rollback Safety (docker-compose.ollama-webui.yml)
Pinned versions, explicit bind-mounted volumes for 30-second backup/restore, telemetry disabled, and KV cache optimization.
[KEY VERIFIED TAKEAWAY / TL;DR]This reproducible configuration artifact "Ollama + Open WebUI Persistent Stack with Backup & Rollback Safety" (docker-compose.ollama-webui.yml, YAML) is paired with Tinker AI Lab's hardware-verified guide "ollama-openwebui-persistence-backup". It exposes 5 customizable browser variables (WEBUI_PORT=3000, OLLAMA_TAG=0.5.7, WEBUI_TAG=v0.5.10, DATA_ROOT=./tinker-local-ai-data, KV_CACHE_TYPE=q8_0) with loopback-first security defaults.
01 // HOMELABLocal AI / HomeLab· Verified: 2026-10-23
Browse All 42 Artifacts →docker-compose.ollama-webui.yml
View Paired Guide →Ollama + Open WebUI Persistent Stack with Backup & Rollback Safety
Pinned versions, explicit bind-mounted volumes for 30-second backup/restore, telemetry disabled, and KV cache optimization.
Customizable Variables (Saved in Browser)
UTF-8 Encoded · Live Client-Side Compilation
# Tinker AI Verified Stack — Ollama + Open WebUI (Guide #3)
# Pre-upgrade backup: tar -czf backup-$(date +%F).tar.gz ./tinker-local-ai-data
services:
ollama:
image: ollama/ollama:0.5.7
container_name: tinker-ollama
restart: unless-stopped
ports:
- "127.0.0.1:11434:11434"
environment:
- OLLAMA_HOST=0.0.0.0:11434
- OLLAMA_FLASH_ATTENTION=1
- OLLAMA_KV_CACHE_TYPE=q8_0
- OLLAMA_NUM_PARALLEL=2
- OLLAMA_KEEP_ALIVE=15m
volumes:
- ./tinker-local-ai-data/ollama:/root/.ollama
open-webui:
image: ghcr.io/open-webui/open-webui:v0.5.10
container_name: tinker-open-webui
restart: unless-stopped
depends_on:
- ollama
ports:
- "127.0.0.1:3000:8080"
environment:
- OLLAMA_BASE_URL=http://ollama:11434
- RAG_EMBEDDING_ENGINE=ollama
- RAG_EMBEDDING_MODEL=bge-m3:latest
- ENABLE_RAG_HYBRID_SEARCH=true
- RAG_TOP_K=5
- SCARF_NO_ANALYTICS=true
- DO_NOT_TRACK=true
extra_hosts:
- "host.docker.internal:host-gateway"
volumes:
- ./tinker-local-ai-data/open-webui:/app/backend/data
PARAMETER SPECIFICATION // 参数化变量规范说明表
Customizable Parameter Reference for docker-compose.ollama-webui.yml
This YAML artifact exposes 5 template variables compiled client-side in your browser.
| Template Token | Parameter Description | Verified Default | Example Format |
|---|---|---|---|
{{WEBUI_PORT}} | Open WebUI Host Port | 3000 | 3000 |
{{OLLAMA_TAG}} | Ollama Image Version | 0.5.7 | 0.5.7 |
{{WEBUI_TAG}} | Open WebUI Version | v0.5.10 | v0.5.10 |
{{DATA_ROOT}} | Host Backup Mount Path | ./tinker-local-ai-data | ./tinker-local-ai-data |
{{KV_CACHE_TYPE}} | KV Cache Quantization | q8_0 | f16 | q8_0 | q4_0 |
PAIRED HARDWARE MANIFEST // 配套实测环境与边界记录
Verified Environment for "Ollama + Open WebUI Operations: Installation, Persistence, Backup, Upgrade & Safe Restore"
Tested Hardware & OS
Linux HomeLab (Ubuntu 24.04 · Docker Compose v2.29) & macOS Host + Docker WebUI
Pinned Stack & Model Versions
Ollama 0.5.7Open WebUI v0.5.10SQLite 3 (webui.db)
Offline Boundary (Requires Explicit Env Vars to Disable Outbound Calls)
Set `SCARF_NO_ANALYTICS=true`, `DO_NOT_TRACK=true`, and local `RAG_EMBEDDING_ENGINE=ollama` so Open WebUI does not contact HuggingFace or analytics servers.
Known Operational Limits & Failure Modes
- Upgrading Open WebUI runs automatic Alembic schema migrations on `/app/backend/data/webui.db`; simply changing the Docker image tag back to an older version WITHOUT restoring your backup tar will fail to boot.
- Anonymous or unnamed Docker volumes are easily wiped by `docker compose down -v`; always use explicit host path bind mounts (`./tinker-local-ai-data`).
DEPLOYMENT CHECKLIST // 配置落地核验步骤
3-Step Verification Checklist After Deploying docker-compose.ollama-webui.yml
- Pinned exact version tags (`0.5.7` / `v0.5.10`) instead of `:latest` or `:main`.
- Stopped container, created a `tar.gz` backup of `open-webui` data, and verified the archive.
- Disabled unused cloud connections and set local Ollama as the embedding engine.