Ollama in air-gapped networks

Ollama can run models on hosts with no internet access if weights, the binary and configuration arrive through an approved internal channel. This page covers how to plan that transfer, load models and keep cloud features off.

On this page

Running Ollama in air-gapped networks: what the setup needs

Ollama can run models locally with cloud features disabled, so the real work in an air-gapped network is getting everything the server needs across the boundary: the Ollama binary, the model weights and the configuration. Nothing in the runtime itself depends on the internet once those three items are inside. Teams that handle classified material, operational technology, or restricted healthcare and finance data usually need this pattern because their security policy forbids outbound connections from the inference host, even for model downloads.

The local API is the first thing to plan for. The API at localhost:11434 does not require authentication, and Ollama binds to 127.0.0.1 by default. That is safe on a single workstation, but a shared server inside an isolated network needs the bind address changed through OLLAMA_HOST and an authenticating proxy in front of it, or access restricted to specific hosts by network policy. Confirm with your security team which of these controls satisfies the boundary rules before the server is placed on the isolated segment.

Before you start, decide who owns the transfer process. Someone must select the release, verify its integrity against the vendor's published checksums, stage the files on removable or cross-domain media under your approved procedure, and record what entered the boundary. Ask your compliance lead which supply chain and change control requirements apply to your environment, since those rules shape how the transfer is documented. Check the Ollama FAQ for the current local-only settings before you write the build procedure.

How artifacts cross the isolation boundary

The path starts on an internet-connected staging host, where model weights, the Modelfile and the Ollama binary are downloaded and recorded with checksums. Each artifact then passes an internal verification step (malware scanning, checksum comparison and a review record) before it is moved through approved media into the isolated network. Inside the boundary, ollama create imports the weights from a local path into the models directory, and only local API clients on approved hosts use the result. Confirm that the approval step and transfer media meet your own change and supply chain controls.

Artifacts move from staging through verification into the isolated Ollama host.

Which loading and configuration options fit which network

This table compares the three ways to bring models and settings into an isolated Ollama host: importing weight files through a Modelfile, pointing at a pre-populated model directory, and disabling cloud features. Read each row against how your network moves files in and how strictly it blocks outbound traffic. Most isolated hosts combine a import path with the cloud switch, and the main takeaway is that each option still needs a confirmed file inventory and a check that nothing phones home.

OptionBest fitWhat the operator must doWhat to confirm
GGUF import via Modelfile FROM and ollama createTeams that receive single model files from an approved internal repository and want a named, versioned model in OllamaPlace the GGUF file on the host, write a Modelfile whose FROM line points to that local path, then run ollama create to build the modelThe file hash matches the approved artifact, the quantization and context settings match the approval record, and the model runs with no outbound pull
Safetensors import via Modelfile FROM and ollama createTeams that hold full-precision or fine-tuned weights in Safetensors format and need to bring their own model filesStage the weight files and config files in one local directory, reference that path in FROM, then build with ollama createThe model architecture is supported by the Ollama version in use, required tokenizer and config files are complete, and the import docs match your release
Pre-populated OLLAMA_MODELS directoryFleets of identical isolated hosts where models are copied from a golden image or media setSet OLLAMA_MODELS to the staged path, grant the service account read and write access, and restart the serviceThe directory layout was produced on a compatible version, the service user can read every blob, and disk space covers the full set plus growth
OLLAMA_NO_CLOUD=1 environment variableHosts where cloud features must be off for the whole service from the first startAdd the variable to the service environment, such as the systemd unit or container settings, and restartThe variable reaches the running process, not just a shell, and the server logs or settings show cloud features disabled
disable_ollama_cloud in ~/.ollama/server.jsonWorkstations or hosts managed through configuration files rather than service overridesCreate or edit the server.json file for the service user and set the key to disable cloud featuresThe file is read by the account that runs the server, and it survives updates and restarts in your management tooling
Cloud API keys and direct cloud inferenceUsually not applicable on an isolated networkDo not issue ollama.com API keys to isolated hosts, and block outbound access to ollama.comEgress rules deny the cloud endpoints, and no key material exists on the host

Setting up an offline Ollama host step by step

