Open WebUI Can't Connect to Ollama in Docker: The Fixes
Описание и применение
Open WebUI не может подключиться к Ollama в Docker из‑за неверного URL и сетевых ограничений. Настройте OLLAMA_BASE_URL на правильный адрес, добавьте host.docker.internal при работе на хосте Linux и убедитесь, что Ollama слушает не только 127.0.0.1. После этого UI отображает модели и проходит проверку соединения.
Задача
Open WebUI cannot reach Ollama when both run in Docker, resulting in an empty model picker or failed admin connection check.
Результат
After configuring the correct Ollama URL and ensuring network visibility, Open WebUI can list models and pass admin connection checks.
Рабочий процесс
- 1. Identify where Ollama runs (same Compose file, host, or another machine).
- 2. Set
OLLAMA_BASE_URLto the appropriate URL:http://ollama:11434for same Compose,http://host.docker.internal:11434for host (withextra_hostson Linux), orhttp://<host-ip>:11434for another machine. - 3. If using host, add
--add-host host.docker.internal:host-gateway(or in Compose- host.docker.internal:host-gateway). Ensure Ollama listens on an address other than127.0.0.1(e.g.,0.0.0.0). - 4. Test connectivity from inside the Open WebUI container:
docker exec open-webui curl -s http://ollama:11434should return "Ollama is running" andcurl -s http://host.docker.internal:11434/api/versionshould return a JSON version string. - 5. If
OLLAMA_BASE_URLchange appears ineffective, update the value in Open WebUI Admin Panel > Settings > Connections, as the first value is persisted in the database. - 6. Optionally, monitor the connection with an HTTP monitor like Uptime Kuma from a container with the same network access.
Доказательства
Open WebUI shows no models and admin connection check reports "Ollama: Network Problem".
docker exec open-webui curl -s http://ollama:11434 should return "Ollama is running".
OLLAMA_BASE_URL set to http://ollama:11434 when both run in one Compose file.
- Дата записи: 2026-10-16T07:56:01.847Z