Guide
Aug 24, 2026
OLLAMA_HOST=0.0.0.0 is the first line of most Ollama-remote-access advice, and it's also where a lot of that advice stops. It's worth being specific about what that line actually does before combining it with a port forward or a plain tunnel: Ollama's API has no built-in authentication. Anyone who can reach the port can list your models, run inference on them, and pull new ones, with no login, no rate limit, and nothing in your logs identifying who.
None of this requires a sophisticated attacker. Port scanners index the whole IPv4 space continuously, and an open Ollama port on a default port number gets found in hours, not months.
OLLAMA_HOST=0.0.0.0 if the goal is remote access; that's solving the wrong layer. Ollama should only ever answer 127.0.0.1.Authentication stops a stranger from reaching your models. It doesn't stop a model from being tricked by the content of a prompt, and it doesn't turn a system prompt into a secret. Treat anything you put in front of an LLM as something the LLM might eventually repeat back to whoever's talking to it, authenticated or not. That's a property of the model, not the transport, and no tunnel changes it.
The reasoning behind this tradeoff, and where the OpenAI-compatible path specifically stops being end-to-end encrypted, is laid out in full on the about page.