LLM Backup Setup Guide - ajgillis04/GillisDockerDepot GitHub Wiki
A tiny container that copies OpenWebUI Setup Guide (WSL2 Docker)'s chats, settings and uploads every night, from the Docker volume where Open WebUI keeps them to a folder on another drive.
Open WebUI's data lives in a Docker volume for speed. On Windows/WSL 2 that volume is inside WSL's virtual disk, which an ordinary file backup of your Windows drives doesn't see. This puts a copy somewhere your normal backups do.
compose/server2/llm-backup.yaml:
services:
llm-backup:
container_name: llm-backup.${HOST_NAME}
image: python:3.13.9-alpine
command: ["python3", "-u", "/backup.py"]
environment:
TZ: ${TZ}
BACKUP_HOUR: "4"
KEEP_COPIES: "14"
network_mode: none
volumes:
- openwebui_data:/data:ro
- ${DOCKERDIR}/_backups/openwebui:/backup
- ${COMPOSE_DIR}/openwebui/backup.py:/backup.py:ro
restart: always-
network_mode: none: it needs no network at all. - The data volume is mounted read-only.
-
backup.pycopies the SQLite database with SQLite's own backup API (safe while Open WebUI is running), plus the uploads folder, and keeps the last 14 nightly database copies.
- The vector store (search indexes for knowledge bases): it can be rebuilt by re-indexing.
- Models: download them again.
- Stop Open WebUI.
- Copy the chosen
webui-<date>.dbback into the volume aswebui.db, and the uploads folder back into place. - Start Open WebUI, then re-index any knowledge bases.
docker logs llm-backup.<host>
ls -la /path/to/appdata/_backups/openwebui