Skip to content

How to Back Up and Restore Open WebUI (2026): Docker, SQLite and Automated Backups

6–10 minutes
Woman in a brick-walled loft holding a tablet with a BACKUP AND RESTORE card, hook never lose your chats

Everything that makes your Open WebUI instance yours, from chats and users to knowledge bases, custom models, prompts and uploaded files, lives in one data folder. If that folder is lost, so is everything else.

A backup takes a minute to set up and saves you from a bad update, a deleted Docker volume or a dead disk.

The good news is that a full backup is just a copy of one folder plus, for some installs, one secret key file. The catch is copying it the right way, because the SQLite database keeps recent writes in a side file while it runs.

This guide covers what to back up, one-command backups for Docker volumes, bind mounts and pip installs, safe SQLite backups, restoring, exporting the admin config, automated scripts with cron and rclone, a backup plan and fixes. It follows the official Open WebUI documentation as of December 2026.

TL;DR

  • Back up: the data folder (/app/backend/data in Docker): webui.db, uploads/, vector_db/.
  • Also: your WEBUI_SECRET_KEY, or the .webui_secret_key file for pip installs.
  • Docker: docker run --rm -v open-webui:/data -v $(pwd):/backup alpine tar czf /backup/openwebui-$(date +%Y%m%d).tar.gz /data
  • Safest: stop Open WebUI first, or use sqlite3 webui.db ".backup ...".
  • Not a backup: the admin Database download and Export Config.
  • Plan: keep at least two copies off the server and test a restore.

What to Back Up

Item What it holds Back up?
webui.db SQLite database: users, chats, models, prompts, settings Yes, essential
uploads/ Files users uploaded Yes
vector_db/ ChromaDB vectors for knowledge and RAG Yes (or re-index later)
cache/ Cached data Optional, can be excluded
audit.log Audit events Optional
WEBUI_SECRET_KEY or .webui_secret_key Signs sessions and decrypts stored secrets Yes

If you run Ollama in Docker too, its models live in the ollama volume (/root/.ollama). Models can be re-downloaded, so backing them up is optional. Running Ollama and Open WebUI together? See our Ollama in Docker guide.

Find Your Data Folder

  • Docker volume (default compose and run commands): -v open-webui:/app/backend/data. Find the host path with docker volume inspect open-webui.
  • Bind mount: a host path such as /opt/open-webui:/app/backend/data. Back up that host folder.
  • pip, uv or Conda: the folder in DATA_DIR. Without it, data sits inside the Python environment’s site-packages. Print the path with:
    python -c "import open_webui, pathlib; print(pathlib.Path(open_webui.__file__).resolve().parent / 'data')"

Warning for pip users: without DATA_DIR, deleting or recreating the virtual environment deletes your data. Move it out: stop Open WebUI, copy the folder somewhere safe and start with DATA_DIR=~/.open-webui open-webui serve.

Back Up a Docker Volume

  1. Stop Open WebUI so the database and its WAL file are in the same state:
    docker stop open-webui
  2. Create a compressed archive of the volume in the current folder:
    docker run --rm -v open-webui:/data -v $(pwd):/backup \
      alpine tar czf /backup/openwebui-$(date +%Y%m%d).tar.gz /data
  3. Start it again:
    docker start open-webui
  4. Copy the .tar.gz off the server, for example to a NAS or cloud bucket.
  5. Record your WEBUI_SECRET_KEY in a password manager if you set one.

Using Docker Compose? Replace the stop and start lines with docker compose down and docker compose up -d. Always back up before you update; our how to update Open WebUI guide shows the full update flow.

Back Up a Bind Mount or pip Install

  1. Stop Open WebUI (docker stop open-webui, or Ctrl+C on open-webui serve).
  2. Archive the folder:
    tar czf ~/openwebui-$(date +%Y%m%d).tar.gz -C /opt open-webui

    For pip, archive your DATA_DIR folder instead.

  3. pip only: also copy .webui_secret_key, unless you set WEBUI_SECRET_KEY. It is created in the folder you ran open-webui serve from, not in the data folder, and its path is printed at every start.
  4. Start Open WebUI again.

Safe SQLite Backups While Running

Open WebUI uses SQLite in WAL mode, so recent writes can sit in webui.db-wal rather than the main file. Copying only webui.db while it runs can miss recent data. That is also why the docs say the Database download in Settings > Database is not the recommended backup.

For a consistent copy without downtime, use SQLite’s own backup command:

sqlite3 /path/to/data/webui.db ".backup '/path/to/backups/webui.db.backup'"

For Docker, run it in a temporary container with the volume mounted:

docker run --rm -v open-webui:/data -v $(pwd):/backup alpine \
  sh -c "apk add -q sqlite && sqlite3 /data/webui.db \".backup '/backup/webui-$(date +%Y%m%d).db'\""

Back up uploads/ and vector_db/ alongside it. A common pattern is “hot” daily backups with .backup plus a weekly “cold” backup with the container stopped. Using PostgreSQL instead of SQLite? Use pg_dump; see our Open WebUI PostgreSQL guide.

