This repository contains automation scripts for managing OpenWebUI and pipeline components using Docker. It simplifies updates, resets, and ensures containers are healthy, especially for self-hosted setups like NAS environments.
OpenWebUI Docker Automation is a set of bash scripts designed to simplify self-hosting and container management for OpenWebUI. If you're running OpenWebUI on a NAS and using Ollama on a separate GPU-powered machine, this project provides essential automation to keep everything updated and running smoothly.
Managing Docker containers manually can be time-consuming. These scripts allow you to:
- Automatically update OpenWebUI with the latest image.
- Effortlessly reset and redeploy pipeline containers without lingering conflicts.
- Run health checks to ensure proper functionality after updates.
- Optimize container deployment for NAS-hosted environments.
This setup assumes OpenWebUI is running on a NAS, while Ollama is hosted separately on a computer with a GPU for optimized performance.
Users can modify environment variables like OLLAMA_BASE_URL
to point to their specific setup.
This script updates and restarts the OpenWebUI container in Docker. It performs these actions:
-
Pulls the latest OpenWebUI image from GitHub Container Registry.
-
Stops and removes the existing container.
-
Starts a new container with configured environment variables.
-
Runs a health check to ensure the service is running.
Variable | Description |
---|---|
CONTAINER_NAME |
Name of the OpenWebUI container in Docker (open-webui ). |
IMAGE_NAME |
Repository path for OpenWebUI’s latest image (ghcr.io/open-webui/open-webui:main ). |
HOST_PORT |
External port for OpenWebUI (default is 3000, but modified in this setup). |
CONTAINER_PORT |
Internal container port (default 3000 in OpenWebUI). |
OLLAMA_BASE_URL |
API base URL used by OpenWebUI (customizable). |
VOLUME_NAME |
Persistent volume for storing backend data. |
LOG_FILE |
Log file to track script execution steps. |
This script cleans and restarts the pipelines container. It follows these steps:
-
Stops and removes the pipelines container.
-
Deletes the old image to avoid conflicts.
-
Removes old storage volume for a clean install.
-
Pulls the latest pipelines image and deploys a new container.
-
Performs a verification check to confirm proper deployment.
Variable | Description |
---|---|
CONTAINER_NAME |
Name of the pipelines container in Docker (pipelines ). |
IMAGE_NAME |
Repository path for pipelines image (ghcr.io/open-webui/pipelines:main ). |
HOST_PORT |
External port used for pipelines (default 9099). |
CONTAINER_PORT |
Internal port used by pipelines (default 9099). |
PIPELINES_VOLUME |
Name of the volume where pipeline data is stored. |
CUSTOM_PIPELINES_URL |
Optional URL for custom pipeline scripts (default is empty). |
DB_PORT |
PostgreSQL database port (default 5432). |
PIPELINES_REQUIREMENTS_PATH |
Path to pipeline dependencies in the container (/app/pipelines/requirements.txt ). |
Make scripts executable and run:
sh
chmod +x update_openwebui.sh
./update_openwebui.sh
sh
chmod +x reset_pipelines.sh
./reset_pipelines.sh
By default, these scripts use sh
, ensuring compatibility with most Unix-based systems. However, if your setup requires additional features, or you prefer explicit Bash scripting, simply replace sh
with bash
in execution commands and script headers.
For example:
#!/bin/bash
instead of
sh
#!/bin/sh