Homelab

Exposing Ollama to Home Assistant and Open WebUI, safely

Ollama listens only on localhost and has no built-in authentication. Here's how to open it to exactly the clients that need it and nothing else.

2026-10-20
Illustration: Exposing Ollama to Home Assistant and Open WebUI, safely
Original illustration by SafeToUpdate (CC BY 4.0).

By default Ollama binds to 127.0.0.1:11434 (FAQ), so only the same machine can reach it. To use it from Home Assistant or Open WebUI on other hosts you have to open it up. Do that carefully, because the Ollama API has no authentication of its own.

1. Bind to the LAN, not the world

The FAQ shows how to set OLLAMA_HOST for the systemd service:

sudo systemctl edit ollama.service
# add:
[Service]
Environment="OLLAMA_HOST=0.0.0.0:11434"

sudo systemctl daemon-reload && sudo systemctl restart ollama

2. Firewall it to specific clients

Allow only the hosts that need it, e.g. with ufw:

sudo ufw allow from 192.168.10.20 to any port 11434 proto tcp   # Home Assistant
sudo ufw allow from 192.168.10.30 to any port 11434 proto tcp   # Open WebUI
sudo ufw deny 11434/tcp

You can also use the Proxmox VM firewall. Never port-forward 11434 to the internet. For remote access use a VPN such as Tailscale, or an authenticated front end.

3. Put people behind Open WebUI

Open WebUI adds user accounts and authentication on top of Ollama. Point it at your Ollama URL (e.g. OLLAMA_BASE_URL=http://ollama-vm:11434) and give humans Open WebUI rather than raw API access. If Open WebUI runs on the same host as Ollama, keep Ollama on localhost and skip the LAN exposure entirely.

4. Home Assistant: limit what the model can control

Add the Ollama integration with your Ollama URL and pick a model. If you let it control Home Assistant through Assist, only expose the entities you’re comfortable with an LLM operating (lights, yes; locks and alarm, think twice). Smaller models can misread requests.

Checklist

📬 The Weekend Patch Report

One email a week: what's safe to update, what will bite, and one practical tip for your homelab or printer.

Free, weekly, unsubscribe anytime.