Are you looking for a way to access Open WebUI from other computers on your network? With the power of Docker and Ollama, you can create a remote-accessible Open WebUI installation that’s easy to set up. In this step-by-step guide, we’ll walk you through the process of creating an Open WebUI container using Docker, setting environment variables, configuring firewall rules, and creating port proxies. If you’re unable to access Open WebUI with Docker in Windows, these are the steps to fix it.
Step 1: Create the Open WebUI Docker Container (or Skip to Step 3 if You Already Have One)
If you haven’t already created a Docker container for Open WebUI, start by running the following command:
sudo docker run -d --network=host -v open-webui:/app/backend/data -e OLLAMA_BASE_URL=http://127.0.0.1:11434 --name ollama-webui --restart always ghcr.io/open-webui/open-webui:main
Alternatively, you can pull the Open WebUI image using this from GitHub:
sudo docker run -d --network=host -v open-webui:/app/backend/data -e OLLAMA_BASE_URL=http://127.0.0.1:11434 --name open-webui --restart always ghcr.io/open-webui/open-webui:main
Unable to Access Open WebUI with Docker in Windows
If you notice above the container is created to only be accessable by “host” a.k.a. localhost. This is why you are unable to access Open WebUI with Docker in Windows from other computers / devices on the network.
Step 2: Ensure Docker is Running
Before you can access Open WebUI, make sure that Docker is running on your machine. To do this, run the following command:
sudo docker info
or start Docker if its not running
sudo service docker start
Step 3: Set the OLLAMA_HOST Environment Variable
Next, you’ll need to set the OLLAMA_HOST environment variable. This will allow you to access Open WebUI from other computers on your network. Use the following command:
set OLLAMA_HOST=0.0.0.0
Step 4: Reboot Windows
Rebooting your Windows machine is necessary to ensure that all of the changes take effect.
Step 5: Create an Inbound Firewall Rule
To allow incoming traffic on port 8080, you’ll need to create an inbound firewall rule. To do this, follow these steps:
- Name: ollama-webui
- Protocol: TCP
- Port: 8080
- Private network
Step 6: Create a Port Proxy
On the host machine: With your WSL 2 instance use the command ifconfig eth0
.
Take note of the inet IP address. (e.g.172.30.104.21)
If you get an error you may not have net tools installed. Something like this Command ‘ifconfig’ not found. Install with this command.
sudo apt install net-tools
Finally, you’ll need to create a port proxy using the netsh command. Run the following command in elevated PowerShell (run as Administrator):
netsh interface portproxy add v4tov4 listenport=8080 listenaddress=0.0.0.0 connectport=8080 connectaddress=<your_ip_address>
Replace <your_ip_address>
with the IP address of your Open WebUI machine, the one you took note of when you ran ifconfig eth0
.
Access Open WebUI with Docker in Windows
By following these steps, you should now be able to access Open WebUI from other computers on your network by visiting:
http://<open-webui-computers-ip-address-or-name>:8080/
Replace <open-webui-computers-ip-address-or-name>
with the IP address or name of your Open WebUI machine. With this remote-accessible Open WebUI installation, you’ll be able to access your Open WebUI from anywhere on your network.
Conclusion
In this step-by-step guide, we’ve walked you through the process of creating an Open WebUI container using Docker, setting environment variables, configuring firewall rules, and creating port proxies. With these steps, you should now have a fully functional Open WebUI installation that you can access from other computers on your network.