Skip to main content
๐ŸŽ“ Claude Code Masterclass Learn AI-assisted development on Udemy โ€” plus the companion book on Leanpub & Amazon. Start Learning
Install K3s on Ubuntu: Lightweight Kubernetes
Platform Engineering

Install K3s on Ubuntu: Lightweight Kubernetes

How to install K3s on Ubuntu in 2026. Complete step-by-step guide with commands, verification, and post-install configuration.

LB
Luca Berton
ยท 1 min read

Here is how to install K3s on Ubuntu in 2026. Tested and verified.

Prerequisites

  • Ubuntu 22.04 or 24.04 LTS
  • 2 GB RAM minimum (4 GB recommended)
  • 2 CPU cores minimum

Install K3s Server (Control Plane)

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

That is it. One command. K3s is now running.

Verify

sudo k3s kubectl get nodes
sudo k3s kubectl get pods -A

# Copy kubeconfig for regular kubectl use
mkdir -p ~/.kube
sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
sudo chown $(id -u):$(id -g) ~/.kube/config
export KUBECONFIG=~/.kube/config

kubectl get nodes

Add Worker Nodes

On the server, get the token:

sudo cat /var/lib/rancher/k3s/server/node-token

On each worker node:

curl -sfL https://get.k3s.io | K3S_URL=https://SERVER_IP:6443 K3S_TOKEN=YOUR_TOKEN sh -

Install with Custom Options

# Without Traefik (use your own ingress)
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--disable traefik" sh -

# Without ServiceLB
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="--disable servicelb --disable traefik" sh -

# With specific version
curl -sfL https://get.k3s.io | INSTALL_K3S_VERSION="v1.31.0+k3s1" sh -

Uninstall

# Server
/usr/local/bin/k3s-uninstall.sh

# Agent
/usr/local/bin/k3s-agent-uninstall.sh

Free 30-min AI & Cloud consultation

Book Now