Network isolation and egress control for Ollama servers

Ollama needs outbound access only when it pulls models or when cloud features are enabled, so the host can be locked down to a proxy or to no egress at all. This page explains the options, the setup sequence and what to confirm in your environment.

On this page

Network isolation and egress control for Ollama servers: why it matters for a shared host

This section explains how to limit what an Ollama host can reach on the network, and why that limit matters once a shared server may hold proprietary or regulated data and sit on a network with internet access. Local inference does not need outbound internet access. Model pulls, cloud models and web search do, so the decision to allow outbound traffic is really a decision about which of those features your organization accepts. Out of the box, Ollama binds to 127.0.0.1 on port 11434, so only processes on the host itself can reach the API. The risk starts when someone changes the bind address with OLLAMA_HOST to serve other machines, because the default API has no authentication of its own.

Teams need this control in three common situations. The first is regulated or sensitive data, where prompts, documents and outputs must stay inside a boundary your compliance team has defined. The second is an air-gapped or restricted network, where the host should have no route to the internet and models arrive through an approved transfer process. The third is a shared server used by several departments, where one team's pulls, logs and client connections should not be able to reach systems another team controls. Before you change anything, confirm with your own security and network teams which destinations the host may reach, which may reach it, and whether model pulls must pass through a proxy. Ollama's FAQ describes the proxy pattern and is a sound starting point for that conversation.

Ask three questions before you write firewall rules: what does the server need to fetch, who needs to connect to it, and what must never leave it. The answers set the scope of the work. A host that only serves a fixed set of approved models may need no outbound access after its models are loaded, while a host that pulls new models on demand needs a narrow path to the model registry, ideally through a proxy you control. Record those answers as the baseline, because the rest of this page tests against them. Plan for these checks to be repeated after every upgrade, since changes to a release or to the configuration file can alter which connections the process makes.

Which egress model fits your Ollama server

This table compares four ways to control outbound traffic from an Ollama host, from no egress at all to open egress with cloud features disabled. Read each row against your own rules for where models come from and what the server may contact. The main takeaway is that the stricter the model intake rules, the more the team must own the process for moving approved weights onto the host.

Egress modelWhat it allows and blocksWho maintains itWhen it fits
No egress, internal model storeAllows only traffic to your internal artifact store or file share holding approved weights. Blocks all internet destinations, including model pulls and ollama.com.Your platform team maintains the import path, checksums and the approved model list.Regulated environments where the server must not initiate any outbound connection and model intake is already a controlled process.
Egress to a model pull proxyAllows outbound connections only to a named proxy that fetches models from the registry. Blocks direct internet access and all other destinations.Platform or network team maintains proxy allow lists, logging and access rules.Teams that need a steady stream of registry pulls but want one audited path out of the network.
Separate pull host syncing to serving hostsA dedicated host reaches the registry and copies approved models to serving hosts, which have no internet route. Serving hosts accept only internal sync and client traffic.Platform team runs the pull host, sync job and approval record. Security team reviews the allow list.Multiple Ollama servers that must share one reviewed set of model versions with a clear record of what each host received.
Open egress with cloud features disabledAllows general outbound access, while OLLAMA_NO_CLOUD=1 or the server configuration file turns off cloud features. Does not block model registry or other internet destinations.Server administrators maintain the setting. Network team maintains any general egress rules.Lower-risk internal tools where the main concern is keeping prompts local, not controlling every outbound connection.

How to lock down outbound traffic on an Ollama host

