All Articles

Your AI Stack Is Exposed: Securing Ollama and Local Inference from the Inside

Local AI is private by default — but only for the prompts. The moment you put Ollama or Open WebUI on a real network, you've built a new attack surface, and most small businesses never lock it down.

We've been pushing local AI hard here — and the math is real: Ollama on your own hardware beats renting tokens from somebody else's cloud. But there's a flip side that gets skipped in the enthusiasm: your local LLM endpoint is an API server now. It binds to a port, accepts JSON over HTTP, and happily answers whoever asks. That's the exact shape of every service you've ever put a firewall in front of.

Treatment like that matters, because in 2026 your local AI is not a toy. It's wired into your email drafts, your client notes, maybe your code review or bookkeeping. A misconfigured Ollama on a home assistant box is now a data-exfiltration path — not theoretical, but the sort of thing a red team will tick off in the first hour of an assessment.

What you're actually deploying

Ollama serves on TCP port 11434 — an OpenAI-compatible REST API. Open WebUI, the polished chat interface you layer on top, listens on 3000 (or 8080). Both default to 127.0.0.1 — local-only, no network exposure. That's the secure path, and it's why everything works out of the box.

The moment you bind to 0.0.0.0 — so your phone can hit the GPU server, or your work laptop can drive the office rig — you've told any host on the network (or the internet, if port-forwarding is sloppy) exactly how to talk to your model. No auth, no TLS, no logging.

Five controls, in order of priority

1. Verify the bind address — every time

After every Ollama update or config edit, run ss -tlnp | grep 11434 (or netstat on macOS). It must say 127.0.0.1:11434 or [::1]:11434 — nothing else. Anything starting with 0.0.0.0 or * means the API is public.

2. Put Open WebUI behind your reverse proxy

Open WebUI can be locked down, but the safest pattern is the same as any internal dashboard: terminate it at your reverse proxy (nginx, Caddy, Traefik) and let that handle:

Nginx block: one location / { proxy_pass http://127.0.0.1:8080; } and a allow 10.0.0.0/8; deny all; line. That's it.

3. Segment it on the LAN

Even on a trusted network, run the AI stack in its own VLAN or subnet. Firewall rule: the AI host can talk to DNS and outbound internet (for pulling models), but only the proxy container may reach the API ports. If the model box gets hit laterally from a compromised laptop, it stays contained.

4. No public ingress, ever

Router port forwarding to 11434 or 3000 is a red line. There are no circumstances where a LLM endpoint deserves a public IP — not for convenience, not for a test. If remote access is needed, it's WireGuard into your VPN segment, then treat the AI API like it's still internal.

5. Watch the logs

Ollama itself is quiet, but the proxy access log is your tripwire. Watch for:

Sixty seconds of log-watching catches more than an hour of hoping nobody sees the open port.

A five-line audit you can run tonight

  1. ss -tlnp | grep -E "11434|3000|8080" — confirm local-only binding.
  2. curl http://127.0.0.1:11434/api/version — should answer; curl http://<external-ip>:11434/api/version — should time out or refuse.
  3. Review nginx/Caddy config: allow rules present? TLS cert current? Auth enabled?
  4. LAN scan from another machine: nmap -p 11434,3000 <ip-of-ai-host> — both should show closed or filtered.
  5. Read the last 10 lines of your proxy log: any IPs you don't recognize?

All five pass and you're in a solid internal posture. One fails and you've got an hour of real work — but it's work that now protects every LLM workflow on the box, not just this one server.

Local AI's biggest selling point is control. Don't give the control back by leaving the front door unlocked.

Ready to Lock Down Your AI?

GRAYTECH.ONE audits and hardens local AI deployments — from a single-box Ollama setup to multi-host inference across your network. One engagement, a written hardening report, and the fixes applied live.

Schedule a Consultation