Ollama on the command line is great, but most people want a chat window. Open WebUI gives you a clean, ChatGPT-style interface in front of your local models, and the path of least resistance is to run it in Docker. Here is the install on a fresh Debian box, the container command that actually connects to Ollama on the host, and the two snags I hit so you can skip them.
Tested with: Debian 13 (trixie), Docker 29.5.2, Open WebUI image ghcr.io/open-webui/open-webui:main, Ollama 0.24.0 already running on the host.
Install Docker
Docker's convenience script handles repositories and dependencies for you:
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.shWhen it finishes:
$ docker --version
Docker version 29.5.2, build 79eb04cSnag 1: do not install Docker and something else at the same time
I was installing Node in one terminal and Docker in another, and Docker's script died part way through:
E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 10678 (apt)
E: Unable to acquire the dpkg frontend lock, is another process using it?This is not a Docker problem. Only one apt operation can run at a time, and the two installs collided on the package lock. The fix is boring: let one finish before starting the other, then re-run the Docker script. It picks up cleanly the second time.
Snag 2: the docker group needs a fresh login
The install adds your user to the docker group so you can run Docker without sudo:
sudo usermod -aG docker $USERBut your current shell does not know about the new group until you log out and back in. If you try docker ps in the same session, you get a permission error. Either start a new SSH session, or just use sudo docker for the rest of this setup. I used sudo to keep moving.
Run Open WebUI
Here is the command that matters. The important part is letting the container reach Ollama, which is listening on the host at port 11434:
sudo docker run -d -p 3000:8080 \
--add-host=host.docker.internal:host-gateway \
-e OLLAMA_BASE_URL=http://host.docker.internal:11434 \
-v open-webui:/app/backend/data \
--name open-webui \
--restart always \
ghcr.io/open-webui/open-webui:mainBreaking that down:
-p 3000:8080maps the container's port 8080 to port 3000 on your machine, so you reach it athttp://your-host:3000.--add-host=host.docker.internal:host-gatewaycreates a hostname the container can use to reach the host. Without this, the container cannot see Ollama, becauselocalhostinside a container means the container itself, not your machine.OLLAMA_BASE_URLtells Open WebUI where Ollama lives, using that host gateway name.-v open-webui:/app/backend/datakeeps your accounts, chats, and settings in a named volume so they survive container restarts.--restart alwaysbrings it back after a reboot.
Confirm it is healthy
The image is large, so the first pull takes a minute. After that, the container reports its own health:
$ sudo docker ps --format '{{.Image}} | {{.Status}} | {{.Ports}}'
ghcr.io/open-webui/open-webui:main | Up 11 minutes (healthy) | 0.0.0.0:3000->8080/tcpWatch for the word healthy in parentheses. Right after launch it shows health: starting while the app boots; give it a moment. A quick HTTP check confirms the web server is answering:
$ curl -s -o /dev/null -w '%{http_code}' http://localhost:3000/
200A 200 means you are good. Open http://your-host:3000 in a browser, create the first account (it becomes the admin), and your local models from ollama list appear in the model dropdown automatically.
Why run it this way
You could run Open WebUI directly with Python, but Docker is worth it here for three reasons. The image bundles every dependency, so there is no virtualenv to manage. The named volume cleanly separates your data from the app, so upgrading is just pulling a newer image. And --restart always plus the host-gateway wiring means the whole thing behaves like a small appliance: reboot the box and your local AI chat is back without you touching anything.
Stopping and updating
To pause it without losing data:
sudo docker stop open-webuiTo update later, pull the newer image and recreate the container. Your data is in the volume, so nothing is lost:
sudo docker pull ghcr.io/open-webui/open-webui:main
sudo docker rm -f open-webui
# then re-run the docker run command aboveTakeaways
- Open WebUI in Docker gives you a local ChatGPT-style UI over Ollama in one command.
- The magic flag is
--add-host=host.docker.internal:host-gatewaypaired withOLLAMA_BASE_URL. That is how the container reaches Ollama on the host. - Never run two
apt-based installers at once, or you will hit the dpkg lock error. - After
usermod -aG docker, start a fresh session or usesudo dockeruntil you do. - Use a named volume and
--restart alwaysso it survives reboots and upgrades cleanly.