Wiki-Quellcode von Open WebUI

Zuletzt geändert von René Schmidt am 2025/03/16 11:30

Verstecke letzte Bearbeiter
René Schmidt 1.1 1 = 🔄 Updating Open WebUI =
2
3 == Why isn't my Open WebUI updating? ==
4
5 To update your local Docker installation of Open WebUI to the latest version available, you can either use **Watchtower** or manually update the container. Follow either of the steps provided below to be guided through updating your existing Open WebUI image.
6
7 === Manual Update ===
8
9 1. (((
10 **Stop and remove the current container**:
11
12 This will stop the running container and remove it, but it won't delete the data stored in the Docker volume. (Replace open-webui with your container's name throughout the updating process if it's different for you.)
13 )))
14
15 {{{docker rm -f open-webui
16 }}}
17
18 1. (((
19 **Pull the latest Docker image**:
20
21 This will update the Docker image, but it won't update the running container or its data.
22 )))
23
24 {{{docker pull ghcr.io/open-webui/open-webui:main
25 }}}
26
27 info
28
29 **Remove any existing data in the Docker volume (NOT RECOMMENDED UNLESS ABSOLUTELY NECCESSARY!)**. Skip this step entirely if not needed and move on to the last step:
30
31 If you want to start with a clean slate, you can remove the existing data in the Docker volume. Be careful, as this will delete all your chat histories and other data.
32
33 The data is stored in a Docker volume named open-webui. You can remove it with the following command:
34
35 {{{docker volume rm open-webui
36 }}}
37
38 1. (((
39 **Start the container again with the updated image and existing volume attached**:
40
41 If you didn't remove the existing data, this will start the container with the updated image and the existing data. If you removed the existing data, this will start the container with the updated image and a new, empty volume. **For Nvidia GPU support, add ~-~-gpus all to the docker run command**
42 )))
43
44 {{{docker run -d -p 3000:8080 -v open-webui:/app/backend/data --name open-webui ghcr.io/open-webui/open-webui:main
45 }}}
46
47 == Keeps being logged out after every update? ==
48
49 If you find yourself getting logged out after every update, ensure that WEBUI_SECRET_KEY is set in your environment variables. Without this key being consistently defined, your authentication sessions may be invalidated after updates.
50
51 To set WEBUI_SECRET_KEY persistently, include it when running your Docker container:
52
53 {{{docker run -d -p 3000:8080 -v open-webui:/app/backend/data --name open-webui -e WEBUI_SECRET_KEY=your_secret_key ghcr.io/open-webui/open-webui:main
54 }}}
55
56 Or, if using **docker-compose**, add it under the environment section:
57
58 {{{version: '3'
59 services:
60 open-webui:
61 image: ghcr.io/open-webui/open-webui:main
62 ports:
63 - "3000:8080"
64 volumes:
65 - open-webui:/app/backend/data
66 environment:
67 - WEBUI_SECRET_KEY=your_secret_key
68 }}}
69
70 For more details on environment variable settings, check the [[Open WebUI documentation on security variables>>url:https://docs.openwebui.com/getting-started/env-configuration#security-variables]].
71
72 == Automatically Updating Open WebUI with Watchtower ==
73
74 You can use [[Watchtower>>url:https://containrrr.dev/watchtower/]] to automate the update process for Open WebUI. Here are three options:
75
76 === Option 1: One-time Update ===
77
78 You can run Watchtower as a one-time update to stop the current container, pull the latest image, and start a new container with the updated image and existing volume attached (**For Nvidia GPU support, add ~-~-gpus all to the docker run command**):
79
80 {{{docker run --rm --volume /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower --run-once open-webui
81 }}}
82
83 === Option 2: Running Watchtower as a Separate Container ===
84
85 You can run Watchtower as a separate container that watches and updates your Open WebUI container:
86
87 {{{docker run -d --name watchtower \
88 --volume /var/run/docker.sock:/var/run/docker.sock \
89 containrrr/watchtower -i 300 open-webui
90 }}}
91
92 This will start Watchtower in detached mode, watching your Open WebUI container for updates every 5 minutes.
93
94 === Option 3: Integrating Watchtower with a docker-compose.yml File ===
95
96 You can also integrate Watchtower with your docker-compose.yml file to automate updates for Open WebUI (**For Nvidia GPU support, add ~-~-gpus all to the docker run command**):
97
98 {{{version: '3'
99 services:
100 open-webui:
101 image: ghcr.io/open-webui/open-webui:main
102 ports:
103 - "3000:8080"
104 volumes:
105 - open-webui:/app/backend/data
106
107 watchtower:
108 image: containrrr/watchtower
109 volumes:
110 - /var/run/docker.sock:/var/run/docker.sock
111 command: --interval 300 open-webui
112 depends_on:
113 - open-webui
114
115 volumes:
116 open-webui:
117 }}}
118
119 In this example, Watchtower is integrated with the docker-compose.yml file and watches the Open WebUI container for updates every 5 minutes.
120
121 == Persistent Data in Docker Volumes ==
122
123 The data is stored in a Docker volume named open-webui. The path to the volume is not directly accessible, but you can inspect the volume with the following command:
124
125 {{{docker volume inspect open-webui
126 }}}
127
128 This will show you the details of the volume, including the mountpoint, which is usually located in /var/lib/docker/volumes/open-webui/_data.
129
130 On Windows 10 + WSL 2, Docker volumes are located here (type in the Windows file explorer):
131
132 * ~\~\wsl$\docker-desktop\mnt\docker-desktop-disk\data\docker\volumes
133
134 For older versions of Docker (pre-Docker v26.1.4):
135
136 * ~\~\wsl$\docker-desktop-data\data\docker\volumes
137 * ~\~\wsl$\docker-desktop-data\version-pack-data\community\docker\volumes