[GH-ISSUE #12034] issue: OLLAMA_BASE_URL is not used as the setting when restarting container #103439

Closed
opened 2026-05-18 00:51:38 -05:00 by GiteaMirror · 1 comment
Owner

Originally created by @WebKenth on GitHub (Mar 25, 2025).
Original GitHub issue: https://github.com/open-webui/open-webui/issues/12034

Check Existing Issues

  • I have searched the existing issues and discussions.
  • I am using the latest version of Open WebUI.

Installation Method

Docker

Open WebUI Version

main

Ollama Version (if applicable)

latest

Operating System

MacOS / Docker

Browser (if applicable)

No response

Confirmation

  • I have read and followed all instructions in README.md.
  • I am using the latest version of both Open WebUI and Ollama.
  • I have included the browser console logs.
  • I have included the Docker container logs.
  • I have listed steps to reproduce the bug in detail.

Expected Behavior

Set the environment variable: OLLAMA_BASE_URL: "http://ollama:11434"

Load up the container and expect to see the setting set:

Image

Actual Behavior

Set the environment variable: OLLAMA_BASE_URL: "http://ollama:11434"

Load up the container and expect to see the setting set:

The base url is set to host.docker.internal which does not work

Image

Steps to Reproduce

I am using Traefik to manage the alot of containers and bind them to the network to avoid them exposing conflicting ports, your experience may vary

Basically this config boots up a traefik container which makes 2 routers, one for each service and using the docker network we bind the containers together so they can communicate

ollama.webui.yml

services:
  ollama-webui:
    image: ghcr.io/ollama-webui/ollama-webui:main
    container_name: ollama-webui
    volumes:
      - ../data/ollama-webui:/app/backend/data    
    environment:
      OLLAMA_BASE_URL: "http://ollama:11434"

ollama.yml

  ollama:
    image: ollama/ollama
    container_name: ollama
    volumes:
      - ../data/ollama:/root/.ollama
    environment:
      OLLAMA_HOST: 0.0.0.0

docker-compose.yml

services:
  traefik:
    image: traefik:v2.0
    container_name: traefik
    restart: always
    ports:
      - "80:80"
      - "443:443"
      - "8080:8080"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
      - ./traefik.yml:/etc/traefik/traefik.yml
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.traefik.rule=Host(`traefik.local`)"
      - "traefik.http.routers.traefik.service=api@internal"
      - "traefik.http.routers.traefik.entrypoints=web"
  ollama:
    extends:
        file: ./services/ollama.yml
        service: ollama
    container_name: ollama
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.ollama.rule=Host(`ollama.local`)"
      - "traefik.http.routers.ollama.entrypoints=web"
      - "traefik.http.services.ollama.loadbalancer.server.port=11434"
    networks:
          - proxy
  ollama-webui:
    extends:
        file: ./services/ollama-webui.yml
        service: ollama-webui
    container_name: ollama-webui
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.chat.rule=Host(`chat.local`)"
      - "traefik.http.routers.chat.entrypoints=web"
      - "traefik.http.services.chat.loadbalancer.server.port=8080"
    networks:
      - proxy

networks:
  proxy:
    driver: bridge

docker-compose up
And go to chat.local

You should see this:

Image

Close it, and navigate to the settings page

Notice the setting is not set to what you put in the environment variable
Image

Change the setting to "http://ollama:11434" and it now works

To reproduce the error simply run docker-compose down; docker-compose up -d, repeat the above steps and you will see the exact same behaviour

Logs & Screenshots

docker logs ollama-webui

No WEBUI_SECRET_KEY provided
Generating WEBUI_SECRET_KEY
Loading WEBUI_SECRET_KEY from .webui_secret_key
INFO:     Started server process [1]
INFO:     Waiting for application startup.
INFO:     Application startup complete.
INFO:     Uvicorn running on http://0.0.0.0:8080 (Press CTRL+C to quit)
INFO:     192.168.107.1:0 - "GET / HTTP/1.1" 200 OK
INFO:     192.168.107.1:0 - "GET /api/v1/ HTTP/1.1" 200 OK
INFO:     192.168.107.1:0 - "GET /api/v1/auths/ HTTP/1.1" 401 Unauthorized
INFO:     192.168.107.1:0 - "GET /auth/ HTTP/1.1" 304 Not Modified
INFO:     192.168.107.1:0 - "GET /api/v1/ HTTP/1.1" 200 OK
authenticate_user ******* REDACTED **********
INFO:     192.168.107.1:0 - "POST /api/v1/auths/signin HTTP/1.1" 200 OK
INFO:     192.168.107.1:0 - "GET /api/v1/modelfiles/ HTTP/1.1" 200 OK
INFO:     192.168.107.1:0 - "GET /api/v1/prompts/ HTTP/1.1" 200 OK
INFO:     192.168.107.1:0 - "GET /api/v1/documents/ HTTP/1.1" 200 OK
INFO:     192.168.107.1:0 - "GET /api/v1/chats/tags/all HTTP/1.1" 200 OK
INFO:     192.168.107.1:0 - "GET /ollama/api/version HTTP/1.1" 500 Internal Server Error
INFO:     192.168.107.1:0 - "GET /ollama/api/tags HTTP/1.1" 500 Internal Server Error
INFO:     192.168.107.1:0 - "GET /api/v1/chats/ HTTP/1.1" 200 OK
https://api.openai.com/v1/models 
INFO:     192.168.107.1:0 - "GET /openai/api/models HTTP/1.1" 401 Unauthorized
INFO:     192.168.107.1:0 - "GET /api/v1/ HTTP/1.1" 200 OK
INFO:     192.168.107.1:0 - "GET /api/v1/auths/ HTTP/1.1" 200 OK
INFO:     192.168.107.1:0 - "GET /api/v1/modelfiles/ HTTP/1.1" 200 OK
INFO:     192.168.107.1:0 - "GET /api/v1/prompts/ HTTP/1.1" 200 OK
INFO:     192.168.107.1:0 - "GET /api/v1/documents/ HTTP/1.1" 200 OK
INFO:     192.168.107.1:0 - "GET /api/v1/chats/tags/all HTTP/1.1" 200 OK
INFO:     192.168.107.1:0 - "GET /ollama/api/tags HTTP/1.1" 500 Internal Server Error
INFO:     192.168.107.1:0 - "GET /ollama/api/version HTTP/1.1" 500 Internal Server Error
https://api.openai.com/v1/models 
INFO:     192.168.107.1:0 - "GET /openai/api/models HTTP/1.1" 401 Unauthorized
INFO:     192.168.107.1:0 - "GET /api/v1/chats/ HTTP/1.1" 200 OK
INFO:     192.168.107.1:0 - "GET /ollama/api/url HTTP/1.1" 200 OK

docker logs ollama

2025/03/25 08:50:57 routes.go:1230: INFO server config env="map[CUDA_VISIBLE_DEVICES: GPU_DEVICE_ORDINAL: HIP_VISIBLE_DEVICES: HSA_OVERRIDE_GFX_VERSION: HTTPS_PROXY: HTTP_PROXY: NO_PROXY: OLLAMA_CONTEXT_LENGTH:2048 OLLAMA_DEBUG:false OLLAMA_FLASH_ATTENTION:false OLLAMA_GPU_OVERHEAD:0 OLLAMA_HOST:http://0.0.0.0:11434 OLLAMA_INTEL_GPU:false OLLAMA_KEEP_ALIVE:5m0s OLLAMA_KV_CACHE_TYPE: OLLAMA_LLM_LIBRARY: OLLAMA_LOAD_TIMEOUT:5m0s OLLAMA_MAX_LOADED_MODELS:0 OLLAMA_MAX_QUEUE:512 OLLAMA_MODELS:/root/.ollama/models OLLAMA_MULTIUSER_CACHE:false OLLAMA_NEW_ENGINE:false OLLAMA_NOHISTORY:false OLLAMA_NOPRUNE:false OLLAMA_NUM_PARALLEL:0 OLLAMA_ORIGINS:[http://localhost https://localhost http://localhost:* https://localhost:* http://127.0.0.1 https://127.0.0.1 http://127.0.0.1:* https://127.0.0.1:* http://0.0.0.0 https://0.0.0.0 http://0.0.0.0:* https://0.0.0.0:* app://* file://* tauri://* vscode-webview://* vscode-file://*] OLLAMA_SCHED_SPREAD:false ROCR_VISIBLE_DEVICES: http_proxy: https_proxy: no_proxy:]"
time=2025-03-25T08:50:57.203Z level=INFO source=images.go:432 msg="total blobs: 19"
time=2025-03-25T08:50:57.209Z level=INFO source=images.go:439 msg="total unused blobs removed: 0"
time=2025-03-25T08:50:57.209Z level=INFO source=routes.go:1297 msg="Listening on [::]:11434 (version 0.6.2)"
time=2025-03-25T08:50:57.209Z level=INFO source=gpu.go:217 msg="looking for compatible GPUs"
time=2025-03-25T08:50:57.211Z level=INFO source=gpu.go:377 msg="no compatible GPUs were discovered"
time=2025-03-25T08:50:57.211Z level=INFO source=types.go:130 msg="inference compute" id=0 library=cpu variant="" compute="" driver=0.0 name="" total="51.0 GiB" available="49.7 GiB"

Additional Information

It would help to see a full list of available Environment Variables

There might be a hidden one i missed to set the the settings host?

Originally created by @WebKenth on GitHub (Mar 25, 2025). Original GitHub issue: https://github.com/open-webui/open-webui/issues/12034 ### Check Existing Issues - [x] I have searched the existing issues and discussions. - [x] I am using the latest version of Open WebUI. ### Installation Method Docker ### Open WebUI Version main ### Ollama Version (if applicable) latest ### Operating System MacOS / Docker ### Browser (if applicable) _No response_ ### Confirmation - [x] I have read and followed all instructions in `README.md`. - [x] I am using the latest version of **both** Open WebUI and Ollama. - [x] I have included the browser console logs. - [x] I have included the Docker container logs. - [x] I have listed steps to reproduce the bug in detail. ### Expected Behavior Set the environment variable: `OLLAMA_BASE_URL: "http://ollama:11434"` Load up the container and expect to see the setting set: <img width="783" alt="Image" src="https://github.com/user-attachments/assets/825d2f2c-5722-466b-a1d9-4308265ebb7d" /> ### Actual Behavior Set the environment variable: `OLLAMA_BASE_URL: "http://ollama:11434"` Load up the container and expect to see the setting set: The base url is set to host.docker.internal which does not work ![Image](https://github.com/user-attachments/assets/51445a06-974b-4c20-b9ff-3ec0ee8d6cf7) ### Steps to Reproduce I am using Traefik to manage the alot of containers and bind them to the network to avoid them exposing conflicting ports, your experience may vary Basically this config boots up a traefik container which makes 2 routers, one for each service and using the docker network we bind the containers together so they can communicate ollama.webui.yml ```yml services: ollama-webui: image: ghcr.io/ollama-webui/ollama-webui:main container_name: ollama-webui volumes: - ../data/ollama-webui:/app/backend/data environment: OLLAMA_BASE_URL: "http://ollama:11434" ``` ollama.yml ```yml ollama: image: ollama/ollama container_name: ollama volumes: - ../data/ollama:/root/.ollama environment: OLLAMA_HOST: 0.0.0.0 ``` docker-compose.yml ```yml services: traefik: image: traefik:v2.0 container_name: traefik restart: always ports: - "80:80" - "443:443" - "8080:8080" volumes: - /var/run/docker.sock:/var/run/docker.sock - ./traefik.yml:/etc/traefik/traefik.yml labels: - "traefik.enable=true" - "traefik.http.routers.traefik.rule=Host(`traefik.local`)" - "traefik.http.routers.traefik.service=api@internal" - "traefik.http.routers.traefik.entrypoints=web" ollama: extends: file: ./services/ollama.yml service: ollama container_name: ollama labels: - "traefik.enable=true" - "traefik.http.routers.ollama.rule=Host(`ollama.local`)" - "traefik.http.routers.ollama.entrypoints=web" - "traefik.http.services.ollama.loadbalancer.server.port=11434" networks: - proxy ollama-webui: extends: file: ./services/ollama-webui.yml service: ollama-webui container_name: ollama-webui labels: - "traefik.enable=true" - "traefik.http.routers.chat.rule=Host(`chat.local`)" - "traefik.http.routers.chat.entrypoints=web" - "traefik.http.services.chat.loadbalancer.server.port=8080" networks: - proxy networks: proxy: driver: bridge ``` `docker-compose up` And go to chat.local You should see this: <img width="639" alt="Image" src="https://github.com/user-attachments/assets/be91a925-b204-4e9d-a70f-4d3220090ac5" /> Close it, and navigate to the settings page Notice the setting is not set to what you put in the environment variable <img width="777" alt="Image" src="https://github.com/user-attachments/assets/0d19e4b9-b766-4672-8436-3d3f193f4f9e" /> Change the setting to "http://ollama:11434" and it now works To reproduce the error simply run `docker-compose down; docker-compose up -d`, repeat the above steps and you will see the exact same behaviour ### Logs & Screenshots `docker logs ollama-webui` ```log No WEBUI_SECRET_KEY provided Generating WEBUI_SECRET_KEY Loading WEBUI_SECRET_KEY from .webui_secret_key INFO: Started server process [1] INFO: Waiting for application startup. INFO: Application startup complete. INFO: Uvicorn running on http://0.0.0.0:8080 (Press CTRL+C to quit) INFO: 192.168.107.1:0 - "GET / HTTP/1.1" 200 OK INFO: 192.168.107.1:0 - "GET /api/v1/ HTTP/1.1" 200 OK INFO: 192.168.107.1:0 - "GET /api/v1/auths/ HTTP/1.1" 401 Unauthorized INFO: 192.168.107.1:0 - "GET /auth/ HTTP/1.1" 304 Not Modified INFO: 192.168.107.1:0 - "GET /api/v1/ HTTP/1.1" 200 OK authenticate_user ******* REDACTED ********** INFO: 192.168.107.1:0 - "POST /api/v1/auths/signin HTTP/1.1" 200 OK INFO: 192.168.107.1:0 - "GET /api/v1/modelfiles/ HTTP/1.1" 200 OK INFO: 192.168.107.1:0 - "GET /api/v1/prompts/ HTTP/1.1" 200 OK INFO: 192.168.107.1:0 - "GET /api/v1/documents/ HTTP/1.1" 200 OK INFO: 192.168.107.1:0 - "GET /api/v1/chats/tags/all HTTP/1.1" 200 OK INFO: 192.168.107.1:0 - "GET /ollama/api/version HTTP/1.1" 500 Internal Server Error INFO: 192.168.107.1:0 - "GET /ollama/api/tags HTTP/1.1" 500 Internal Server Error INFO: 192.168.107.1:0 - "GET /api/v1/chats/ HTTP/1.1" 200 OK https://api.openai.com/v1/models INFO: 192.168.107.1:0 - "GET /openai/api/models HTTP/1.1" 401 Unauthorized INFO: 192.168.107.1:0 - "GET /api/v1/ HTTP/1.1" 200 OK INFO: 192.168.107.1:0 - "GET /api/v1/auths/ HTTP/1.1" 200 OK INFO: 192.168.107.1:0 - "GET /api/v1/modelfiles/ HTTP/1.1" 200 OK INFO: 192.168.107.1:0 - "GET /api/v1/prompts/ HTTP/1.1" 200 OK INFO: 192.168.107.1:0 - "GET /api/v1/documents/ HTTP/1.1" 200 OK INFO: 192.168.107.1:0 - "GET /api/v1/chats/tags/all HTTP/1.1" 200 OK INFO: 192.168.107.1:0 - "GET /ollama/api/tags HTTP/1.1" 500 Internal Server Error INFO: 192.168.107.1:0 - "GET /ollama/api/version HTTP/1.1" 500 Internal Server Error https://api.openai.com/v1/models INFO: 192.168.107.1:0 - "GET /openai/api/models HTTP/1.1" 401 Unauthorized INFO: 192.168.107.1:0 - "GET /api/v1/chats/ HTTP/1.1" 200 OK INFO: 192.168.107.1:0 - "GET /ollama/api/url HTTP/1.1" 200 OK ``` `docker logs ollama` ```log 2025/03/25 08:50:57 routes.go:1230: INFO server config env="map[CUDA_VISIBLE_DEVICES: GPU_DEVICE_ORDINAL: HIP_VISIBLE_DEVICES: HSA_OVERRIDE_GFX_VERSION: HTTPS_PROXY: HTTP_PROXY: NO_PROXY: OLLAMA_CONTEXT_LENGTH:2048 OLLAMA_DEBUG:false OLLAMA_FLASH_ATTENTION:false OLLAMA_GPU_OVERHEAD:0 OLLAMA_HOST:http://0.0.0.0:11434 OLLAMA_INTEL_GPU:false OLLAMA_KEEP_ALIVE:5m0s OLLAMA_KV_CACHE_TYPE: OLLAMA_LLM_LIBRARY: OLLAMA_LOAD_TIMEOUT:5m0s OLLAMA_MAX_LOADED_MODELS:0 OLLAMA_MAX_QUEUE:512 OLLAMA_MODELS:/root/.ollama/models OLLAMA_MULTIUSER_CACHE:false OLLAMA_NEW_ENGINE:false OLLAMA_NOHISTORY:false OLLAMA_NOPRUNE:false OLLAMA_NUM_PARALLEL:0 OLLAMA_ORIGINS:[http://localhost https://localhost http://localhost:* https://localhost:* http://127.0.0.1 https://127.0.0.1 http://127.0.0.1:* https://127.0.0.1:* http://0.0.0.0 https://0.0.0.0 http://0.0.0.0:* https://0.0.0.0:* app://* file://* tauri://* vscode-webview://* vscode-file://*] OLLAMA_SCHED_SPREAD:false ROCR_VISIBLE_DEVICES: http_proxy: https_proxy: no_proxy:]" time=2025-03-25T08:50:57.203Z level=INFO source=images.go:432 msg="total blobs: 19" time=2025-03-25T08:50:57.209Z level=INFO source=images.go:439 msg="total unused blobs removed: 0" time=2025-03-25T08:50:57.209Z level=INFO source=routes.go:1297 msg="Listening on [::]:11434 (version 0.6.2)" time=2025-03-25T08:50:57.209Z level=INFO source=gpu.go:217 msg="looking for compatible GPUs" time=2025-03-25T08:50:57.211Z level=INFO source=gpu.go:377 msg="no compatible GPUs were discovered" time=2025-03-25T08:50:57.211Z level=INFO source=types.go:130 msg="inference compute" id=0 library=cpu variant="" compute="" driver=0.0 name="" total="51.0 GiB" available="49.7 GiB" ``` ### Additional Information It would help to see a full list of available Environment Variables There might be a hidden one i missed to set the the settings host?
GiteaMirror added the bug label 2026-05-18 00:51:38 -05:00
Author
Owner

@Ithanil commented on GitHub (Mar 25, 2025):

I didn't check your setup in detail and might be wrong, but please check that the reason is not OLLAMA_BASE_URL being a PersistentConfig setting. The docs don't specify PersistentConfig for OLLAMA_BASE_URL, but they do for OLLAMA_BASE_URLS https://docs.openwebui.com/getting-started/env-configuration/#ollama_base_urls

PersistentConfig settings will be read from the database once it is configured for the first time.

<!-- gh-comment-id:2750823063 --> @Ithanil commented on GitHub (Mar 25, 2025): I didn't check your setup in detail and might be wrong, but please check that the reason is not OLLAMA_BASE_URL being a `PersistentConfig` setting. The docs don't specify `PersistentConfig` for `OLLAMA_BASE_URL`, but they do for `OLLAMA_BASE_URLS` https://docs.openwebui.com/getting-started/env-configuration/#ollama_base_urls `PersistentConfig` settings will be read from the database once it is configured for the first time.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#103439