This sequence takes a host from artifact verification on a connected machine to a confirmed local API with no outbound calls. Each step ends with a check, so the team can show what was loaded, where it lives and that cloud features are off before users connect.

  1. Stage and verify the binary and model files

    On a connected staging host, download the Ollama release you intend to use and the model weights in GGUF or Safetensors format, then record a checksum for every file. Your security or platform team should confirm the source and integrity of each artifact against the vendor's published release notes and the Ollama GitHub releases page, then approve the version in your change record. Pre-release builds should not go into the bundle unless you have decided to accept them. Done means a manifest lists each file, its version and its hash, and the approver has signed it off.

  2. Transfer the bundle through the approved channel

    Move the binary, the model files, the Modelfile templates and the manifest across the boundary using the transfer method your security policy allows, such as an approved media process or a one-way data diode. Your team should confirm the transfer procedure with the people who own the isolated network, including who scans the media and who logs the import. Done means the files arrive intact on the isolated host and the checksums recomputed there match the staging manifest exactly.

  3. Install the binary and set OLLAMA_MODELS with permissions

    Install the Ollama binary from the verified bundle, then point the model directory at a dedicated volume using the OLLAMA_MODELS variable in the service environment. The directory should be owned by the account that runs the Ollama service, so the server can read and write model blobs without broader access. Check the default locations documented in the Ollama FAQ so you know where the server would otherwise write. Done means the service starts under its own account and the model path it reports matches the chosen volume.

  4. Disable cloud features before first start

    Set OLLAMA_NO_CLOUD=1 in the service environment, or set disable_ollama_cloud in the server configuration file, so cloud features stay off even if someone later edits other settings. Keep the bind address on 127.0.0.1 unless you have a defined reverse proxy in front of it. Done means the server configuration, the service environment and the startup logs all show cloud features disabled, and no cloud API key is present on the host.

  5. Create models from local paths with ollama create

    For each approved model, write a Modelfile whose FROM line names the local path to the GGUF file or the Safetensors directory, then run ollama create with a name your team will use in applications. Keep the Modelfile in version control with the manifest so the import can be repeated. The Ollama import documentation describes the FROM line and build process. Done means each model appears in the local model list, and the file hash of the source weights still matches the manifest after the build.

  6. Load each model and run a local test prompt

    Send a short test request to each created model through the local API and confirm it generates output. Record the model name, the response time and the server log lines for the load. Because the model runs on this host, a successful response shows the local path works without external calls. Done means every approved model answers a test prompt from the isolated host and the output is stored with the change record.

  7. Confirm the API answers locally with no outbound calls

    Check that the API responds on localhost port 11434 and that it is not reachable from other hosts unless your reverse proxy is in place. The local API does not require authentication, so access control must come from the network and the proxy layer. Use your network team's tools to confirm the host has no outbound route to the internet, and review the server logs for any attempt to reach an external endpoint. Done means the test shows a local response, the network scan shows no outbound connections from the Ollama process, and the results are signed by the reviewer.

Verifying weights and binaries before they cross the boundary

Every artifact that enters an air-gapped network needs an integrity check and a provenance record before it is imported. That includes the Ollama binary, any install packages, model weights in GGUF or Safetensors format, the Modelfile used with ollama create, and any container images or libraries carried across with them. Once a file is inside the boundary, the team usually cannot re-fetch it from the source to confirm what it was, so the check has to happen on the transfer side. NERC CIP-013-2 is a useful reference point even outside the power sector: it asks for supply chain procurement processes that address verification of software integrity and authenticity of vendor software and patches. Auditors and security reviewers in regulated environments will ask how the same thinking applies to model weights, which are data files that behave like executable code once loaded.

In general terms, the approach is to compute a cryptographic hash of each artifact on the connected side, record that hash alongside the source, the version, the date and the person who approved the transfer, and then recompute and compare the hash after the file lands inside the network. Where the publisher provides signatures or published checksums, verify those as well and keep the verification output with the transfer record. Model files deserve particular attention because a weight file can be swapped without changing its name or size in a way a casual look would catch. Keep a manifest of approved artifacts, versions and hashes in a system the isolated environment can read, so that the import step can refer to an approved record rather than to whatever file happens to be in the staging folder.

The exact verification procedure, including which hash algorithm to use, who signs off on a transfer, how signatures are checked and where the manifest is stored, must be set by the client's own policy and confirmed with its security and compliance teams. Ask them which evidence they need to see for a transfer and how long records are retained. Ask the Ollama project and any model publisher which checksums or signatures they provide for each release and each model, and confirm that the values match what your staging process records. Plan for a rejection path as well: when a hash does not match, the artifact should stay out of the model store, and the incident should follow the same process as any other suspected supply chain issue.

Security and operations risks of isolated Ollama hosts

An isolated network removes internet exposure, but it does not add the controls Ollama leaves to the operator. The cards below cover the places where an air-gapped Ollama host can fail on access, provenance, updates, outbound calls, audit and storage, and what your team has to add for each.

