ollama
Ollama CORS & LAN Access
Environment Variables#
Set OLLAMA_HOST=0.0.0.0:11434 to allow LAN access, and OLLAMA_ORIGINS=* to allow all cross-origin requests.
macOS#
Ollama runs as a GUI app managed by launchd. Environment variables in ~/.zshrc do not affect it.
Set Environment Variables#
Then quit and relaunch Ollama from the menu bar.
Note:
launchctl setenvdoes not persist across reboots. To persist, runollama servemanually or create a LaunchAgent plist.
Verify#
Windows#
Set Environment Variables#
Then quit and relaunch Ollama from the Start menu.
Firewall#
Verify#
Linux#
Ollama runs as a systemd service. Use systemctl edit to configure environment variables. The host-level commands below assume you are already running in a root shell.
Set Environment Variables#
Add the following content:
Then reload and restart: