Skip to content

LLM Backup Setup Guide

Andy Gillis edited this page Nov 17, 2026 · 3 revisions

LLM Backup Setup Guide

Introduction

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

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.py copies 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.

What's Not Backed Up

  • The vector store (search indexes for knowledge bases): it can be rebuilt by re-indexing.
  • Models: download them again.

Restoring

  1. Stop Open WebUI.
  2. Copy the chosen webui-<date>.db back into the volume as webui.db, and the uploads folder back into place.
  3. Start Open WebUI, then re-index any knowledge bases.

Checking It

docker logs llm-backup.<host>
ls -la /path/to/appdata/_backups/openwebui

Clone this wiki locally