Unauthenticated local API exposure

The local API on port 11434 requires no authentication, and Ollama binds to 127.0.0.1 by default. Changing the bind address with OLLAMA_HOST exposes the API to every host that can route to it, including other segments of the isolated network. Check which interfaces the service listens on, then restrict reachability with host firewalls and an authenticating reverse proxy if more than one client needs access. Ollama documents proxy exposure, but the access control is yours to build.

Ollama FAQ

Model file provenance

Imported GGUF or Safetensors weights are only as trustworthy as the media that carried them. Ollama builds the model from the local path named in the Modelfile FROM line, so it will not tell you whether the weights came from the approved source. Record a checksum for each file at the point of approval, verify it again before ollama create, and keep the Modelfile under version control so every imported model traces to a reviewed input.

Importing a model

Binary update path and rollback

Ollama ships frequent releases, so the binary will need updating through your internal channel rather than by pulling from the internet. Stage each release on a test host, verify its integrity against the source you approved, and keep the previous binary so a failed upgrade can be reversed. Confirm with your team which release tags you will accept, since pre-releases are published alongside stable versions.

Pre-release example
v0.40.6
Ollama releases

Cloud features and outbound calls

Cloud features can be turned off with OLLAMA_NO_CLOUD=1 or disable_ollama_cloud in ~/.ollama/server.json. Set the variable in the service unit, not only in a shell, and confirm it took effect. Direct cloud inference at ollama.com requires an API key, so a key left in a client configuration is a path out of the enclave. Verify outbound traffic from the host with firewall logs or egress monitoring rather than assuming the setting holds.

API authentication docs

Logging and audit of imports

Ollama's documentation does not describe a built-in audit trail for who imported which model file or when. Your team should capture the import record itself: the source media, checksum, Modelfile content, the operator's identity and the resulting model name. Store these records outside the Ollama host so they survive a rebuild, and align the retention period with your change management policy.

Access control on the models directory

Models are stored in a directory set by default paths or by OLLAMA_MODELS. The files are large and any user who can write there can change what the service loads. Restrict write access to the import operator, keep read access to the service account, and confirm ownership after each import. Include the directory in file integrity monitoring so unexpected changes raise an alert.

Questions teams ask before running Ollama offline

What does it cost to run Ollama in an air-gapped network?

The Ollama software itself is MIT licensed, and the pricing page states that running models on your own hardware is always unlimited, so the license adds no fee for offline use. The real spend is in the surrounding work and hardware: GPU or CPU capacity, storage for model weights, the internal channel that carries the binary and models across the boundary, and the people who build and verify it. Labor is paid to whoever builds the setup, whether that is your team or a partner under a written scope. Ask any partner for a quote that separates one-time work (build, import, verification, documentation) from recurring work (model updates, binary updates, monitoring). Effort rises with the number of models, the number of security reviews the boundary must pass, and how many user-facing tools you connect.

How long does an offline Ollama deployment take?

Duration depends on how many models you load, how large they are, and how many approval steps your change process has before media can cross the boundary. Model import with ollama create is usually the quick part; the slow parts are obtaining approved weights, scanning and documenting them, and getting the transfer approved. Ask for a written plan that lists each gate and who owns it. Your security team's review cycle will often set the timeline more than the technical work does.

What must our team supply before the work starts?

You need to supply the target hosts and their operating system, GPU or CPU details, a storage location for models, the list of approved models with their license terms, and the transfer path your security policy allows. You also need named owners for approving media, for access control on the API, and for who receives updates. Without an approved model list and a defined transfer process, any partner will spend the first phase on questions rather than build work. Confirm each item with your security and procurement teams before the scope is signed.

Can our own engineers do this without a partner?

Yes, if your team already runs Linux services, manages model storage and handles offline package transfers. The core steps are to download the Ollama release and models on an connected staging system, verify them, move them across, place weights in the model directory, and write a Modelfile whose FROM line points to a local GGUF or Safetensors path. Teams that lack a verification process, a repeatable transfer procedure or someone to own the environment after handover usually benefit from an outside implementer. A partner is a choice, not a requirement.

Does Ollama have paid plans that matter for an offline deployment?

Ollama's pricing page says running models on your own hardware is always unlimited. Paid plans apply to cloud models: Pro is listed at $20 per month ($200 per year), Max at $100 per month, Team at $500 per month, and Enterprise at custom pricing. The Enterprise plan adds model access controls, cost budgets per user or API key, a dedicated support channel and custom security options on top of Team features. For a network with no internet access, the cloud plans are not used, so the decision is whether you need vendor support. Confirm with Ollama whether the Enterprise support channel meets your requirements.

