By default, Ollama only listens on localhost. That means only the machine running Ollama can send requests to it. If you want another device on your network to connect, whether that is a second PC, a phone, or a tool like Open WebUI running elsewhere, you need to expose Ollama to the network. On Windows, this is done by setting an environment variable. The whole process takes under two minutes.
Why Ollama Is Locked to Localhost by Default
When Ollama starts on Windows, it binds to 127.0.0.1 on port 11434. This is the loopback address, which means any request coming from a different device is refused before it even reaches Ollama. This is intentional. It prevents Ollama from being accidentally accessible to other devices or networks without your knowledge.
To open it up to your local network, you need to tell Ollama to listen on 0.0.0.0 instead. This instructs it to accept connections on all available network interfaces, making it reachable at your machine's local IP address from any device on the same network.
How to Set the OLLAMA_HOST Variable on Windows
Windows Ollama reads environment variables from your user account. The correct way to set this is through the System Environment Variables panel, not through the command line, since command line exports are temporary and do not persist after closing the terminal.
- Right-click the Ollama icon in the system tray at the bottom right of your taskbar and select Quit. Ollama must be fully closed before the new environment variable takes effect.
- Open the Start menu and search for Environment Variables. Click Edit the system environment variables from the results.
- In the System Properties window that opens, click the Environment Variables button at the bottom right.
- Under the User variables section at the top, click New.
- In the Variable name field, type OLLAMA_HOST. In the Variable value field, type 0.0.0.0. Click OK to save.
- Click New again to add a second variable. Set the Variable name to OLLAMA_ORIGINS and the Variable value to an asterisk, which is the star symbol on your keyboard. Click OK.
- Click OK to close the Environment Variables window, then OK again to close System Properties.
- Relaunch Ollama from the Start menu.
That is all that is required. Ollama will now listen on all network interfaces instead of just localhost.
Finding Your Windows Machine's Local IP Address
Once Ollama is running with the new settings, other devices connect to it using your Windows machine's local IP address rather than localhost. To find that address, open Command Prompt by pressing Windows key + R, typing cmd, and pressing Enter. Then type the following command and press Enter:
ipconfig
Look through the output for your active network adapter, which will be labeled either Ethernet adapter or Wireless LAN adapter Wi-Fi depending on how you are connected. Find the line that shows IPv4 Address and note the number next to it. It will look something like 192.168.1.50 or 192.168.0.100.
Other devices on your network can now reach Ollama at http://YOUR-IP-ADDRESS:11434, replacing YOUR-IP-ADDRESS with the number you found.
Verifying It Is Working
To confirm Ollama is now accessible on the network, open a browser on another device connected to the same Wi-Fi or network and visit:
You should see a plain page that says Ollama is running. If you see that message, the setup is complete and any device on your network can now send requests to your Ollama instance.
If the connection is refused or times out, the most likely cause is Windows Firewall blocking incoming traffic on port 11434. To allow it, open the Start menu and search for Windows Defender Firewall. Click Advanced settings, then Inbound Rules, then New Rule. Select Port, click Next, choose TCP, enter 11434 as the specific port, click Next, select Allow the connection, and finish the wizard. Try connecting again after adding the rule.
Security Consideration
Exposing Ollama to your local network means any device on that same network can send requests to it. On a trusted home or small office network, this is generally fine. However, you should never forward port 11434 through your router to the public internet. Doing so would expose your Ollama instance to anyone on the internet, with no authentication in place. If you need remote access from outside your home network, use a VPN solution like Tailscale instead.
Final Thoughts
Exposing Ollama to the network on Windows is a two-step process. Set OLLAMA_HOST to 0.0.0.0 and OLLAMA_ORIGINS to an asterisk in your user environment variables, restart Ollama, and every device on your local network can start using your models through Ollama's API. It is one of those changes that takes two minutes to set up and immediately expands what you can do with locally running AI models.
Frequently Asked Questions
Why can other devices not connect to Ollama on my network?
Ollama binds to 127.0.0.1 by default, which only allows connections from the same machine. Setting the OLLAMA_HOST environment variable to 0.0.0.0 makes Ollama listen on all network interfaces, allowing other devices to connect using your machine's local IP address.
Do I need to restart Ollama after setting the environment variable?
Yes. Environment variable changes on Windows only take effect when the application is restarted. Quit Ollama from the system tray before making the change, then relaunch it from the Start menu after saving the environment variables.
What is the OLLAMA_ORIGINS variable for?
OLLAMA_ORIGINS controls which origins are allowed to make cross-origin requests to Ollama. Setting it to an asterisk allows requests from any origin, which is necessary when connecting from browser-based tools or applications running on other devices. Without this, cross-origin requests from other machines may be blocked.
How do I find my Windows machine's IP address to share with other devices?
Open Command Prompt and type ipconfig, then press Enter. Look for the IPv4 Address under your active network adapter. It will be a number in the format 192.168.x.x and is the address other devices use to connect to your Ollama instance.
Is it safe to expose Ollama on my local network?
It is safe on a trusted private network. Any device on the same network will be able to send requests to Ollama, so make sure you trust the devices around you. Do not forward port 11434 through your router to the internet, as Ollama has no built-in authentication and would be accessible to anyone.



Discussion (0)
Be the first to comment.