This sequence takes an Ollama host from unknown outbound behavior to a documented state where it listens only on a deliberate private address and can reach only the hosts it needs. Each step ends with a check so the result can be verified rather than assumed.

  1. Inventory current outbound connections

    Before changing anything, the platform team records what the host already talks to. Run ss -tnp or netstat -tnp on Linux while Ollama is pulling a model and serving a request, and capture the remote addresses and ports of the ollama process over a few days of normal use. Log DNS queries from the host if your resolver allows it. Done means you have a written list of destinations, ports and the process responsible for each, which becomes the baseline for every later check. Confirm the full set of hosts Ollama contacts against the current Ollama FAQ and the release in use, because the list can change between versions.

  2. Disable cloud features with OLLAMA_NO_CLOUD

    Set OLLAMA_NO_CLOUD=1 in the service environment, or the equivalent setting in the server configuration file, so the host stops reaching cloud model and web search endpoints. Restart the service and confirm the setting took effect in the server logs, since the log output is how you verify it was read. Then repeat the inventory from step one and compare. Done means the cloud-bound connections from the baseline no longer appear, and any remaining outbound traffic is attributable to model pulls or other named needs.

  3. Set OLLAMA_HOST to a private interface

    Ollama binds to 127.0.0.1 port 11434 by default. If other hosts must reach the API, set OLLAMA_HOST to the address of a specific private interface rather than to all addresses, and keep the port at 11434 unless you have a reason to change it. The API has no built-in authentication for local access, so this bind decision is the first control, not the last. Done means ss -ltnp shows the ollama process listening only on the intended private address and port, and a connection attempt from an unapproved network segment fails.

  4. Apply default-deny egress firewall rules

    Set the host firewall, such as nftables, iptables or the cloud security group, to drop outbound traffic by default and allow only the rules you need. Keep established return traffic and DNS to your approved resolver. Apply the rules on a staging host first, and keep console or out-of-band access available in case a rule blocks management traffic. Done means the default policy for the output chain is drop, and the written rule list matches the destinations you intend to keep.

  5. Allow only the pull proxy or pull host

    If models must be pulled, permit outbound HTTPS only to a named internal proxy or a single pull host, and nothing else. Alternatively, leave egress fully closed and import approved weights from a controlled transfer path, which removes the pull path entirely. Confirm which hosts the model pull uses in the current Ollama documentation, since the registry endpoints are not something to assume. Done means a test pull through the approved path succeeds, while the same request sent directly to an external registry host fails.

  6. Test that blocked destinations fail

    From the Ollama host, attempt connections to a sample of destinations that must be blocked, including public internet addresses and the cloud inference endpoints at ollama.com, using curl with a short timeout. Record the result of each attempt. Also test from an approved client that the serving address still answers. Done means every blocked destination times out or is refused, every approved path succeeds, and the results are saved alongside the firewall configuration as evidence.

  7. Monitor outbound connections on an ongoing basis

    Forward firewall drop logs and the Ollama process's connection records to your logging platform, and alert on any new destination or any drop from the Ollama host. Repeat the test set after each Ollama upgrade, because release changes can add or change endpoints. Review the destination list on a schedule your security team sets. Done means alerts reach a named owner, and an upgrade triggers a repeat of the inventory and test steps before the new version serves production traffic.

Separating model pull hosts from serving hosts

The most direct way to limit egress on an Ollama estate is to make one host the only machine that talks to the model registry. Call it the pull host. It is the only server with an outbound route to the public registry, and it runs under a restricted egress policy that allows the registry hosts and nothing else. Serving hosts have no route to the internet at all. They receive model files only from an internal transfer path. Ollama stores models in a directory that can be moved with the OLLAMA_MODELS variable, so the serving hosts can point that variable at a storage location that the transfer process fills with approved files. Confirm the exact registry hostnames and any proxy requirements against the Ollama FAQ and your own egress logs before writing the firewall rules.

This design has real costs. Someone must run the pull host, keep it patched, and own the transfer process, which is recurring operational work rather than a one-time setup. Version drift is the main risk: if each serving host pulls or copies models on its own schedule, the fleet can end up running different model versions and different Ollama releases, and nobody may know which one answered a given request. Record the model digest, source, and Ollama version per host, and treat any mismatch as an incident. The transfer path also becomes a security boundary. Control who can write to the staging area, verify checksums before files are copied across, and log every transfer. Without those controls, the internal copy step quietly recreates the uncontrolled intake you were trying to prevent.

The pattern also gives your team a natural checkpoint for model intake review. Because nothing reaches a serving host until it has passed through the pull host and the staging area, you can hold files there while licenses, provenance and scans are checked and the approved set is recorded. Serving hosts then run only what has been approved. Decide before rollout who signs off on a model, how rejected files are removed from staging, and how emergency updates are handled without bypassing the review. The intake process itself is covered in the vetting section of this group, so the decision here is mainly where the gate sits and who controls it.

How traffic flows between clients, the serving host, the pull proxy and the internet

The diagram starts with users and applications on the internal client network, which reach the Ollama serving host on port 11434 and nothing else outside. The serving host has no route to the internet for inference. When a model must be pulled, the request goes to a separate pull proxy, which is the only host allowed to leave the network, and the downloaded weights land in the model store on the serving host. Check that every outbound path passes the monitored boundary and that the serving host's egress rules block direct internet access.

