This tutorial is a community contribution and is not supported by the Open WebUI team. It serves only as a demonstration on how to customize Open WebUI for your specific use case. Want to contribute? Check out the contributing tutorial.
Backing Up Your Instance
Nobody likes losing data!
If you're self-hosting Open WebUI, then you may wish to institute some kind of formal backup plan in order to ensure that you retain a second and third copy of parts of your configuration.
This guide is intended to recommend some basic recommendations for how users might go about doing that.
This guide assumes that the user has installed Open WebUI via Docker (or intends to do so)
Ensuring data persistence
Firstly, before deploying your stack with Docker, ensure that your Docker Compose uses a persistent data store. If you're using the Docker Compose from the Github repository that's already taken care of. But it's easy to cook up your own variations and forget to verify this.
Docker containers are ephemeral and data must be persisted to ensure its survival on the host filesystem.
Using Docker volumes
If you're using the Docker Compose from the project repository, you will be deploying Open Web UI using Docker volumes.
For Ollama and Open WebUI the mounts are:
ollama:
volumes:
- ollama:/root/.ollama
open-webui:
volumes:
- open-webui:/app/backend/data
To find the actual bind path on host, run:
docker volume inspect ollama
and
docker volume inspect open-webui
Using direct host binds
Some users deploy Open Web UI with direct (fixed) binds to the host filesystem, like this:
services:
ollama:
container_name: ollama
image: ollama/ollama:${OLLAMA_DOCKER_TAG-latest}
volumes:
- /opt/ollama:/root/.ollama
open-webui:
container_name: open-webui
image: ghcr.io/open-webui/open-webui:${WEBUI_DOCKER_TAG-main}
volumes:
- /opt/open-webui:/app/backend/data
If this is how you've deployed your instance, you'll want to note the paths on root.
Scripting A Backup Job
However your instance is provisioned, it's worth inspecting the app's data store on your server to understand what data you'll be backing up. You should see something like this:
├── audit.log
├── cache/
├── uploads/