[SOLVED] Ollama Open web Ui in WSL2 Bug after Reinstall - BASE URL & admin User #571

Closed
opened 2025-11-11 14:26:19 -06:00 by GiteaMirror · 2 comments
Owner

Originally created by @Gara06 on GitHub (Apr 1, 2024).

Bug Report

Description

I installed in a first time Ollama and OpenWebUi; It was working , but only CPU. So i uninstall it to make a clean install with nvidia gpu.

Bug Summary:
install on Win11 - Docker desktop - WSL2- Docker Compose :
version: '3.8'

services:
ollama:
deploy:
resources:
reservations:
devices:
- driver: nvidia
capabilities: [gpu]
volumes:
- ollama:/root/.ollama
container_name: ollama
restart: unless-stopped
image: ollama/ollama:latest

open-webui:
image: ghcr.io/open-webui/open-webui:main
container_name: open-webui
volumes:
- open-webui:/app/backend/data
depends_on:
- ollama
ports:
- ${OPEN_WEBUI_PORT-3000}:8080
environment:
- 'OLLAMA_BASE_URL=http://ollama:11434'
- 'WEBUI_SECRET_KEY='
extra_hosts:
- host.docker.internal:host-gateway
restart: unless-stopped

volumes:
ollama: {}
open-webui: {}

Steps to Reproduce:
I uninstall with revo uninstaller to delete every thing from ollama, docker desktop and openWebUi, But all time , more than 20 times , i re-install all. i have all time my first old admin User working. Why ? why cannot delete it and create a new admin user ? this is the first BUG. But tho most important it's i cannot connect OpenWebUi to Ollama with Base URL. BASE URL doesnt save any change , and doesnt valide to work any change. If i use http://localhost:3000 i get acces to OpenWebUi, If i go to http://localhost:11434/ "Ollama is running" but never exept the first time i connected OpenWebUi to ollama.
i tryed to use docker run instead of docker compose after , but same result. Admin User stay the same even i delete and erase alle things. And never connect to ollama.

Expected Behavior:
There is a data base i can delete to erase all from old install and restart reely clean and NEW?

Actual Behavior:
[Describe what actually happened.]

Environment

  • Win 11 up to date. Nvidia 4060ti, 64 g Ram, Docker desktop,
  • Browser : same thing with Brave, Firefox, Edge, Chrome

Confirmation:

  • I have read during a week all result about this probleme but , i never found something serious. May be i dont speak and read to good english, but french doesnt on the web.
    Thank you
Originally created by @Gara06 on GitHub (Apr 1, 2024). # Bug Report ## Description I installed in a first time Ollama and OpenWebUi; It was working , but only CPU. So i uninstall it to make a clean install with nvidia gpu. **Bug Summary:** install on Win11 - Docker desktop - WSL2- Docker Compose : version: '3.8' services: ollama: deploy: resources: reservations: devices: - driver: nvidia capabilities: [gpu] volumes: - ollama:/root/.ollama container_name: ollama restart: unless-stopped image: ollama/ollama:latest open-webui: image: ghcr.io/open-webui/open-webui:main container_name: open-webui volumes: - open-webui:/app/backend/data depends_on: - ollama ports: - ${OPEN_WEBUI_PORT-3000}:8080 environment: - 'OLLAMA_BASE_URL=http://ollama:11434' - 'WEBUI_SECRET_KEY=' extra_hosts: - host.docker.internal:host-gateway restart: unless-stopped volumes: ollama: {} open-webui: {} **Steps to Reproduce:** I uninstall with revo uninstaller to delete every thing from ollama, docker desktop and openWebUi, But all time , more than 20 times , i re-install all. i have all time my first old admin User working. Why ? why cannot delete it and create a new admin user ? this is the first BUG. But tho most important it's i cannot connect OpenWebUi to Ollama with Base URL. BASE URL doesnt save any change , and doesnt valide to work any change. If i use http://localhost:3000 i get acces to OpenWebUi, If i go to http://localhost:11434/ "Ollama is running" but never exept the first time i connected OpenWebUi to ollama. i tryed to use docker run instead of docker compose after , but same result. Admin User stay the same even i delete and erase alle things. And never connect to ollama. **Expected Behavior:** There is a data base i can delete to erase all from old install and restart reely clean and NEW? **Actual Behavior:** [Describe what actually happened.] ## Environment - Win 11 up to date. Nvidia 4060ti, 64 g Ram, Docker desktop, - Browser : same thing with Brave, Firefox, Edge, Chrome **Confirmation:** - [ ] I have read during a week all result about this probleme but , i never found something serious. May be i dont speak and read to good english, but french doesnt on the web. Thank you
Author
Owner

@justinh-rahb commented on GitHub (Apr 1, 2024):

This issue is not a bug, but rather a misunderstanding of how Docker functions. To resolve it, please remove the persistent volume using the following command:

docker rm -f open-webui

It's important to understand that, from a Docker container's perspective, localhost refers to itself rather than the host machine, which is the intended target. For more information, please refer to our FAQ: https://docs.openwebui.com/faq#q-why-cant-my-docker-container-connect-to-services-on-the-host-using-localhost

To correct this, use the default URL that would be applied if no environment variable is set:

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:main

Upon checking Ollama Connections, you should see http://host.docker.internal:11434. If this still fails to connect, the problem might be that Ollama is not listening on all interfaces (0.0.0.0), but only on localhost. To fix this issue, set the Ollama environment variables OLLAMA_HOST=0.0.0.0 and OLLAMA_ORIGINS=*. Note that this should not be necessary when using our Docker Compose installation method, nor would changing any Base URL values (it would be http://ollama:11434 in this case). Only change your Ollama environment variables if you are running the .exe installer variant: https://github.com/ollama/ollama/blob/main/docs/faq.md#setting-environment-variables-on-windows

@justinh-rahb commented on GitHub (Apr 1, 2024): This issue is not a bug, but rather a misunderstanding of how Docker functions. To resolve it, please remove the persistent volume using the following command: ```bash docker rm -f open-webui ``` It's important to understand that, from a Docker container's perspective, `localhost` refers to itself rather than the host machine, which is the intended target. For more information, please refer to our FAQ: <https://docs.openwebui.com/faq#q-why-cant-my-docker-container-connect-to-services-on-the-host-using-localhost> To correct this, use the default URL that would be applied if no environment variable is set: ```bash 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:main ``` Upon checking Ollama Connections, you should see `http://host.docker.internal:11434`. If this still fails to connect, the problem might be that Ollama is not listening on all interfaces (`0.0.0.0`), but only on `localhost`. To fix this issue, set the Ollama environment variables `OLLAMA_HOST=0.0.0.0` and `OLLAMA_ORIGINS=*`. Note that this should not be necessary when using our Docker Compose installation method, nor would changing any Base URL values (it would be `http://ollama:11434` in this case). Only change your Ollama environment variables if you are running the .exe installer variant: https://github.com/ollama/ollama/blob/main/docs/faq.md#setting-environment-variables-on-windows
Author
Owner

@Gara06 commented on GitHub (Apr 1, 2024):

[SOLVED] Thank you very much. Works fine with this 2 commands.
OpenWebUi now is connected to ollama, and i can registre a new admin user. ;)
Ty also for the FAQ link

@Gara06 commented on GitHub (Apr 1, 2024): [SOLVED] Thank you very much. Works fine with this 2 commands. OpenWebUi now is connected to ollama, and i can registre a new admin user. ;) Ty also for the FAQ link
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/open-webui#571