Only the pull proxy leaves the network, and every outbound path is logged.

Security and operational risks of unrestricted egress

An Ollama host with open outbound access and an API that accepts any caller carries risks that compound each other. The cards below pair each risk with the control that limits it and the check that proves the control still works after changes.

Unauthenticated API reachable from the network

The local Ollama API at localhost:11434 does not require authentication, so anyone who can reach the port can send prompts and pull models. Network reach equals access. Keep the default 127.0.0.1 binding unless a deliberate change is made through OLLAMA_HOST, and confirm with a port scan from another subnet that 11434 is closed to users who should not have it. Put an authenticating proxy or gateway in front of any shared listener.

Ollama API authentication

Outbound cloud and feature calls

Ollama's cloud features send requests to ollama.com, including direct cloud inference that uses an API key sent as a Bearer token. On a host that must keep data local, these outbound calls are unwanted traffic. Set OLLAMA_NO_CLOUD=1 or the server configuration file, then confirm the setting in logs. Block outbound HTTPS to ollama.com at the firewall so the application setting is not the only control.

Model pulls from unvetted sources

A host allowed to pull models from any registry can load weights nobody reviewed, with licenses nobody checked. Restrict egress to the approved pull endpoint only, through a proxy with an allowlist, and route model intake through a review step before weights reach the serving host. Verify by attempting a pull of a model outside the allowlist and confirming it fails and is logged.

Proxy misconfiguration that leaks traffic

A proxy that is set for some processes but not others can let model pulls or cloud calls bypass the intended route. Environment variables such as HTTP_PROXY and HTTPS_PROXY must reach the Ollama service process, not only the shell. Test from the service account with a clean environment and confirm that traffic leaves only through the proxy and that the proxy log records each destination.

Firewall drift after upgrades

Ollama ships frequent releases, such as v0.40.5 on 14 October 2026 and v0.40.6 as a pre-release on 16 October 2026, and an upgrade can change network behavior or the endpoints a host contacts. Rules written for one version may silently stop blocking or start breaking pulls. Record the egress rule set as code, rerun the outbound tests after each upgrade, and review the release notes for network changes.

Ollama GitHub releases

Outbound connections nobody monitors

Without logging of outbound connections, a host can contact unexpected destinations for weeks before anyone notices. Forward proxy and firewall logs for the Ollama host to your monitoring system, and alert on any destination outside the approved list. Ask your team to confirm who receives those alerts and how quickly they are reviewed, since this is an operating commitment that continues after the build.

How to monitor outbound connections from an Ollama server

What outbound connections should I monitor on an Ollama server?

Monitor every outbound connection the Ollama process makes, because on a host meant for local inference the only expected outbound traffic is model pulls to a known registry host, and occasionally cloud calls if you allow them. Any connection from the Ollama process to other destinations is worth investigating. Record the destination IP, port, hostname, byte counts and time. Ask your security team which destinations are approved, then alert on anything outside that list. Confirm whether your environment uses a proxy, since proxied traffic will show the proxy as the destination.

How do I tie outbound traffic to the Ollama process?

Network logs alone show a host, not a process, so attribution needs host-level data. Use process-aware telemetry where your endpoint or host tools support it, such as process names and PIDs attached to socket events, or auditd rules and similar kernel auditing on Linux. Run Ollama under a dedicated service account so its traffic is easy to separate from other workloads. Confirm with your platform team which of these your existing tools can provide before you design alerts around them.

Should I log DNS queries from an Ollama host?

Yes, DNS is often the first signal of unexpected egress, because a host must resolve a name before it connects. Log queries made by the Ollama host, including the name requested, the response, and the time. Alert on lookups for hosts outside the approved registry list and on bursts of lookups that do not match a pull. Keep in mind that DNS logs can show requests that were blocked at the firewall, which makes them useful for spotting attempted egress. Confirm where your resolver logs are stored and how long they are kept.

What firewall and flow logs do I need for Ollama egress?

Collect denied and allowed events from the host firewall, plus flow records from the network layer if your infrastructure produces them. Host firewall logs show which rules matched, which is what you need to prove that egress control works. Flow logs, such as those from your cloud provider or switches, show volume and destination across many hosts. Make sure the Ollama host's logs include a rule label so a blocked event can be traced to the policy that blocked it. Confirm which flow log feature your cloud or network platform offers and whether it is enabled for the subnet.

