Is my Ollama exposed? A checklist to lock it down

By MV2 of Munim, Inc. Settings checked against the Ollama FAQ on 12 October 2026. For your own machines only.

Why it matters: Ollama's API has no login. Anyone who can reach port 11434 can list, pull, create and delete models, use your GPU, and reach every endpoint that this year's CVEs live in (see Ollama CVEs). Ollama binds to 127.0.0.1:11434 by default, which is safe. It usually gets exposed later, when OLLAMA_HOST=0.0.0.0 is set (or the app's "Expose Ollama to the network" setting is turned on) so another machine or a Docker container can connect, or when Docker publishes the port.

1. Check what it is listening on

127.0.0.1:11434 means only this machine can connect, and you're done with this step. 0.0.0.0:11434, *:11434, [::]:11434 or a Docker port like 0.0.0.0:11434->11434/tcp means other machines can connect too. To confirm, run curl http://<this machine's LAN IP>:11434/api/version from another device you own. A version number in the reply means the port is open to your network.

The free local-ai-checkup script runs these checks for you, along with the version, OLLAMA_ORIGINS and Docker port checks below. It's read-only and sends nothing off the machine.

2. If only this machine needs Ollama: bind it to localhost

Remove OLLAMA_HOST, or set it to 127.0.0.1:11434, and turn off "Expose Ollama to the network" in the app's Settings if it's on:

If you set OLLAMA_HOST=0.0.0.0 only so a Docker container could connect, there are ways that keep Ollama off your network: see Docker can't reach Ollama. If you set it so a laptop or phone could connect, see Use Ollama from another computer or your phone.

3. If you run Ollama in Docker

-p 11434:11434 publishes the port on every interface. On Linux, Docker writes its own firewall rules, so ufw and firewalld don't block it. Use one of these instead:

docker run -d --gpus=all -v ollama:/root/.ollama -p 127.0.0.1:11434:11434 --name ollama ollama/ollama

If Open WebUI (or n8n, Dify, Flowise) runs in the same Compose file, Ollama doesn't need a published port at all. The other container reaches it by service name:

services:
  ollama:
    image: ollama/ollama
    volumes: [ "ollama:/root/.ollama" ]
    # no "ports:" here - only containers on this network can reach it
  open-webui:
    image: ghcr.io/open-webui/open-webui:main
    environment:
      - OLLAMA_BASE_URL=http://ollama:11434
    ports: [ "127.0.0.1:3000:8080" ]
    volumes: [ "open-webui:/app/backend/data" ]
volumes:
  ollama: {}
  open-webui: {}

Recreate the containers after editing (docker compose up -d) and repeat step 1.

4. If other machines really need it: put a login in front

Bind Ollama to 127.0.0.1 as in step 2, then let a reverse proxy with authentication be the only way in. A minimal Caddy example (create the hash with caddy hash-password):

ollama.home.example {
    basic_auth {
        alice <hash from caddy hash-password>
    }
    reverse_proxy 127.0.0.1:11434 {
        header_up Host localhost:11434
    }
}

The Host line matters. The Ollama FAQ's proxy examples rewrite the Host header to localhost:11434, and requests with other Host values can be refused. A private network such as Tailscale or WireGuard is another option: only your own devices can reach the port, and nothing is published to the internet. Use Ollama remotely walks through an SSH tunnel, Tailscale (including why tailscale serve in front of Ollama returns 403) and a LAN-only firewall rule.

Apps rather than people? Open WebUI, n8n and OpenAI-style clients send an API key as Authorization: Bearer, which basic auth rejects. Ollama API key has Caddy and nginx configs that check a key, and the settings for each of those clients.

Tunnels: the FAQ also shows ngrok and cloudflared commands. On their own they publish your Ollama to the whole internet with no login. Only use them with the tunnel provider's access control turned on.

5. Leave OLLAMA_ORIGINS narrow

OLLAMA_ORIGINS decides which web pages your browser lets talk to Ollama. By default only local origins are allowed. Setting it to * lets any website you visit send requests to your local Ollama and read the replies. Add only the specific origins you need, such as one browser extension's ID instead of chrome-extension://*. The one-click browser check shows whether a website can read your Ollama (or LM Studio) right now.

6. If you run Open WebUI in front of it

7. Keep it current

Check your versions with the free CVE checker, which also covers vLLM, n8n, Dify, RAGFlow, AnythingLLM, Langflow, Flowise and LiteLLM, including advisories with no CVE ID. The Atom feed lists each update to this site.

Check a Compose file in your browser: paste your docker-compose.yml into the free AI Stack Check. It flags Ollama or ComfyUI published on every interface, Open WebUI with its login switched off, vLLM or LiteLLM without a key, secrets written into the file and a mounted Docker socket, and checks image versions against the same advisory list. The file is checked in your browser and is not uploaded.

Want it checked for you?

MV2 of Munim, Inc. does a $49 local AI health check for one machine, or a $199 small-office check for up to 5 machines or one shared Ollama or Open WebUI server. You get a written report of what's exposed, risky or slow and what to fix first, with exact commands for your OS, plus model picks that fit your GPU. See a sample report. Pay $49 or pay $199 on Stripe, then email mv2@munimtech.com the output of python3 local_ai_checkup.py --json, your OS, and what you use it for. MV2 never asks for passwords, keys or remote access.