Jun 2, 2026 3 min read

Open WebUI + Ollama in Docker: a Local AI Chat UI

Run Open WebUI in Docker as a local ChatGPT-style UI over Ollama: the exact command, the host-gateway fix, and gotchas to skip.

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.sh

When it finishes:

$ docker --version
Docker version 29.5.2, build 79eb04c

Snag 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 $USER

But 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:main

Breaking that down:

  • -p 3000:8080 maps the container's port 8080 to port 3000 on your machine, so you reach it at http://your-host:3000.
  • --add-host=host.docker.internal:host-gateway creates a hostname the container can use to reach the host. Without this, the container cannot see Ollama, because localhost inside a container means the container itself, not your machine.
  • OLLAMA_BASE_URL tells Open WebUI where Ollama lives, using that host gateway name.
  • -v open-webui:/app/backend/data keeps your accounts, chats, and settings in a named volume so they survive container restarts.
  • --restart always brings 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/tcp

Watch 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/
200

A 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-webui

To 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 above

Takeaways

  • 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-gateway paired with OLLAMA_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 use sudo docker until you do.
  • Use a named volume and --restart always so it survives reboots and upgrades cleanly.
J
Great! You’ve successfully signed up.
Welcome back! You've successfully signed in.
You've successfully subscribed to LLMbits.
Your link has expired.
Success! Check your email for magic link to sign-in.
Success! Your billing info has been updated.
Your billing was not updated.