PortGate

Resources · Port reference · port 11434

Port 11434 (Ollama): what it is and how to secure it

Ollama on port 11434 has no login. If it listens on a public address, anyone can use your GPU, list and delete your models.

Check command

sudo ss -tlnp | grep 11434

Copied.

Port 11434 is the Ollama API, and it has no authentication. Keep it on 127.0.0.1. If it is reachable from the internet, anyone can run prompts on your hardware, pull large models onto your disk and delete the ones you have.

What port 11434 is for

Ollama serves local language models over a small HTTP API on port 11434. Open WebUI, coding assistants, LangChain apps and scripts call it to generate text and embeddings. By default Ollama listens on 127.0.0.1:11434, which is safe.

How it ends up on the internet

Two settings change that:

  • OLLAMA_HOST=0.0.0.0 makes Ollama listen on every interface. Guides suggest it so another machine or a container can reach it.
  • Docker's -p 11434:11434 publishes the container port on every interface of the host.

On a home network that exposes it to the LAN. On a VPS, every interface is the internet.

Why an open Ollama is dangerous

The API has no users, keys or permissions. Anyone who can reach it can:

  • run prompts and embeddings on your CPU or GPU, which costs you money and slows your apps;
  • call /api/pull to download many gigabytes of models and fill the disk;
  • call /api/delete to remove your models;
  • list your models and their system prompts with /api/tags and /api/show.

Search engines that index the internet tag Ollama servers by this port, so exposed servers are easy to find.

Check yours

sudo ss -tlnp | grep 11434
docker ps --format '{{.Names}}  {{.Ports}}' | grep 11434

127.0.0.1:11434 is fine. 0.0.0.0, * or [::] is not. Then test from another machine:

curl -s http://YOUR_SERVER_IP:11434/api/tags

A JSON list of models means it is public.

Fix it

For the systemd service, set the bind address in an override:

sudo systemctl edit ollama

Add these lines, save, then restart:

[Service]
Environment="OLLAMA_HOST=127.0.0.1:11434"
sudo systemctl restart ollama

For Docker, publish on loopback, or remove ports entirely if only Open WebUI in the same Compose file uses it:

services:
  ollama:
    image: ollama/ollama
    ports:
      - "127.0.0.1:11434:11434"
  open-webui:
    image: ghcr.io/open-webui/open-webui:main
    environment:
      - OLLAMA_BASE_URL=http://ollama:11434

Repeat the curl test from outside. It should time out.

If you need remote access

  • One person: an SSH tunnel, ssh -L 11434:127.0.0.1:11434 you@YOUR_SERVER_IP.
  • A team or a laptop on the move: a VPN such as WireGuard or Tailscale, with Ollama bound to the VPN address.
  • An app on another server: a reverse proxy on 443 that checks an API key, with Ollama still on localhost.

Common mistakes

  • UFW rules with Docker. A Docker-published 11434 skips UFW, so the firewall shows "deny" while the port answers.
  • Fixing Ollama but not the web UI. Open WebUI (often 3000 or 8080) and image tools on 7860 or 8188 need the same check.
  • Leaving OLLAMA_ORIGINS=*. It lets any website's JavaScript call a reachable Ollama.

FAQ

Does Ollama have an API key setting? Not for its own API. Put authentication in front of it with a reverse proxy, or keep it private.

Is it fine on my home network? Safer, but any device on the LAN can still use it. Bind to localhost unless other devices need it.

How do I get warned if it opens again? PortGate's Server Guard flags AI ports such as 11434 as soon as they listen on a public address, and the AI & Edge Guard can sit in front of model APIs with request caps.