Local LLM server: a private AI server for a team
· 14 min read
From a model on your machine to a server others use
You already run a model on one machine, and now the household or a small team wants to use it from their own laptops, phones and editors, without sending prompts and documents to a third-party cloud. The job is not buying hardware. It is stacking three layers, each with a single responsibility: a model runner that only the layer above can reach, a front end or gateway that owns accounts and keys, and a private network path for anyone not sitting at the machine.
In practice, layer one is Ollama, the llama.cpp server or vLLM. Layer two is Open WebUI for people and, when scripts and tools need their own keys, the LiteLLM proxy. Layer three is a tailnet or VPN, plus a reverse proxy wherever something other than the tailnet has to handle TLS.
A common shortcut is to set OLLAMA_HOST so the server listens on every address and stop there. That is the kind of configuration, along with Docker port publishing, behind the exposed instances described further down. Your colleague's laptop gets an answer, and so does any other machine that can reach that address.
Privacy is not automatic either. A home server keeps prompts off someone else's cloud as long as it only serves local models (Ollama's cloud-hosted models, for instance, run on ollama.com, and Open WebUI can also be connected to outside providers), but who can read them still depends on the access layer, on what gets logged and on who holds admin rights. Every default described here was checked on 2026-11-13, and defaults change between releases, so recheck yours.
Layer one: keep the model runner private
Ollama listens only on the loopback address by default, and the bind address is changed with the OLLAMA_HOST environment variable. Its FAQ describes no authentication for the local API. The public key Ollama documents is for talking to ollama.com (pushing models, private models, cloud-hosted models), not for protecting your own server.
What the Ollama FAQ does document is an Nginx reverse proxy forwarding to the local port, which is the documented way to put a layer in front.
The llama.cpp server also binds to 127.0.0.1 by default and accepts one or more API keys with --api-key, according to the llama-server README listed in the sources under the table further down. There is none by default, so a llama.cpp server moved off loopback without a key answers anyone who can reach it.
vLLM needs more care, because its key covers only part of its API. When you start it directly on the host, pass --host 127.0.0.1 explicitly rather than relying on its default bind address. Its --api-key only authenticates requests under some path prefixes, such as /v1. Other endpoints, notably /invocations, which exposes the same inference capabilities, stay unauthenticated, and the vLLM documentation says not to rely on the key alone but to add hardening such as a reverse proxy.
The Docker trap
Ollama's official Docker commands publish the API port with a plain -p host:container mapping. When no host address is given, Docker publishes that port on all host addresses, IPv4 and IPv6, and its port publishing documentation calls publishing container ports insecure by default.
Worse, Docker routes published container traffic in the nat table before host firewall rules such as ufw's apply. A ufw rule that seems to block the port does not protect a Docker-published one, and a firewalld setup needs checking too, since Docker adds its own firewalld zone that accepts traffic. Both behaviours are described in Docker's packet filtering and firewalls documentation.
Where the runner runs changes the fix. Started directly on the host, it stays on localhost. Inside a container on a bridge network, it must listen on the container's own interface, not the container's loopback, or neither a published port nor another container can reach it: the official Ollama image already does, and llama.cpp's Docker examples pass --host 0.0.0.0.
Containers on the same bridge network reach each other's ports directly, whatever you publish, and one started without --network joins Docker's shared default bridge, as Docker's bridge network documentation describes. Give the runner a dedicated network holding only the components allowed to call it, point them at its container name, and it needs no published port. If processes on the host must reach it too, publish on the host's loopback only:
docker network create llm-private
docker run -d --name ollama --network llm-private -v ollama:/root/.ollama -p 127.0.0.1:HOSTPORT:CONTAINERPORT ollama/ollama
Drop -p when only containers on that network need the runner; take HOSTPORT and CONTAINERPORT from Ollama's own Docker instructions, and use the same pattern for a llama.cpp or vLLM container. Wiz's June 2024 write-up noted that the official image ran Ollama as root inside its container, exactly the case it calls more dangerous when the API is exposed; check whether the image you pull still does.
Layer two: accounts, roles and keys
Open WebUI is the front end for people. Out of the box it connects to Ollama and to OpenAI-compatible providers, including llama.cpp and vLLM, so the runner below stays swappable.
On a fresh install, the very first account created automatically becomes Admin. If the page is reachable before you sign up, whoever gets there first becomes the admin of your Open WebUI instance. Create that account yourself, from the machine or over the private path, before anyone else can load the page.
Sign-up closes automatically after that first account. To let your team in, reopen registration only while the instance is reachable solely over your private path, keep DEFAULT_USER_ROLE at pending so each new account waits for you, approve each person, then close registration again. The Open WebUI hardening guide advises against reopening registration on any instance reachable beyond a trusted network.
Pending users cannot see or do anything until an administrator promotes them. Once someone has the user role, two separate controls apply. Model access decides which models they can chat with: an admin or the model's owner shares a model with specific users or groups, or makes it public, and Open WebUI's models documentation states that read access lets a user chat with a model. Feature permissions, such as workspace access or sharing, are not implicit: they come from the global default permissions plus the groups the person belongs to, and they add up rather than restrict.
API keys are disabled for non-admin users by default. When enabled, a key carries the permissions of the user who created it, so a key leaked from an admin's script is an admin key. The guide recommends restricting each key to the routes it needs.
Programmatic clients: per-person keys with LiteLLM
When scripts, agents or editors need their own credentials, the LiteLLM proxy is the better gateway. As its virtual keys documentation describes, it issues virtual keys restricted to a list of models, tracks spend per key automatically, and supports budgets and rate limits. The cost is operational: it needs a Postgres database and a master admin key, which becomes the most sensitive secret in the setup.
An editor or coding assistant on another machine points at the server's OpenAI-compatible endpoint, with its key, over the private network path. The Windsurf and Ollama wiring guide covers only the editor side, with the model on the same machine; it does not cover the network path or the server layers described here.
Layer three: reaching it without opening it to the internet
For a household or a small team, Tailscale Serve is the sensible default. Serve makes a local service reachable only from devices on your tailnet, requires HTTPS certificates to be enabled in the tailnet, and adds identity headers naming the Tailscale user. When a backend uses those headers to authenticate requests, the Tailscale Serve documentation recommends that it listen only on localhost. Even when nothing reads the headers, publishing Open WebUI's and LiteLLM's ports with the 127.0.0.1 prefix keeps Serve as the only way in from other machines. Do not confuse it with Funnel, which exposes a service to the public internet.
Serve provides the HTTPS itself, from the tailnet's certificates, and once it does, the hardening guide's advice to set secure session cookies applies there too. Without Serve, on a plain VPN or LAN, Open WebUI does not terminate TLS itself, so its hardening guide says to put Nginx, Caddy or HAProxy in front, ideally behind a VPN or zero-trust access layer. The proxy is also where logging and, for raw runner APIs, bearer-token checks belong.
What exposure looks like in practice
Three independent studies show what skipping the layers looks like; methods and dates differ, so do not read them as one trend.
LeakIX, in February 2026, reported thousands of Ollama instances reachable on the public internet with no authentication. On those, anyone can list the models, run inference at the owner's expense, and pull or push model weights. LeakIX's write-up recommends localhost binding, nginx or Caddy with bearer-token authentication in front, a port restricted to trusted addresses, and logging at the proxy.
Intruder, in research published in March 2026, found unauthenticated Ollama APIs that answered a test prompt, exposed Open WebUI, Flowise and Langflow instances, and chat front ends leaking conversation history and, in one case, API keys. Its lab analysis of these applications also lists applications running as root among the poor deployment practices it found.
Wiz's Probllama write-up, from June 2024, described CVE-2024-37032, a path traversal flaw in Ollama model pulls leading to remote code execution, more dangerous in Docker deployments where the API was exposed and the server ran as root. Wiz's advice is to update, and never to expose Ollama to the internet without an authentication layer such as a reverse proxy.
Our reading of these sources together: the LeakIX, Wiz and Intruder advice and the Open WebUI hardening guide all point to the same layout. Keep these tools behind a tailnet, a VPN or an authenticated reverse proxy, never on a bare public port, and keep anything that runs as root away from any network it does not need.
What breaks when several people use it at once
Ollama's parallel processing enlarges the context by the number of parallel requests, so the memory needed grows with the number of parallel slots multiplied by the context length. Allowing more simultaneous users per model is a memory decision, not a free setting, and the VRAM sizing walkthrough does the arithmetic.
Ollama keeps several models loaded at once only if they fit in available memory. Idle models are unloaded after a keep-alive delay, so the colleague who arrives after a quiet spell waits for a reload. Once the queue is full, new requests are rejected rather than delayed. In Ollama these are environment variables: OLLAMA_NUM_PARALLEL for parallel requests per model, OLLAMA_KEEP_ALIVE for the unload delay, OLLAMA_MAX_QUEUE for the queue and OLLAMA_MAX_LOADED_MODELS for models held at once.
The llama.cpp server handles concurrency with continuous batching and parallel slots, which suits a shared server, but the slots draw on the context memory the server is given: more simultaneous users means either more memory or less context for each.
Before any of this, the model has to fit, and the table below is that floor: weights only, computed rather than measured, fully resident in memory (see the table's sources and notes).
| Model | Parameters (model card) | Q4_K_M (4.8944 bits/weight) | Q6_K (6.5633 bits/weight) | Q8_0 (8.5008 bits/weight) | F16 (16.0005 bits/weight) | Sources |
|---|---|---|---|---|---|---|
| Qwen2.5-7B-Instruct | 7.61 billion | 4.7 GB | 6.2 GB | 8.1 GB | 15.2 GB | [1] [2] |
| Qwen2.5-14B-Instruct | 14.7 billion | 9.0 GB | 12.1 GB | 15.6 GB | 29.4 GB | [1] [3] |
| Qwen2.5-32B-Instruct | 32.5 billion | 19.9 GB | 26.7 GB | 34.5 GB | 65.0 GB | [1] [4] |
| Qwen2.5-72B-Instruct | 72.7 billion | 44.5 GB | 59.6 GB | 77.3 GB | 145.4 GB | [1] [5] |
Each value is computed, not measured: parameters × bits per weight ÷ 8, in decimal gigabytes (1 GB = 10^9 bytes, slightly less than one GiB).
The bits-per-weight figures were measured by the llama.cpp project on Llama 3.1 8B files. Applied to other models they estimate the size of the weight file; they are not a measured size for that model.
llama.cpp's quantization README states that memory and disk requirements are the same because models are fully loaded into memory. The llama-server README is more nuanced: the server memory-maps the weight file (mmap) rather than locking it in RAM (mlock) unless asked to, and its --lazy-mode option reads certain tensors, such as per-layer embeddings, from disk on demand instead of keeping them resident. Reading from disk is slower than reading from memory, so the figures here describe the weights fully resident: to run at full speed, the weight file has to fit in RAM, in VRAM, or across both.
This table counts the weights only. It does not count the memory a runtime uses for the conversation context or its own buffers, so it is a lower bound, not a full hardware requirement.
Lower-bit formats trade quality for size. The table says what fits, not how well a given format answers.
Sources
- llama-quantize README, Memory/Disk Requirements and Quantization sections (measured on Llama 3.1 8B), ggml-org/llama.cpp (GitHub), read on 2026-10-05
- Qwen2.5-7B-Instruct model card, Qwen (Hugging Face), read on 2026-10-05
- Qwen2.5-14B-Instruct model card, Qwen (Hugging Face), read on 2026-10-05
- Qwen2.5-32B-Instruct model card, Qwen (Hugging Face), read on 2026-10-05
- Qwen2.5-72B-Instruct model card, Qwen (Hugging Face), read on 2026-10-05
- llama-server README, model loading options (--load-mode, --lazy-mode), ggml-org/llama.cpp (GitHub), read on 2026-10-12
Read it as a lower bound for one model: pick the row and format you plan to serve, then add the per-user context for the parallelism you allow and the runtime's own buffers. To choose the model for that budget, see the guide to the best local LLM for your hardware.
Before you invite anyone: a dated checklist
Checked on 2026-11-13 against the documentation cited above:
- Host-run services bound to localhost (vLLM with --host 127.0.0.1); containerised runners on a dedicated Docker network; every published port prefixed with 127.0.0.1, not left to ufw.
- Open WebUI admin account created by you, first; DEFAULT_USER_ROLE left at pending; registration reopened only while the instance is reachable solely over the private path, then closed again.
- API keys enabled only where needed and restricted to the routes they use, or LiteLLM virtual keys issued per person or per tool.
- Access through the tailnet with Serve, not Funnel, or through an authenticated reverse proxy with TLS; either way HTTPS is in place, so set Open WebUI's secure session cookies.
- Logging at the reverse proxy in front of any raw runner API, so requests from every user are collected, kept and audited in one place.
- Runner kept up to date and, where possible, not running as root; anything that does run as root (as Wiz reported for the official Ollama container in June 2024) reachable only from its dedicated network and the host's loopback.
- OLLAMA_NUM_PARALLEL, OLLAMA_KEEP_ALIVE and OLLAMA_MAX_QUEUE set deliberately for how many people use it at once.
A server several people rely on tends to stay on all day, and that costs something even when nobody is typing: memory held by models kept loaded by the keep-alive setting, electricity, and the amortised price of the hardware. The walkthrough on running an LLM locally covers those costs.
A home server like this is private only as far as its access layer and its admins are, and it makes no promise of matching a commercial assistant: what it gives you is control over where prompts go and who can send them.