mirror of
https://github.com/open-webui/open-webui.git
synced 2026-03-22 14:13:08 -05:00
"No models": containerized Open web UI cannot access non-containerized Ollama 127.0.0.1:11434 via host.docker.internal #2267
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @huornlmj on GitHub (Oct 3, 2024).
Bug Report
No models shown in web ui due to containerized Open web UI cannot access non-containerized Ollama 127.0.0.1:11434 via host.docker.internal
Installation Method
Ollama installed via ollama installation script, non containerized.
Ollama listening locally on 127.0.0.1:11434
Openweb ui installed using the provided installer command:
docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:mainEnvironment
Open WebUI Version: Whatever comes from ghcr.io/open-webui/open-webui:main
Ollama (if applicable): 0.3.12
Operating System: Ubuntu 22.04.5 LTS
Browser (if applicable): N/A
Confirmation:
Expected Behavior:
Local models show up in web ui
Actual Behavior:
No models show up in web ui
Description
Bug Summary:
No models shown in web ui due to containerized Open web UI cannot access non-containerized Ollama 127.0.0.1:11434 via host.docker.internal
Reproduction Details
docker run -d -p 3000:8080 --add-host=host.docker.internal:host-gateway -v open-webui:/app/backend/data --name open-webui --restart always ghcr.io/open-webui/open-webui:mainLogs and Screenshots
Docker Container Logs:
Additional Information
The issue is that ollama is listening locally on 127.0.0.1:11434.
And
host.docker.internalis reachable from inside the open webui container (proven if I install the ping command)But you can see that it's 172.17.0.1 that it is resolving to. And if I add nmap to the open webui container and check if port 11434 is open on that172.17.0.1 interface I see that it is not. Because it's 127.0.0.1 on the host that port 11434 is actually listening on.
By the way, I am not prepared to use the host network as a solution because I intend to put an nginx reverse proxy in front of the openweb ui port so that I can offload TLS termination to it. If I use the host network approach then open webui's port 8080 will then be exposed on all interfaces, and then I'd need to start faffing with the OS iptables / ufw firewall to compensate. This compensation is the last option here.
Note
If the bug report is incomplete or does not follow the provided instructions, it may not be addressed. Please ensure that you have followed the steps outlined in the README.md and troubleshooting.md documents, and provide all necessary information for us to reproduce and address the issue. Thank you!
@stumblebot commented on GitHub (Oct 3, 2024):
Similar issue here on Ubuntu 22.04.4 and ollama 0.3.9.
@huornlmj commented on GitHub (Oct 3, 2024):
I have a bodge while this is being looked at. Make a hose-pipe tcp connection to connect 127.0.0.1:11434 to whatever your own docker interface gateway is. In my system it's 172.17.0.1. That way, as long as the SOCAT tunnel is up then your open webui container can see port 11434 open on its host.docker.internal interface which the SOCAT then pipes over to your host's 127.0.0.1:11434. But it all falls apart if you kill the SOCAT tunnel, hence the '&'.