What should trigger an alert when the Ollama listening address changes?

Alert on any change to the address Ollama listens on, because the default bind is 127.0.0.1 on port 11434 and a change to OLLAMA_HOST can expose an API that has no built-in authentication. Watch the service configuration file, the environment of the Ollama service, and the listening sockets reported by the host. Treat a new listener on a non-loopback interface as a high-priority event. Also alert when the Ollama process starts, restarts or is reconfigured outside a change record. Confirm how your configuration management tool reports drift.

How do I send Ollama host logs to a SIEM?

Forward host, firewall, DNS and service logs to your SIEM using the collector your organization already runs, and normalize the fields so that a host name, process, destination and rule can be correlated. Build a detection that combines a new outbound destination with a recent pull or configuration change, since that combination is more informative than either event alone. Keep the rules versioned and test them with a deliberate pull from an approved registry. Confirm which SIEM and forwarding agents your team already operates before committing to a design.

Can DeployOpen set up egress monitoring for our Ollama servers?

DeployOpen plans, implements, hardens and documents self-hosted open-source platforms inside your own infrastructure, so monitoring for Ollama hosts can be part of an implementation scope if you ask for it. The written scope would list which log sources, rules and SIEM integrations are included, and which stay with your team. Monitoring work usually depends on logging tools you already run, so the first step is an inventory of those tools. A quote follows from that agreed scope, and the cost depends on how many hosts, log sources and detections are involved.

Limits to confirm in your environment before you lock egress

Egress rules written from documentation alone tend to break model pulls, Docker installs or Ollama upgrades at the worst moment. The checks below connect the destinations, installer paths, proxy behavior, update path and intake workflow that decide whether a locked-down host still works.

Exact destinations for the installed version

Before writing any allowlist, record the hostnames and ports your installed Ollama build actually contacts during a model pull and during normal serving. Do not copy a destination list from a blog post or an older guide, because the set of hosts a build uses can change between releases. Capture traffic on a test host running the same version, then compare the result with your firewall rules. Treat anything outside the list as a finding to explain before you allow it.

Ollama FAQ

Docker and Windows installs

The install method can change which processes make outbound connections and where traffic leaves the host. A container image, a native Linux service and a Windows desktop install may each need different rules, and a container may need its own egress policy separate from the host firewall. Test each packaging method you deploy, and confirm that the rules apply to the process or network namespace that actually makes the connection.

Ollama GitHub repository

Proxy support for model pulls

If egress must pass through a proxy, confirm in your version's documentation and in a test pull that the client honors your proxy settings for model downloads. Check how the proxy handles large transfers, timeouts and TLS inspection, since a proxy that rewrites certificates can break pulls. Do not assume that a setting used for other tools applies to Ollama. Record the exact proxy configuration that passed the test so that it survives service restarts.

Effect of blocked egress on Ollama updates

Ollama ships releases frequently, so a host that cannot reach the release source will not receive fixes unless you move the binary through an internal process. Decide before you lock egress whether updates come from an internal mirror, a staged package repository or a manual transfer. Review the release notes on GitHub for each version you plan to adopt, and confirm that your update path can deliver security fixes within your patch window.

Ollama GitHub releases

Pull workflow against your intake policy

Pulling a model is an intake event. Confirm whether your model intake policy allows the host to fetch weights directly from a public registry, or whether every model must first be downloaded, checked for source and license, and then imported. If intake requires review, the serving host should have no path to the registry at all. Document who approves a pull, where it is logged, and how the approved artifact reaches the serving host.

Questions buyers ask about isolating Ollama

Does a local Ollama server need internet access to run models?

No. For local inference, Ollama runs models on your own hardware and the local API on localhost:11434 does not need an outbound connection to answer prompts. Internet access matters at a few specific points: pulling model weights from the registry, using cloud models or web search, and any update checks you leave enabled. Ollama states that when it runs locally it does not see your prompts or data. The practical question is therefore which of those outbound paths you need, and which you can block. Confirm the exact behavior for your installed version in the Ollama FAQ and by testing with outbound traffic blocked.

What drives the cost of an Ollama network isolation project?

