Self-hosted LLM (Ollama) hardening
Ollama has no authentication of its own. Keep it off the public internet.
Free excerpt
Check the bind address
ss -tlnp | grep 11434 should show 127.0.0.1. OLLAMA_HOST=0.0.0.0 or -p 11434:11434 in Docker exposes it to everyone who can reach the port.
Test from outside
From another host: curl -s http://YOUR_IP:11434/api/tags. If it answers, anyone can use your GPU and models.
Put a gateway in front
nginx with TLS, API keys, rate limits and an allow-list of endpoints (for example only /api/chat).
Sandbox the service
Run under a dedicated user with systemd hardening options and keep models on a separate volume.
The paid runbook has the gateway config, systemd sandbox, Docker variant, GPU sizing, monitoring and an ollama-audit.sh exposure check.
Get the full pack
Sats Werkstatt
Self-Hosted LLM (Ollama) Hardening & Ops Runbook + PackRun Ollama safely on a server: loopback bind, nginx gateway with TLS, API keys, rate limits and endpoint allowlist, systemd sandbox, Docker variant, GPU sizing, monitoring, updates. PDF + configs + ollama-audit.sh exposure check. English.
9,000 sats English
Buy with Lightning
سیلف ہوسٹڈ LLM (Ollama) سیکیورٹی رن بُک + ٹیمپلیٹسOllama سرور کو محفوظ چلائیں: loopback bind، TLS والا nginx گیٹ وے، API keys، ریٹ لمٹ، systemd sandbox، Docker، GPU سائز، مانیٹرنگ اور اپڈیٹس۔ اردو PDF + کنفیگ فائلیں + ollama-audit.sh چیک اسکرپٹ۔
3,000 sats اردو
Buy with Lightning