How do we update Ollama and models through a restricted network?

Updates arrive as files, so the process is a transfer cycle rather than a live pull. On a connected staging system, download the target Ollama release from the project's GitHub releases page, record its version, and check it against your integrity requirements before it crosses the boundary. Do the same for model files, then import them into the isolated host and test them against a known prompt set. Pre-release versions should not enter production; the project has published pre-releases alongside stable ones, so pin the version you approved. Keep a written record of each transfer, its hashes and the approval, because supply chain controls such as the NERC CIP-013-2 requirement for verifying vendor software integrity expect that evidence in regulated environments.

What do we need to turn off so Ollama stays local?

Set OLLAMA_NO_CLOUD=1 in the server environment, or disable cloud features in ~/.ollama/server.json with the disable_ollama_cloud key. Ollama states that when it runs locally it does not see your prompts or data. Keep the API bound to 127.0.0.1 on port 11434 unless you deliberately expose it through an authenticated proxy, since the local API does not require authentication. Verify the setting after each restart and each update, and test that the host cannot reach the internet, so a configuration change cannot silently reopen an outbound path.

How DeployOpen scopes an air-gapped Ollama deployment

DeployOpen fixes the scope of an air-gapped Ollama deployment in writing before any work starts. The scope covers four phases: transfer of the Ollama binary and model weights across the boundary, loading models from local files, configuration of the server and its clients, and verification that nothing reaches out to the internet. Each phase has named deliverables, the systems and accounts involved, and the people who sign off. For a typical scope, the first questions are which Ollama version will be carried in, which GGUF or Safetensors weights the business needs, which machines will host the model directory, and which applications will call the API on port 11434. Your security team should also confirm whether a second, internal approval step applies before media crosses the boundary.

The scope should name each control that matters in the isolated network. That includes how the ollama binary and each model artifact are checked for integrity and authenticity before import, who owns the internal update channel for future Ollama releases, and where the Modelfile used with ollama create is stored and reviewed. It should also record the cloud switches that must be off in this environment, either OLLAMA_NO_CLOUD=1 or disable_ollama_cloud in ~/.ollama/server.json, and how that setting is verified on each host. Ask DeployOpen to show how the verification step proves no outbound connection is attempted, rather than assuming the setting took effect. Because the Ollama API at localhost:11434 has no authentication by default, the scope should also state who controls network access to the bind address set by OLLAMA_HOST.

Compliance evidence should be scoped at the same time as the build. DeployOpen prepares configuration records, transfer logs, hash and signature checks, access settings and test results so that your compliance team and the assessors you engage can review them. DeployOpen does not issue audit reports, attestations or certifications; independent auditors and certification bodies do that work. Ask your assessor early which evidence they expect for your regulatory framework, and confirm which parts of the deliverable set will be handed over for their review. Once the scope is signed, changes to models, Ollama versions or network rules should go through a written change request so the evidence stays current.

How DeployOpen works on this

DeployOpen plans, builds, tests and hands over Ollama inside your own restricted network, with model files, the Ollama binary and server settings prepared before the isolated environment is switched on. Each engagement is scoped in writing so your security, platform and compliance teams know what is delivered and how it will be checked.

How we scope

  • Inventory the models, weights formats and licenses your teams need, including GGUF and Safetensors files you already hold.
  • Map the isolated boundary, the transfer path for files and the internal channel used to update the Ollama binary.
  • Agree deliverables, test criteria and timelines in writing before work starts, since most engagements are fixed-scope.

How we build

  • Set OLLAMA_NO_CLOUD=1 or the server configuration file so cloud features are off, then confirm this from the running service.
  • Create models from local weight files with a Modelfile FROM line and ollama create, and record checksums for each import.
  • Configure OLLAMA_MODELS, OLLAMA_HOST and concurrency limits, and test that no outbound connections are needed for normal use.

How we hand over

  • Document the offline model import procedure, model directory layout and the steps to add or remove models.
  • Provide a written runbook for updating the Ollama binary through your internal channel, including verification of each package before it enters the network.
  • Deliver evidence for your compliance team, such as configuration records, test results and access settings, without claiming any audit outcome.

How we support

  • Retest the environment after each new model load or Ollama release that your team chooses to adopt.
  • Offer ongoing support, upgrades and continuous testing as a retainer, scoped separately from the original build.
  • Confirm with your own team how release notes and pre-releases will be reviewed before they are carried across the boundary.

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.