Skip to main content

K3s Offline Install: Tarball, Registry, or Embedded Mirror

K3s offline installation (air-gap installation) has three officially documented methods: distributing images through a private registry, pre-distributing a tarball to each node, and using K3s's embedded registry mirror (K3s official: Air-Gap Install). Which one to pick depends on your cluster size and whether you already operate a private registry. This article walks through all three methods and the configuration and version details that are easy to miss.

1. Why K3s Installation Gets Harder Offline

Overview flow diagram contrasting an internet-connected environment with an air-gapped environment, showing arrows for how the K3s binary, the air-gap image tarball, and the install.sh script reach each node under each method

The standard install.sh script (fetched from get.k3s.io) assumes it can download the K3s binary and the container images for system components such as CoreDNS and Traefik over the internet at install time.

That assumption breaks down in networks that cannot reach the internet directly — on-premises environments at financial institutions, healthcare providers, and manufacturers, for example. K3s's official documentation lists three methods for this situation (K3s official: Air-Gap Install):

  • Private Registry Method: push images to an existing private registry
  • Manually Deploy Images: place the tarball directly on each node
  • Embedded Registry Mirror: share images between nodes using K3s's built-in registry mirror

2. Method 1: Push Images to a Private Registry

Flowchart of five steps: fetch the tarball, docker image load, docker tag, docker push, then reference it in registries.yaml

This method suits teams that already run an internal Docker registry, such as Harbor. The steps are (K3s official: Air-Gap Install):

  1. On a machine with internet access, download the image archive (k3s-airgap-images-<arch>.tar.zst) that matches your target K3s version from the K3s GitHub Releases page
  2. Import the archive into Docker with docker image load
  3. docker tag and docker push the images to your internal private registry
  4. Configure that registry as a mirror in /etc/rancher/k3s/registries.yaml on each node

Upon startup, K3s checks whether /etc/rancher/k3s/registries.yaml exists, and if so, uses its contents when generating the containerd configuration (K3s official: Private Registry Configuration). A basic configuration looks like this:

yaml
mirrors:
  "docker.io":
    endpoint:
      - "https://registry.example.com"
configs:
  "registry.example.com":
    auth:
      username: <BASIC AUTH USERNAME>
      password: <BASIC AUTH PASSWORD>
    tls:
      ca_file: <PATH TO SERVER CA>
      cert_file: <PATH TO CLIENT CERT>
      key_file: <PATH TO CLIENT KEY>
      insecure_skip_verify: <SKIP TLS CERT VERIFICATION BOOLEAN>

This file needs to exist on every node — server or agent — that pulls images from the private registry (K3s official: Private Registry Configuration). You can also set the --disable-default-registry-endpoint option, which stops containerd from falling back to the default registry endpoint for any registry listed in registries.yaml (same source).

3. Method 2: Pre-Distribute a Tarball to Each Node

Architecture diagram of an air-gap image tarball downloaded on an internet-connected machine being carried to each node's /var/lib/rancher/k3s/agent/images/ directory via a USB drive or internal distribution method

This method suits smaller clusters where you don't want the operational overhead of running a private registry. SUSE's official documentation describes it as geared toward "edge deployments."

  1. On a machine with internet access, download the k3s-airgap-images-<arch>.tar.zst for your target version
  2. Place that file in the /var/lib/rancher/k3s/agent/images/ directory on each node
  3. When K3s starts, containerd automatically imports the archives in that directory

According to SUSE's documentation, creating a .cache.json file lets you run the image re-import conditionally, reducing startup time (SUSE official: K3s Air-Gap Install).

4. Method 3: Share Images Between Nodes With the Embedded Registry Mirror

Network diagram of multiple cluster nodes sharing one node's already-loaded image with each other, shown with circular arrows in a peer-to-peer pattern

For multi-node clusters, instead of placing the same tarball on every node, you can use K3s's built-in OCI-compliant registry mirror. One node's containerd image store can be referenced by other cluster members (K3s official: Air-Gap Install). This reduces the effort of distributing images individually as node count grows.

5. Placing the Binary and Install Script, and SELinux Notes

Step diagram of three steps: download the K3s binary and install.sh with curl, place them, and grant execute permission

Besides preparing images, you also need the K3s binary and install script in place beforehand.

bash
sudo curl -Lo /usr/local/bin/k3s \
  https://github.com/k3s-io/k3s/releases/download/<VERSION>/k3s
sudo chmod +x /usr/local/bin/k3s

curl -Lo install.sh https://get.k3s.io
chmod +x install.sh

<VERSION> should match the exact same version tag as the air-gap image you downloaded in Step 1 (K3s official: Air-Gap Install). As of this writing (November 19, 2026), the latest tag on the GitHub Releases page is v1.37.2+k3s1 (published November 3, 2026), but check the releases page for the tag you actually need.

Installation itself can skip the download step since the binary is already in place.

bash
# Single server
INSTALL_K3S_SKIP_DOWNLOAD=true ./install.sh

