unauth

← fix library

CRITICAL Ollama: Ollama API open to the internet

Why it matters

Anyone on the internet can talk to your Ollama server: list your models, run inference on your GPU (you pay the power/hardware bill), and pull or delete models. Exposed Ollama instances are scanned for within hours of going online — this is one of the most commonly found exposed AI services, with well over a hundred thousand of them visible on the public internet.

Fix it — 3 steps

  1. Bind Ollama to localhost only: set OLLAMA_HOST=127.0.0.1 (e.g. `sudo systemctl edit ollama` → add `Environment="OLLAMA_HOST=127.0.0.1"`), then `sudo systemctl restart ollama`.
  2. If you need remote access, keep it on 127.0.0.1 and front it with a reverse proxy (Caddy or nginx) that enforces authentication and TLS.
  3. Also block the port at the firewall as a seatbelt: `sudo ufw deny 11434`.

Verify it’s fixed

curl -m 5 http://YOUR_SERVER_IP:11434/api/tags  # should time out / connection refused; curl http://127.0.0.1:11434/api/tags on the server itself should still work

References

Not sure if your stack is exposed?

Run the free check — 30 seconds, safe read-only probes.

Scan your stack