Open WebUI Tutorial: ChatGPT-Like UI for Local Models
Why you need a real UI for your local models
Ollama turned "run a model locally" into a two-word command, and that's wonderful. But past the honeymoon phase, the terminal starts to chafe: no searchable chat history, no clean way to share prompts, no document chat, no multi-user setup. Open WebUI fills exactly that gap. It's a self-hosted, ChatGPT-style web interface — conversation history, model switching, document upload with built-in RAG, voice input/output, and an admin panel — that talks to the models already running on your machine. Nothing leaves your network unless you configure it to.
The project is one of the most successful open-source AI interfaces ever built, with over 156,000 GitHub stars as of October 2026. This tutorial gets it running against Ollama in about 30 minutes: Docker install, the connection step most guides botch, power features worth turning on, and the fixes for the three errors everyone hits.
Source: Open WebUI official docs (docs.openwebui.com)
What you'll need
- Docker installed and running (Docker Desktop on macOS/Windows, or Docker Engine on Linux).
- Ollama installed on the same host, with at least one model pulled. If you haven't set this up yet, see our 20-minute Ollama guide first.
- A few gigabytes of free disk space for the Open WebUI image (the standard
:mainimage is about 1.6 GB).
How the pieces fit together
The architecture is simple: your browser talks to an Open WebUI Docker container on port 3000, and the container reaches Ollama's API on the host machine through Docker's special host.docker.internal hostname. Ollama never has to be exposed to the internet — the only bridge is between the container and the host.
Source: NewsCarpenter
Step 1: Make sure Ollama is serving a model
Open WebUI is just a frontend; Ollama does the actual inference. Confirm it's alive and has a model ready:
curl http://localhost:11434
ollama list
ollama pull qwen3:8b
Any model works — qwen3:8b is a solid default on modest hardware. If you're unsure which model to pick for your use case, our open-model head-to-head compares the current heavyweights.
Step 2: Launch Open WebUI in Docker
The official quick start uses a one-liner. Generate a secret key first, then run the container (per the official docs):
openssl rand -hex 32
docker run -d -p 3000:8080 \
--add-host=host.docker.internal:host-gateway \
-v open-webui:/app/backend/data \
-e WEBUI_SECRET_KEY=your-secret-key \
--name open-webui \
--restart always \
ghcr.io/open-webui/open-webui:main
What the flags do: -p 3000:8080 exposes the UI at http://localhost:3000; -v open-webui:/app/backend/data persists your chats, users, and settings in a named volume so upgrades don't wipe anything; --restart always brings the container back after a reboot; and --add-host=host.docker.internal:host-gateway is the critical one — it lets the container reach Ollama on the host. Skip it and the UI will boot fine but see no models.
The secret key deserves emphasis: set it once and keep it. Without a fixed WEBUI_SECRET_KEY, a recreated container generates a new key, which logs every user out and breaks OAuth and encrypted tokens. Write it down somewhere safe.
Step 3: Sign up and start chatting
Open http://localhost:3000. The first account you create automatically becomes the admin. You should see your Ollama models in the model selector at the top of the chat box. If the list is empty, go to Settings > Admin > Connections and set the Ollama URL to http://host.docker.internal:11434, then refresh.
Step 4: Turn on the features that matter
A plain chat box barely scratches the surface. The three features worth enabling immediately:
- Document RAG. Click the
+in the chat box and upload PDFs, Markdown, or text files, then chat with them — Open WebUI ships with bundled embedding models, so retrieval works out of the box. For a from-scratch RAG build with full control, our Ollama + Qdrant RAG tutorial goes deeper. - Alternative backends. Open WebUI talks to any OpenAI-compatible API. In Settings > Connections you can add vLLM (
http://host.docker.internal:8000/v1), LM Studio, or even the OpenAI API with a key. If you're choosing between serving stacks, our vLLM vs Ollama vs llama.cpp vs SGLang comparison lays out the trade-offs. - Per-conversation controls. Click the model name in the chat header to adjust temperature, top-p, and context length per conversation, and use the prompt library to save reusable system prompts.
Step 5: No-Docker and GPU options
Prefer pip? Open WebUI installs as a package on Python 3.11 or 3.12 (pip install open-webui, then open-webui serve) and serves on port 8080, expecting Ollama at localhost:11434. Docker remains the recommended route — updates are a single docker pull.
For NVIDIA GPUs, swap the image tag to :cuda and add --gpus all to the docker run command (the NVIDIA Container Toolkit must be installed). Need Ollama running on a different machine instead? Point Open WebUI at it with -e OLLAMA_BASE_URL=http://192.168.1.100:11434 — and remember Ollama only accepts remote connections when its OLLAMA_HOST is set to 0.0.0.0.
Troubleshooting the three classic errors
1. "No models available" in the UI. The container can't reach Ollama. On Docker Desktop (macOS/Windows) host.docker.internal works out of the box; on Linux it doesn't exist unless you add it — hence the --add-host=host.docker.internal:host-gateway flag in the official command. As a belt-and-suspenders fix, set the URL explicitly under Settings > Admin > Connections.
2. Logged out after recreating the container. You forgot the WEBUI_SECRET_KEY. Recreate the container with a fixed key (and ideally keep it in a .env file rather than your shell history).
3. Remote Ollama refuses connections. Two fixes: Open WebUI gets OLLAMA_BASE_URL pointing at the server's IP, and the Ollama server gets OLLAMA_HOST=0.0.0.0 so it binds beyond localhost.
Closing
Ollama solved local inference; Open WebUI solves the last mile — a genuinely pleasant, private interface your whole team can use without touching a cloud API. One Docker command, one connection URL, and your open models finally have the front end they deserve. Next up, try uploading your documentation corpus and chatting with it: that's the moment local AI stops being a demo and starts being infrastructure.


Comments
Post a Comment