# Adding an agent
INSTALL_K3S_SKIP_DOWNLOAD=true K3S_URL=https://<SERVER_IP>:6443 \
K3S_TOKEN=<TOKEN> ./install.sh

INSTALL_K3S_SKIP_DOWNLOAD is documented as: "If set to true will not download K3s hash or binary" (K3s official: Environment Variables Reference). If you want to place registries.yaml after installation completes but before K3s starts, you can combine it with INSTALL_K3S_SKIP_START ("If set to true will not start K3s service"), place the config file, and then start the service manually (same reference).

On nodes with SELinux enabled, you need to manually install a dedicated RPM (k3s-selinux) before installing K3s itself (K3s official: Air-Gap Install).

bash
curl -LO https://github.com/k3s-io/k3s-selinux/releases/download/<VERSION>/k3s-selinux-<ver>.noarch.rpm
sudo yum install ./k3s-selinux-<ver>.noarch.rpm

As of this writing, the stable tag on the k3s-selinux GitHub Releases page is v1.6.latest.1, but again check the releases page for the exact tag you need. It depends on container-selinux, policycoreutils, and selinux-policy.

6. An Easy-to-Miss Pitfall: K3s v1.40's System Image Source Change

Before-and-after comparison diagram showing how system images such as CoreDNS switch their source from docker.io to ghcr.io starting with K3s v1.40

The official K3s blog (published October 1, 2026) announced that starting with K3s v1.40 (expected July 2027), packaged components such as CoreDNS, Traefik, and metrics-server will move from docker.io/rancher/... to ghcr.io/k3s-io/... (GitHub Container Registry) (K3s official blog: K3s system images ghcr).

The reason is that the paid agreement between SUSE and Docker has ended, meaning all pulls become subject to Docker Hub's rate limits. GHCR's public images carry no such rate limit, which is why the migration was decided (same blog post). Versions below v1.40 will continue pulling from Docker Hub as before.

In air-gapped operations, you load a tarball once and keep using it, which makes this kind of change easy to overlook. According to the same blog post, this affects:

  • Clusters mirroring images via --system-default-registry, which need a mirror configuration pointed at the new source (ghcr.io)
  • Clusters configuring mirrors in registries.yaml, which need a ghcr.io entry added
  • Air-gapped environments upgrading to v1.40, which need to re-obtain the v1.40 tarball (k3s-airgap-images-*.tar.zst)

K3s was accepted into the CNCF on August 19, 2020, at the Sandbox maturity level (CNCF: K3s). Since this is a community-driven distribution with changes like this happening on an ongoing basis, it's worth budgeting time for version tracking as part of your operations.

7. Frequently Asked Questions

Q. Should images be referenced by tag or by digest? Kubernetes's official documentation recommends specifying a digest (sha256:... format) rather than a tag in production, so you aren't affected by tag changes on the registry side (Kubernetes official: Images). If you keep using an air-gapped image for a long time after loading it once, pinning it by digest keeps your configuration from drifting.

Q. Which of the three methods fits best when it's unclear which to pick? If you already operate a private registry internally, Method 1 (private registry) fits the official documentation's assumptions; if not, Method 2 (tarball pre-distribution) suits small clusters, and Method 3 (embedded registry mirror) suits clusters with many nodes (K3s official: Air-Gap Install).

Q. After configuring registries.yaml, why can't images be pulled right away?registries.yaml is read at K3s startup, so if you add or change the configuration on an existing node, you need to restart the K3s service for it to take effect (K3s official: Private Registry Configuration).

8. Summary: Which Method Should You Choose

MethodWhat You NeedBest ForOperational Overhead
Private registryAn internal registry (e.g. Harbor)Mid-to-large clusters that already run a registryRegistry maintenance is a separate ongoing task
Tarball pre-distributionA distribution method such as USB drivesSmall clusters with few nodesNeeds redistribution every time nodes are added
Embedded registry mirrorNo extra infrastructure requiredMulti-node clustersPropagates automatically once one node has loaded it

All three methods assume ongoing attention to which K3s version your images correspond to. As the v1.40 GHCR migration above shows, image source changes can happen again in the future.

Taking on this version management and registry configuration work yourself, inside a closed network or on-premises environment, takes real operational effort. If your environment can't send data outside, or can't allow internet access at all, Kubo On-Premise is a managed K8s option built around air-gapped support, where the registry configuration and upgrade management needed for production can be handled as a fully managed service.

For the basics of using K3s and creating a cluster, see Kubo's documentation as well.

Other production K3s decisions — HA setup, backups, and upgrade procedures — are covered in What to Decide for K3s Production Operations. Using a private registry as a countermeasure against Docker Hub rate limits is covered in The Night CI Failed Entirely to Docker Hub's Pull Limit, and deploying K3s at the edge is covered in A Complete Guide to Deploying Kubernetes With K3s in Edge/IoT Environments.

Related articles

← Back to all posts