HeadlinesBriefing favicon HeadlinesBriefing.com

How to Expose Ollama to Remote Networks

DEV Community •
×

Developers can now expose Ollama’s local AI server to external networks by configuring the OLLAMA_HOST environment variable. Setting it to 0.0.0.0 before launching the service opens port 11434 to all interfaces, turning a once‑local tool into a remote‑accessible endpoint for teams working across distributed environments and cloud infrastructure deployments today.

On Windows, the default listen address is 127.0.0.1, so a simple netstat check shows only localhost traffic. By exporting OLLAMA_HOST=0.0.0.0 in PowerShell or the system profile, users can verify the change with netstat again, seeing the service bind to 0.0.0.0:11434 and allow remote clients to connect directly from any network.

Linux users who run Ollama as a systemd service must edit the ollama.service file, adding an Environment line for OLLAMA_HOST=0.0.0.0:11434. After reloading the daemon and restarting, netstat confirms the service listens on :::11434, enabling SSH or VPN clients to reach the model endpoint for distributed teams working across multiple clouds.

Mac users benefit from a built‑in toggle, Expose OLLAMA to the network, but when launching via the desktop app, environment variables set in shell profiles are ignored. Creating a launchd plist that sets OLLAMA_HOST ensures the service starts with the correct binding, keeping the app lightweight and secure for developers.