Install K3s

Single command, multiple platforms. Pick the install that matches your environment.

Quick Install (Linux)

The standard install script โ€” works on any modern Linux distribution (Ubuntu, Debian, CentOS, RHEL, Alpine, etc.):

curl -sfL https://get.k3s.io | sh -
sudo k3s kubectl get node

Verify the Install

Check that node shows as Ready and that pods are running:

# Wait ~30 seconds for the node to become Ready
sudo k3s kubectl get node
sudo k3s kubectl get pods -A

# Save kubeconfig for non-root access
mkdir -p ~/.kube
sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
sudo chown $USER:$USER ~/.kube/config

Add a Worker Node

From a second machine, install K3s in agent mode and join the cluster:

# On the server, get the cluster token
sudo cat /var/lib/rancher/k3s/server/node-token

# On the second machine (replace SERVER_IP and NODE_TOKEN):
curl -sfL https://get.k3s.io | K3S_URL=https://SERVER_IP:6443 \
  K3S_TOKEN=NODE_TOKEN sh -

Install by Platform

๐Ÿง Linux (Standard)

Any modern Linux with systemd. Works on servers, VMs, cloud instances.

๐ŸŽ macOS

K3s runs on macOS via multipass VM or via Lima โ€” ideal for local development.

๐Ÿ“ Raspberry Pi

ARMv7 / ARM64 binaries. K3s on Pi 4 with 2GB+ RAM runs production workloads.

๐Ÿ”Œ Air-Gapped

Offline install with private registries and pre-downloaded images (link below).

๐Ÿณ Docker (k3d)

k3d creates K3s clusters inside Docker โ€” perfect for local dev or CI.

โ˜๏ธ Managed (Rancher)

Use Rancher or Imported Existing Cluster for centralized fleet management.

Air-Gapped Install

For installations with no internet access โ€” pre-download the install script, binary, and image tarball:

1. Prepare the air-gap bundle (online machine)

# Download the install script
curl -sfL https://get.k3s.io -o install.sh

# Get the binary (architecture-specific)
# โš ๏ธ ไธ‹้ข GitHub Releases URL ๆ˜ฏ็œŸๅฎžไธ‹่ฝฝๆบ๏ผˆair-gap ้•œๅƒๆ— ๆณ•ๆœฌๅœฐๅŒ–๏ผ‰
# ๆ‰€ๆœ‰ๆžถๆž„ๅˆ—่กจๅ’Œๆœ€ๆ–ฐ็‰ˆๆœฌๅท่ง /k3s/docs/operations/ โ†’ Upgrading K3s ้ƒจๅˆ†
curl -fL -o k3s https://github.com/k3s-io/k3s/releases/latest/download/k3s
# For ARM64:
curl -fL -o k3s https://github.com/k3s-io/k3s/releases/latest/download/k3s-arm64

# Get the image tarball (amd64)
# โš ๏ธ ้•œๅƒๆ‰“ๅŒ…็ป†่Š‚่ง /k3s/docs/operations/
curl -fL -o k3s-airgap-images-amd64.tar https://github.com/k3s-io/k3s/releases/latest/download/k3s-airgap-images-amd64.tar
mkdir -p /var/lib/rancher/k3s/agent/images/
cp k3s-airgap-images-amd64.tar /var/lib/rancher/k3s/agent/images/

2. Install offline

# Transfer install.sh, k3s binary, and image tarball to the target.
# Then:
chmod +x k3s
sudo cp k3s /usr/local/bin/k3s
sudo INSTALL_K3S_SKIP_ENABLE=true ./install.sh

3. Configure private registry

For private registry, create /etc/rancher/k3s/registries.yaml before starting the service:

mirrors:
  docker.io:
    endpoint:
      - "https://your.private.registry:5000"
configs:
  "your.private.registry:5000":
    auth:
      username: your_user
      password: your_pass
    tls:
      insecure_skip_verify: true

4. Start the service

sudo systemctl enable --now k3s
sudo k3s kubectl get node

Upgrade an Existing Cluster

Method 1: Install Script (server node)

curl -sfL https://get.k3s.io | sh -

Method 2: System Upgrade Controller (automated rolling)

For fleet-wide upgrades without downtime, use the system-upgrade controller to roll servers and agents in waves:

# Apply the controller manifests
kubectl apply -f /k3s/docs/operations/  # ่ฏฆ่ง operations ๆ–‡ๆกฃไธญ็š„ controller ้ƒจ็ฝฒ็‰‡ๆฎต
# Apply a plan
kubectl apply -f /path/to/upgrade-server-plan.yaml  # ่ง /k3s/docs/operations/

Next: Deploy Your First App

With K3s installed, deploy a sample workload to verify the cluster:

sudo k3s kubectl create deployment nginx --image=nginx
sudo k3s kubectl expose deployment nginx --port=80 --type=NodePort
sudo k3s kubectl get svc nginx
# Access via http://&lt;node-ip&gt;:<NodePort>

# Or use the bundled Traefik ingress:
# create an Ingress resource pointing to the nginx service on host "demo.local"

โ†’ See documentation index