Ollama + Open WebUI Operations: Installation, Persistence, Backup, Upgrade & Safe Restore
Pin exact container image tags, map host bind mounts for SQLite & vector stores, run a 10-second pre-upgrade snapshot, and practice full rollback.
Linux HomeLab (Ubuntu 24.04 · Docker Compose v2.29) & macOS Host + Docker WebUI
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.
- 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`).
1. Directory Layout & Version-Pinned Docker Compose
| Host Bind Path | Container Path | Stored Assets | Backup Strategy |
|---|---|---|---|
| ./tinker-local-ai-data/open-webui/webui.db | /app/backend/data/webui.db | Users, chat history, system prompts, knowledge metadata | Stop container & tar before every version upgrade |
| ./tinker-local-ai-data/open-webui/vector_db | /app/backend/data/vector_db | ChromaDB local vector embeddings & uploads | Included in open-webui data snapshot |
| ./tinker-local-ai-data/ollama/models | /root/.ollama/models | GGUF model blobs & custom Modelfile manifests | Exclude blobs from daily tar; back up manifests only |
# [Step 1] Stop WebUI container cleanly to flush SQLite WAL journal docker compose stop open-webui # [Step 2] Create timestamped backup of chats, users, prompts & vector DB tar -czf openwebui-state-$(date +%F-%H%M).tar.gz ./tinker-local-ai-data/open-webui # [Step 3] Upgrade image tag in docker-compose.yml and start docker compose up -d # [Step 4] Emergency Rollback if the new version fails: docker compose stop open-webui rm -rf ./tinker-local-ai-data/open-webui tar -xzf openwebui-state-2026-10-23-0900.tar.gz # Revert image tag in docker-compose.yml, then: docker compose up -d
2. Auditing Outbound Connections for True Offline Operation
3. Online SQLite `.backup` API vs Cold Tar Snapshot Integrity
Frequently Asked Questions & Edge Cases
Q: Why does Open WebUI hang for 60 seconds on startup when I unplug my ethernet cable?
By default, Open WebUI probes `https://api.openai.com/v1/models` on startup to populate its model dropdown. Set `ENABLE_OPENAI_API=false` and `OFFLINE_MODE=true` in your container environment variables to eliminate the timeout.
Q: What happens if I lose or change `WEBUI_SECRET_KEY` during container recreation?
`WEBUI_SECRET_KEY` signs all active JWT login sessions and encrypted credentials. If it changes on container restart, all logged-in users are immediately signed out with `401 Unauthorized`. Pin a static secret string in your `docker-compose.yml`.
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.
# 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