Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Ollama Open WebUI

Ollama Open WebUI

Open WebUI is a user-friendly AI interface (supporting Ollama, OpenAI API, etc.).

Open WebUI supports multiple language model runners (such as Ollama and OpenAI-compatible APIs) and has a built-in inference engine for retrieval-augmented generation (RAG), making it a powerful AI deployment solution.

Open WebUI allows customizing the OpenAI API URL to connect to LMStudio, GroqCloud, Mistral, OpenRouter, etc.

Open WebUI administrators can create detailed user roles and permissions to ensure a secure user environment while providing a customized experience.

Open WebUI supports desktops, laptops, and mobile devices, and provides a progressive web app (PWA) on mobile devices with offline access.


Installation

Open WebUI offers multiple installation methods, including via Python pip, Docker, Docker Compose, Kustomize, and Helm.

Quick start with Docker

If Ollama is already installed on your computer, use the following command:



docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:main

Run Open WebUI with Nvidia GPU support:



docker run -d -p 3000:8080 --gpus all --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:cuda

Bundled installation of Open WebUI and Ollama

This installation method uses a single container image bundling Open WebUI with Ollama, easily set up with one command.

Choose the appropriate command based on your hardware configuration.

Enable GPU support:



docker run -d -p 3000:8080 --gpus=all -v ollama:/root/.ollama -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:ollama

CPU only:



docker run -d -p 3000:8080 -v ollama:/root/.ollama -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:ollama

Both commands help simplify the installation process and let Open WebUI and Ollama run seamlessly.

After installation, you can use Open WebUI by visiting http://localhost:3000 .

Updating Open WebUI

Manual update

Manually update the Docker container with Watchtower:



docker run --rm -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower --run-once open-webui

Automatic updates

Automatically update the container every 5 minutes:



docker run -d --name watchtower --restart unless-stopped -v /var/run/docker.sock:/var/run/docker.sock containrrr/watchtower --interval 300 open-webui

**Note:** if your container has a different name, replace open-webui with your container name.


Manual Installation

There are two main methods to install Open WebUI: using the uv runtime manager or Python's pip.

Using uv is recommended because it simplifies environment management and reduces potential conflicts.

Install with uv (recommended)

macOS/Linux:



curl -LsSf https://astral.sh/uv/install.sh | sh

Windows:



powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

Running Open WebUI

After installing uv, running Open WebUI is straightforward.

Use the following command, making sure to set the DATA_DIR environment variable to avoid data loss.

macOS/Linux:



DATA_DIR=~/.open-webui uvx --python 3.11 open-webui@latest serve

Windows:



$env:DATA_DIR="C:\open-webui\data"; uvx --python 3.11 open-webui@latest serve

Install via pip

Open WebUI can be installed via Python's package installer pip; before starting, make sure you are using Python 3.11 to avoid possible compatibility issues.

Open your terminal and run the following command to install Open WebUI:



pip install open-webui

After installation, you can start Open WebUI with the following command:



open-webui serve

After starting, the Open WebUI server runs at http://localhost:8080, and you can use Open WebUI by visiting that address in a browser.