updating.mdx 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. ---
  2. sidebar_position: 300
  3. title: "🔄 Updating Open WebUI"
  4. ---
  5. ## Why isn't my Open WebUI updating?
  6. 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.
  7. ### Manual Update
  8. 1. **Stop and remove the current container**:
  9. 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.)
  10. ```bash
  11. docker rm -f open-webui
  12. ```
  13. 2. **Pull the latest Docker image**:
  14. This will update the Docker image, but it won't update the running container or its data.
  15. ```bash
  16. docker pull ghcr.io/open-webui/open-webui:main
  17. ```
  18. :::info
  19. **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:
  20. 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.
  21. The data is stored in a Docker volume named `open-webui`. You can remove it with the following command:
  22. ```bash
  23. docker volume rm open-webui
  24. ```
  25. :::
  26. 3. **Start the container again with the updated image and existing volume attached**:
  27. 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**
  28. ```bash
  29. docker run -d -p 3000:8080 -v open-webui:/app/backend/data --name open-webui ghcr.io/open-webui/open-webui:main
  30. ```
  31. ## Automatically Updating Open WebUI with Watchtower
  32. You can use [Watchtower](https://containrrr.dev/watchtower/) to automate the update process for Open WebUI. Here are three options:
  33. ### Option 1: One-time Update
  34. 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**):
  35. ```bash
  36. docker run --rm --volume /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower --run-once open-webui
  37. ```
  38. ### Option 2: Running Watchtower as a Separate Container
  39. You can run Watchtower as a separate container that watches and updates your Open WebUI container:
  40. ```bash
  41. docker run -d --name watchtower \
  42. --volume /var/run/docker.sock:/var/run/docker.sock \
  43. containrrr/watchtower -i 300 open-webui
  44. ```
  45. This will start Watchtower in detached mode, watching your Open WebUI container for updates every 5 minutes.
  46. ### Option 3: Integrating Watchtower with a `docker-compose.yml` File
  47. 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**):
  48. ```yml
  49. version: '3'
  50. services:
  51. open-webui:
  52. image: ghcr.io/open-webui/open-webui:main
  53. ports:
  54. - "3000:8080"
  55. volumes:
  56. - open-webui:/app/backend/data
  57. watchtower:
  58. image: containrrr/watchtower
  59. volumes:
  60. - /var/run/docker.sock:/var/run/docker.sock
  61. command: --interval 300 open-webui
  62. depends_on:
  63. - open-webui
  64. volumes:
  65. open-webui:
  66. ```
  67. In this example, Watchtower is integrated with the `docker-compose.yml` file and watches the Open WebUI container for updates every 5 minutes.
  68. ## Persistent Data in Docker Volumes
  69. 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:
  70. ```bash
  71. docker volume inspect open-webui
  72. ```
  73. This will show you the details of the volume, including the mountpoint, which is usually located in `/var/lib/docker/volumes/open-webui/_data`.