14. Open WebUI on Windows
Open WebUI is a web-based chat interface for Ollama. It runs as a Docker container and provides a web UI with conversation history, model switching, and RAG capabilities.
Install Open WebUI:
docker run -d \
-p 3000:8080 \
-v open-webui:/app/backend/data \
-e OLLAMA_BASE_URL="http://host.docker.internal:11434" \
--name open-webui \
--restart unless-stopped \
ghcr.io/open-webui/open-webui:main
The key variable is OLLAMA_BASE_URL. host.docker.internal resolves to the Windows host's IP from inside the container. If Ollama runs natively on Windows at port 11434, this URL routes correctly. If Ollama runs inside a separate Docker container, replace host.docker.internal with the container name or the WSL2 IP address.
Access the UI at http://localhost:3000. On first launch, create an admin account. The interface shows available Ollama models in the model selector dropdown.
Common failure: The UI loads but models do not appear in the dropdown. This means Open WebUI cannot reach Ollama. Check the OLLAMA_BASE_URL value. Inside WSL2, verify the URL resolves:
curl http://host.docker.internal:11434/api/tags
If this returns a JSON list of models, the connection is fine. If it times out, Ollama is not accessible from Docker's network. Fix by restarting Ollama with explicit host binding:
# For Ollama inside WSL2 (native install)
OLLAMA_HOST=0.0.0.0 ollama serve
# For Ollama Docker container, add -p 11434:11434 to the docker run command
Reverse proxy with authentication:
To add HTTPS and basic auth in front of Open WebUI, use nginx-proxy with a docker-compose file:
version: '3.8'
services:
open-webui:
image: ghcr.io/open-webui/open-webui:main
container_name: open-webui
ports:
- "3000:8080"
environment:
- OLLAMA_BASE_URL=http://host.docker.internal:11434
volumes:
- open-webui-data:/app/backend/data
restart: unless-stopped
nginx-proxy:
image: nginx:alpine
ports:
- "443:443"
volumes:
- ./nginx.conf:/etc/nginx/nginx.conf:ro
- ./htpasswd:/etc/nginx/.htpasswd:ro
depends_on:
- open-webui
restart: unless-stopped
volumes:
open-webui-data:
Start Open WebUI, create an admin account, select a model, and have a five-message conversation. Then verify the conversation is stored by running docker exec open-webui ls /app/backend/data/backend/models.