mirror of
https://github.com/open-webui/open-webui.git
synced 2026-07-17 17:02:01 -05:00
[GH-ISSUE #1326] bug: OLLAMA_BASE_URL env var not registering #12447
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 @G4Zz0L1 on GitHub (Mar 27, 2024).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/1326
It was in another issue (https://github.com/open-webui/open-webui/issues/1295), but it was closed due to an arrogant guy.
@tjbck
I installed ollama as a native service on arch linux (managed via systemd, with ollama serve, on the address
http://127.0.0.1:11434).Then I put open-webui as a docker container, via docker compose, in its own stack, just to test and see if I could get everything started.
I used, as rightly said by you,
http://host.docker.internal:11434via theextra_hostsin the container, but it doesn't seem to work, ollama is not seen by open-webui.I then tried the only other alternative, i.e.
network_mode: host, replacing theOLLAMA_BASE_URLenv in the container withhttp://localhost:11434(orhttp://127.0.0.1:11434with the same results), but it still doesn't work.The first load after logging in fails with a blank page, giving the error below in the logs, then the page loads and I can change the URL from the frontend.
In seems to ignore the
OLLAMA_BASE_URLvariable by the tests I am doing.I'm definitely doing something wrong on my side, if it works for everyone else, but I honestly don't know what.
Below you will find the docker-compose that I am currently using to try to get it started, and other info.
I had to change the port, it conflicted with other services I use.
Environment
Confirmation:
Logs and Screenshots
Browser Console Logs:

Docker Container Logs:
Installation Method
@dtsoden commented on GitHub (Mar 27, 2024):
@G4Zz0L1 it's the arrogant guy from the other ticket. Odd that another exact same issue came up in another ticket (perhaps rethink before calling visitors names and like in my ticket telling me how to behave and my tone... - like who's actually arrogant??? [rhetorical]).
I found this one because I was searching to close my ticket, but I see you not only talk smack about your users you kindly closed mine. Also, your profile pic with the FU middle finger says it all and matches the personality to a "T". Cheers!
I love the app but given the treatment here on this project... I am just going to find another project to use - that should make us both happy. Unbelievable rudeness here!!
@G4Zz0L1 commented on GitHub (Mar 27, 2024):
I'm not a developer of the project, I'm just a user and I haven't closed your issue.
Furthermore, our two problems were only connected for the saving part, which they are already working on.
I know for a fact that in open source most developers are in it in their free time, so unlike you, instead of going on a rant about the rebranding of the project, I'm just politely seeking information on an issue.
So, yeah, your posts in the other issue seem a little arrogant, that's all.
PS: the profile photo is the only profile photo that I normally use on social media, as I have no other photos, it doesn't indicate much of my personality.
@tjbck commented on GitHub (Mar 27, 2024):
@G4Zz0L1 Could you tell us more about the installation method you used? Trying to understand why the backend is trying to connect to
ollama-service.open-webui.svc.cluster.local:11434instead of the specifiedhttp://localhost:11434here 😅@G4Zz0L1 commented on GitHub (Mar 27, 2024):
I'm trying to use docker-compose to launch open-webui, with the snippet in the first post of this issue.
For ollama, I used the already packaged ollama found in the Arch Linux repo (https://archlinux.org/packages/extra/x86_64/ollama/).
I'm not sure I understand what else do you need, sorry.
The only moving parts here are those two, to my knowledge.
That url baffles me just as much as you, honestly.
That's the reason for the issue xD
EDIT: what else can I provide to help with this?
@tjbck commented on GitHub (Mar 27, 2024):
What command did you use to run the compose file? Seem like you might be using our k8s file for some reason. Here's a docker compose doc that might help us: https://docs.openwebui.com/getting-started/#one-line-command-to-install-ollama-and-open-webui-together
@G4Zz0L1 commented on GitHub (Mar 27, 2024):
Oh, I didn't get it before, sorry.
Nothing fancy, just the usual
docker compose up -d --build.I don't need gpu support for docker, ollama it's installed locally.
@justinh-rahb commented on GitHub (Mar 27, 2024):
@G4Zz0L1 can you see if reinstalling Ollama will help? We've had some recent issues that went away after a reinstall of it.
@tjbck commented on GitHub (Mar 27, 2024):
@justinh-rahb I highly suspect like our webui is causing the issue here, not our code but rather the infra side of things.
@G4Zz0L1 have you tried just using the docker run command?
@slash-proc commented on GitHub (Mar 27, 2024):
This seems to be an issue with the k8s fixes recently pulled into dev.
I think it's better to either ignore Kubernetes in config.py and leave things to the helm chart / manifests to pass OLLAMA_BASE_URL or to change the code above to:
@tjbck commented on GitHub (Mar 27, 2024):
@jannikstdl could you take a look? thanks in advance!
@tjbck commented on GitHub (Mar 27, 2024):
@G4Zz0L1 Just added a quick fix, let me know if that fixes the issue!
@G4Zz0L1 commented on GitHub (Mar 27, 2024):
Just done it, nothing's changed, sorry.
Nope, I'll try right away.
Well, that seems to be it. In my case it should take the else branch, that's the source of that url.
As soon as the github action publishes the new image, and report asap!
Thanks to everyone in the meantime!
@G4Zz0L1 commented on GitHub (Mar 27, 2024):
It works perfectly now, thanks a lot!
Now it only has to save settings, I'll watch the other issue for that, thanks.
@jannikstdl commented on GitHub (Mar 28, 2024):
The K8s OLLAMA_BASE_URL are also added in the manifests.
For me this wouldn't work, so I added the check lines in config.py
It may have picked the else not because of the KUBERNETES_SERVICE_HOST being an empty string (which means there is no ENV) rather than the /ollama beeing false.
Because it would be weird if the KUBERNETES_SERVICE_HOST ENV exists in this Linux with docker compose.
or to change the code above to:
This seems like a good approach for me.
@tjbck you changed the KUBERNETES_SERVICE_HOST ENV to K8S_FLAG, just for clarification, is this an actual ENV or is this a placeholder?
I will have a look at this.
@adjiap commented on GitHub (Sep 1, 2025):
I have the same problem still in
v0.6.26.Expectation:
When I explicitly put
K8S_FLAG=False, I would get to use the given OLLAMA_BASE_URL (or OLLAMA_BASE_URLS)Reality:
When I explicitly put
K8S_FLAG=False, and also OLLAMA_BASE_URL, I still usehttp://ollama-service.open-webui.svc.cluster.local:11434.Only when I remove the K8S_FLAG in the environment variables, then we're using the OLLAMA_BASE_URL