The cost follows the number of hosts, the number of outbound paths you must control, and how many environments you run. The main components are the design of the network zones and firewall rules, the build of a pull path (a proxy or a staging host that downloads approved model files), monitoring of outbound connections, and testing that proves blocked traffic stays blocked. Costs that recur include rule reviews, proxy maintenance and retesting after Ollama upgrades. Ask any partner for a written scope that lists each host, each allowed destination and each test, because those items set the quote. Internal labor costs follow the same drivers.

What does the isolation work need from our network and security teams?

It needs time and decisions from both teams before any configuration changes. Network engineers provide the current segmentation, firewall and proxy setup, DNS resolution and any existing egress allowlists. Security teams define which destinations are approved, who may pull models, how outbound logs are retained and who reviews exceptions. Both teams should agree on a test method and a change process. Expect to provide access to a test environment, change windows for the serving hosts and a named owner who signs off on each allowed destination. Without those decisions, a project tends to stall at the firewall review.

How long does an Ollama isolation project take?

Duration depends on scope and must be quoted from a written plan. The number of serving hosts, the choice between a pull proxy and a fully offline model transfer, the state of your existing network controls and the amount of logging you require all change the schedule. No duration is set in this guide. Ask a partner to break the timeline into discovery, design, build, testing and handover, and to name the change windows and reviews each phase depends on. Ask your internal team for the same breakdown so the two estimates can be compared.

Can our internal team isolate Ollama servers without outside help?

Yes, if your team already runs firewalls, proxies and host-level logging and has someone who can test outbound behavior. Ollama's configuration is small: the bind address is set with OLLAMA_HOST, and model storage is set with OLLAMA_MODELS. The harder work is the surrounding control set: the allowlist, the proxy or offline transfer process, the monitoring rules and the evidence you keep. Teams without that experience often underestimate the testing and the recurring review. An outside partner can take on scoped parts of the work, such as the design, the build or the test plan, while your team keeps ownership of the rules.

Do Ollama's paid plans change the network requirements?

Only if you use the cloud features. Ollama's pricing page states that running models on your own hardware is always unlimited, and the paid plans cover cloud models. Direct cloud inference at ollama.com/api and ollama.com/v1 requires an API key sent as a Bearer token, so any server that calls those endpoints needs an outbound rule for them. If you do not use cloud models, you can keep the plans out of the network design and disable cloud features with OLLAMA_NO_CLOUD=1 or the server configuration file. The Enterprise plan adds model access controls and cost budgets, but those are account features rather than network controls. Confirm current plan terms on the Ollama pricing page before you decide.

What should we confirm in a quote before starting?

Confirm the list of hosts in scope, the allowed outbound destinations, the pull method and who performs each step. Ask for the test cases that prove blocked traffic is blocked, and for the form of evidence you will receive, such as configuration exports, firewall rules and test logs. Ask what is one-time work and what recurs, including rule reviews and retesting after upgrades. Ask how changes to Ollama versions are handled, and who is responsible if a new release needs a new allowed destination. A fixed-scope written agreement makes these points easier to compare across quotes.

How DeployOpen scopes Ollama egress and network isolation work

DeployOpen plans and implements network isolation for self-hosted Ollama inside your own infrastructure, whether that is a cloud account, a data center or an air-gapped network. The work starts with a written scope that names the hosts involved, the pull path for models, the proxy or mirror that may reach the internet, the firewall and routing rules, and the monitoring that will show outbound connections. Most engagements are fixed-scope, so deliverables and timelines are agreed in writing before any change is made to your network. Because no price list is published, a quote follows from that written scope, and the quote should itemize the same components so you can compare it with your own team's estimate.

Scoping is where the important decisions get made. Your team should confirm whether serving hosts will have any egress at all, or whether model pulls will go through a single pull host, a proxy or an internal model mirror. It should also confirm where models are stored with OLLAMA_MODELS, which hosts can reach the API on port 11434, and whether cloud features will be disabled on every server. Ask the vendor to confirm current behavior for any setting you rely on, since Ollama ships frequent releases and network-related defaults can change between versions. Once these decisions are recorded, the scope can state exactly what counts as a passing result.

After implementation, DeployOpen can test the resulting controls against the written scope, including attempts to reach hosts that should be blocked and checks that the monitoring records them. Ongoing support, upgrades and retesting after Ollama version changes or network changes are available as retainers, which suit teams that expect the serving estate to grow. Ask any provider to show how retests will be reported and who owns the firewall rules after handover, since those answers determine how much of the isolation holds up over the following year.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.