Once Ollama is running, you can ask questions from a terminal or send requests to its API. For everyday use, a browser interface is often more convenient: select a model, start a conversation, and return to earlier chats without writing commands.
Open WebUI provides that interface. This guide shows how to connect it to local Ollama with Docker Compose, then covers alternatives when Ollama runs directly on the host or on another computer. Start with Set Up Local AI with Ollama if you have not yet installed and tested a model.
What is Open WebUI?
Open WebUI is a self-hosted web application for interacting with AI model providers. In this setup, Ollama is the provider: it loads the downloaded language model and generates responses. Open WebUI manages the browser experience, accounts, and conversations.
Browser
-> Open WebUI
-> Ollama API
-> local language model
-> response displayed in the chat
Adding Open WebUI does not replace Ollama or automatically make inference faster. It provides a convenient way to use the model you already run. A single computer can host both services; an additional GPU machine is optional.
Why add a browser interface?
A UI is helpful when you want to try prompts, compare answers from different installed models, or use local AI without a terminal. It also separates interactive experimentation from application code: you can test whether a model handles a task before connecting it to a website.
For example, you might ask for a short explanation of a Docker configuration or compare how two models summarize the same paragraph. Judge the output against the task; an attractive chat interface does not make generated answers inherently accurate.
Your Drupal integration can still call Ollama directly. Open WebUI is an additional client, not a required middle layer for the Drupal article chatbot or analytics assistant.
Before you start
You need Docker with Compose, a working Ollama service, and at least one downloaded model. Confirm inference works before diagnosing a new UI:
# For an Ollama service in your current Compose project:
docker compose exec ollama ollama list
docker compose exec ollama ollama run llama3.2:1b "Explain HTTP in one sentence."
If that model is not installed, pull it first with docker compose exec ollama ollama pull llama3.2:1b. For a native installation, use the same Ollama commands without the Docker prefix.
The following setup builds on the Compose example in the Ollama guide. Run commands from that project's directory. The official Open WebUI quick start provides other installation methods.
Step 1: add Open WebUI to your Compose project
Add an open-webui service beside the existing ollama service under services. Add the named volume at the top level. This is a fragment to merge into your existing file, not a second definition of Ollama:
services:
# Keep your existing ollama service here.
open-webui:
image: ghcr.io/open-webui/open-webui:main
restart: unless-stopped
ports:
- "127.0.0.1:3000:8080"
environment:
OLLAMA_BASE_URL: http://ollama:11434
WEBUI_SECRET_KEY: ${WEBUI_SECRET_KEY:?Set WEBUI_SECRET_KEY in .env}
volumes:
- open-webui-data:/app/backend/data
depends_on:
- ollama
volumes:
open-webui-data:
Both services must share a Docker network. The earlier standalone example uses Compose's default network, so its service name ollama resolves automatically. If your project uses explicit networks, attach Open WebUI to the same network as Ollama.
Port 3000 is the browser-facing host port; 8080 is the port inside the UI container. The loopback binding limits browser access to this computer. The data volume persists UI state across container recreation, separate from Ollama's model storage.
Keep a stable secret key. Generate one locally—for example, with openssl rand -hex 32 where OpenSSL is available—and add it to the project's private .env file:
WEBUI_SECRET_KEY=replace_with_your_generated_random_value
Preserve existing .env entries and keep the file out of source control. The official quick start documents the persistent data path and secret setting. The example uses the main tag; for controlled deployments, select and test an explicit release tag rather than treating a moving tag as a fixed version.
Step 2: start the UI and create your account
docker compose up -d open-webui
docker compose ps open-webui
docker compose logs --tail=50 open-webui
Wait for startup to finish, then open http://localhost:3000. Complete the initial administrator account setup. Use that account for connection settings and review registration controls before sharing the instance. Personal preferences and administrator settings are separate; see Understanding Settings.
Step 3: select the model and send a message
Open the administrator connection settings, typically Settings → Admin → Connections, and check the Ollama connection. With the shared-network example, its base URL is:
http://ollama:11434
Enter a base URL, not /api/chat or /api/tags. Start a new chat, select an installed model, and submit a short prompt. If the list is empty, verify the connection and confirm the selected Ollama server actually has models downloaded. The Ollama provider guide covers connection and model management.
A useful first check is to ask the same question you already tested through Ollama. This helps separate a UI connection problem from a model or inference problem.
Alternative: Ollama runs directly on your computer
If Ollama is installed natively rather than in the same Compose project, remove the depends_on: ollama entry and change the UI configuration:
extra_hosts:
- "host.docker.internal:host-gateway"
environment:
OLLAMA_BASE_URL: http://host.docker.internal:11434
WEBUI_SECRET_KEY: ${WEBUI_SECRET_KEY:?Set WEBUI_SECRET_KEY in .env}
Keep the other UI settings and its volume. localhost inside the UI container refers to that container, so it usually cannot reach native Ollama through http://localhost:11434.
Ollama must listen on an interface reachable from Docker, with the host firewall permitting that connection. The previous Ollama guide explains listening-address configuration. Do not disable the firewall to solve a hostname or routing problem.
If you previously saved a connection in the admin interface, inspect that saved connection when changing endpoints; updating Compose alone may not replace persisted settings. See the settings documentation.
Optional: connect to Ollama on another computer
Open WebUI can stay on your main computer while Ollama runs on a GPU-equipped desktop or laptop. Set the connection to that server's reachable private address, for example:
http://10.10.10.1:11434
Use your actual address. Follow the networking and scoped firewall steps in Set Up Local AI with Ollama, and confirm connectivity from the Open WebUI container.
The model must be installed on the remote server. Downloading it on the UI host does not make it available elsewhere. A remote server also needs to remain awake and connected for its models to respond. Adding multiple connections is not the same as implementing the Drupal chatbot's ordered primary/fallback policy.
Troubleshoot connection and performance issues
| Symptom | Check |
|---|---|
| Browser cannot open the UI | Container status, startup logs, and whether host port 3000 is available |
| UI opens but no models appear | Ollama base URL, shared network or host routing, and installed models |
| Connection fails after changing Compose | Saved administrator connection settings and container recreation |
| Reply is slow | Ollama model placement, loading time, memory, prompt length, and competing requests |
| Another device cannot open the UI | The example deliberately binds to 127.0.0.1; cross-device access needs an intentional network configuration |
For the shared-network setup, this read-only check tests Ollama from the UI container itself:
docker compose exec open-webui python -c "import urllib.request; print(urllib.request.urlopen('http://ollama:11434/api/tags', timeout=5).read().decode())"
Use the configured URL if your endpoint differs. A successful tags response verifies service access and model discovery; send a chat message to verify generation. Check ollama ps on the inference server when investigating CPU/GPU usage. Open WebUI cannot compensate for a model that exceeds your hardware's practical capacity.
Preserve your data when updating
Back up the Open WebUI data volume and retain the secret before an upgrade. Ollama's model volume is separate. After reviewing the release notes, update the UI image and recreate its service:
docker compose pull open-webui
docker compose up -d open-webui
Keep the same volume and secret. Avoid docker compose down -v unless you deliberately intend to delete the project's named volumes. For rollback, retain a compatible data backup as well as the prior image version; an older image may not understand a database upgraded by a newer release. See Updating Open WebUI.
Start with a working chat and one model. You can then decide whether you need additional features or access from other devices. The basic setup already provides a browser-based workspace for the local AI runtime you installed.