open-webui / docs

https://docs.openwebui.com
https://docs.openwebui.com
53 stars 64 forks source link

Update intro.md to add rootless (Podman) local-only & auto-update #16

Closed lainedfles closed 4 months ago

lainedfles commented 4 months ago

Add instructions for configuration of rootless (Podman) local-only Open WebUI with Systemd service and auto-update capability. Relates to open-webui/docs#11 as an alternative solution. See also open-webui/open-webui#877

tjbck commented 4 months ago

LGTM, Thanks!

pwab commented 3 months ago

Hey @lainedfles just a quick question: These instructions were only tested on a Linux system (I'm guessing from the systemd instructions) - right?

Because I just can't get my local Open WebUI provided via Podman to reach my local Ollama instance on Windows. Would changes to the Podman command be necessary here or could it rather be due to configurations (Podman machine, Ollama HOST/ORIGIN)?

To briefly point out the differences:

lainedfles commented 3 months ago

@pwab That's correct. Perhaps, with the Ollama Windows preview and popularity of WSL2, this document should be updated to make that distinction apparent. I didn't realize that Podman was supported under WSL2!

My Windows knowledge is dated as I spend the majority of my time with Linux these days but I've done a little research: I think that the rootless Podman configuration should work with WSL2 but may require WSL2 networking changes if Ollama doesn't also run under WSL2. I don't think that the user-mode-networking option is necessary since it will override the WSL2 network configuration.

According to the Microsoft documentation, NAT is the default mode. With NAT mode, Ollama would need to listen on your Windows host IP in addition to loopback. My suggestion would be to try using the recently introduced mirrored networking mode to permit the mentioned benefit: Connect to Windows servers from within Linux using the localhost address 127.0.0.1. IPv6 localhost address ::1 is not supported.

In case this information is useful to you, here is a command I often use for troubleshooting:

$ podman exec -it open-webui bash -c 'nc -vz ollama.local 11434'
Connection to ollama.local (10.0.2.2) 11434 port [tcp/*] succeeded!

This might be a worthwhile strategy to test the Podman configuration before making any WSL2 changes: use netcat under your WSL2 distribution to temporarily listen on another port nc -vl 127.0.0.1 -p 11435 and connect from within the container podman exec -it open-webui bash -c 'nc -vz 10.0.2.2 11435'. It might look like this:

$ nc -vl 127.0.0.1 -p 11435
Connection from 127.0.0.1:43206
$ podman exec -it open-webui bash -c 'nc -vz 10.0.2.2 11435'
Connection to 10.0.2.2 11435 port [tcp/*] succeeded!

If you get this working, I'd urge you to submit a pull request to update the doc. 🥂

lainedfles commented 2 months ago

@pwab Did you get this working? I spent a bit of time to confirm the process and submitted open-webui/docs#43. Let me know what you think!

pwab commented 2 months ago

@lainedfles not yet. Time was missing but it's still on my task list. Thanks for the hint. I'm goona look into the PR!