13. Open WebUI on macOS

Chapter 13 of 15 · 20 min

Open WebUI (formerly Ollama WebUI) is a self-hosted web interface for local AI models. It provides a ChatGPT-style interface with none of the cloud dependency. On macOS, it runs alongside Ollama and connects to it via the local API.

Install with Docker (for the full experience) or Python:

# Python install (works on macOS with Metal available via host Ollama)
pip install open-webui

# Start open-webui
open-webui serve
# Runs on port 8080 by default

# Access at http://localhost:8080
# Create an admin account on first login

For Docker install (CPU-only Metal, see Chapter 11):

docker run -d \
  -p 8080:8080 \
  -e OLLAMA_BASE_URL=http://host.docker.internal:11434 \
  -v open-webui:/app/backend/data \
  --name open-webui \
  ghcr.io/open-webui/open-webui:main

The Docker version connects to Ollama running on the host via host.docker.internal, but Metal will not be available in the connection because Docker's network stack does not passthrough Metal. Run Ollama on the host directly and connect the Python-based Open WebUI to it for GPU-accelerated inference.

Once running, Open WebUI gives you:

  • Web UI for model interaction
  • Model selection dropdown
  • Chat history
  • Admin panel for user management
  • API key protection
# Verify Open WebUI can reach Ollama
curl http://localhost:11434/api/tags
# Should return model list

# Check Open WebUI logs if connection fails
docker logs open-webui  # if running in Docker
# or check the terminal output from open-webui serve

Real failure mode: Open WebUI starts but shows "Ollama not connected" in the UI. This means it cannot reach the Ollama API. Check that Ollama is running: curl http://localhost:11434. If it returns a response, the issue is a network or firewall problem. If it returns connection refused, start Ollama: ollama serve.

EXERCISE

Install Open WebUI via Python, start it, create an admin account, and connect it to your Ollama installation. Load a model through the web interface and verify chat history persists after page refresh.