Restore a Backup

  1. Stop Open WebUI: docker stop open-webui.
  2. Restore the archive into the volume. This deletes what is in the volume first, so double-check the file name:
    docker run --rm -v open-webui:/data -v $(pwd):/backup alpine \
      sh -c "rm -rf /data/* && tar xzf /backup/openwebui-YYYYMMDD.tar.gz -C /"
  3. Start the container with the same WEBUI_SECRET_KEY as before.
  4. Sign in and check chats, users, models and a knowledge base.

Restoring onto a new server works the same way: create the volume, restore into it, then start Open WebUI with your usual command.

If you restore an older backup onto a newer Open WebUI version, the database migrates forward on start; restoring onto an older version after a migration can fail. If you are locked out after a restore, see our Open WebUI password reset guide.

Export and Import Admin Config

Settings > Database (admin) has Export Config and Import Config. They copy admin settings only, so they do not replace a data backup.

  • Export downloads config-<timestamp>.json with every row of the config table, such as openai.api_base_urls or ui.banners.
  • It contains secrets in plain text: API keys, web search keys, Jupyter tokens and OAuth client secrets. Store it like a password file.
  • It leaves out users, chats, models, knowledge, files, functions and tools, plus environment-only settings like WEBUI_SECRET_KEY.
  • Import merges keys into the current settings without validation. Keys missing from the file keep their values.
  • If imported MFA settings differ, every user is signed out, and imports carrying MFA keys need an admin browser session, not an API key.

Handy for copying settings between test and production instances. Admin roles are covered in our users and groups guide.

Automate Backups With Cron and rclone

Save a script such as /opt/scripts/owui-backup.sh:

#!/bin/bash
set -e
DEST=/backups/open-webui
mkdir -p "$DEST"
STAMP=$(date +%Y%m%d-%H%M)
docker stop open-webui
docker run --rm -v open-webui:/data -v "$DEST":/backup alpine \
  tar czf /backup/openwebui-$STAMP.tar.gz --exclude=data/cache /data
docker start open-webui
# keep the newest 14 archives
ls -1t "$DEST"/openwebui-*.tar.gz | tail -n +15 | xargs -r rm --
# optional: copy off-site with rclone
# rclone copy "$DEST" remote:openwebui-backups

Make it executable with chmod +x, then schedule it at 3 AM daily with crontab -e:

0 3 * * * /opt/scripts/owui-backup.sh >> /var/log/owui-backup.log 2>&1

The official docs also show rclone scripts that sync to a Backblaze B2 bucket, use SQLite .backup plus a tar of vector_db, keep three weekly snapshots, and rsync snapshots with --link-dest for space-efficient point-in-time copies. Test every script once by hand and check the log before trusting cron.

How Many Backups Do You Need?

Do not count the running instance as a backup, even on a VPS. Two plans from the docs:

Plan Copies Schedule
Home user Primary + 2 Daily incremental to S3/B2, weekly pull to a home NAS
More robust Primary + 3 Daily to S3, daily to B2, weekly to a NAS

Consider encryption at rest, tools like restic or borgbackup, alerts on failure and a regular restore test. Host-level VM snapshots are a useful extra layer.

Troubleshooting

Restored backup is missing recent chats

The database was copied while running without its WAL file. Stop Open WebUI before copying or use .backup.

Everyone is logged out after restore

The secret key changed. Start with the original WEBUI_SECRET_KEY or restore .webui_secret_key.

Connections and API keys stopped working after restore

Stored secrets may be encrypted with the old key. Use the same secret key, or re-enter the keys.

The archive is empty or tiny

You mounted the wrong volume name. Check docker volume ls and docker inspect open-webui.

Knowledge base search returns nothing after restore

vector_db/ was not restored. Restore it or re-index the documents.

pip install lost all data

Data lived inside the deleted virtual environment. Set DATA_DIR outside it from now on.

FAQ

Where does Open WebUI store chats?

In webui.db inside the data folder, /app/backend/data in Docker.

Can I back up without stopping Open WebUI?

Yes, with sqlite3 ... ".backup" for the database, but a stopped backup is the safest.

Is the admin Database download enough?

No. It can miss recent writes and does not include uploads or vectors.

Do I need to back up Ollama models?

Optional. They can be pulled again, though large models take time to download.

How do I move Open WebUI to another server?

Back up the volume, copy the archive, restore it into a new volume and start with the same secret key.

Can users export their own chats?

Yes, from chat settings, but that is a personal export, not a server backup.

Sources

Free weekly email

Get new AI guides every week

One short weekly email with our newest local AI, ComfyUI and AI tool guides. No spam, no pop-ups, just the good stuff.

Free. Unsubscribe anytime in one click. We only use your email to send this newsletter. See our privacy policy.

Woman in a brick-walled loft holding a tablet with a BACKUP AND RESTORE card, hook never lose your chats