Installing k3s
k3s is a lightweight, production-certified Kubernetes distribution from Rancher. It packages the entire Kubernetes control plane into a single 60MB binary, uses SQLite instead of etcd for single-node deployments, and installs in seconds. k3s is the practical choice for production workloads on servers with limited resources (2 CPU, 2GB RAM minimum), IoT edge nodes, and small teams that want real Kubernetes without the operational complexity of kubeadm. The API is 100% compatible with upstream Kubernetes.
What is k3s?
| Feature | k3s | Full Kubernetes (kubeadm) |
|---|---|---|
| Binary size | ~60 MB | Multiple large binaries |
| Minimum RAM | 512 MB (server), 256 MB (agent) | 2 GB+ |
| Default storage backend | SQLite (single node) | etcd |
| Install time | < 60 seconds | 10-30 minutes |
| Traefik Ingress | Included by default | Manual installation required |
| Production suitable | Yes | Yes |
Single-node installation
# One-line installation (installs k3s server + agent on one node):
curl -sfL https://get.k3s.io | sh -
k3s install output
[INFO] Finding release for channel stable
[INFO] Using v1.29.4+k3s1 as release
[INFO] Downloading hash https://github.com/k3s-io/k3s/releases/download/v1.29.4+k3s1/sha256sum-amd64.txt
[INFO] Downloading binary https://github.com/k3s-io/k3s/releases/download/v1.29.4+k3s1/k3s
[INFO] Verifying binary download
[INFO] Installing k3s to /usr/local/bin/k3s
[INFO] Skipping installation of SELinux RPM
[INFO] Creating /usr/local/lib/systemd/system/k3s.service
[INFO] systemd: Starting k3s
# k3s installs its own kubectl wrapper:
sudo k3s kubectl get nodes
k3s kubectl get nodes output
NAME STATUS ROLES AGE VERSION
ubuntu22 Ready control-plane,master 30s v1.29.4+k3s1
# Use standard kubectl by pointing to k3s kubeconfig:
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
kubectl get nodes # Now standard kubectl works
# Add to ~/.bashrc to persist:
echo 'export KUBECONFIG=/etc/rancher/k3s/k3s.yaml' >> ~/.bashrc
Adding worker nodes
# On the SERVER node: get the join token:
sudo cat /var/lib/rancher/k3s/server/node-token
node-token output
K1077b2c35f9b8e7a91d41f3c4e2b0d6f2a8c1e4b7d0f3a6c9b2e5a8c1d4f7::server:abc123def456...
# On each WORKER node: join the cluster:
curl -sfL https://get.k3s.io | K3S_URL=https://SERVER_IP:6443 K3S_TOKEN=YOUR_TOKEN sh -
# Back on the server: verify all nodes joined:
kubectl get nodes
kubectl get nodes with workers
NAME STATUS ROLES AGE VERSION
server-01 Ready control-plane,master 10m v1.29.4+k3s1
worker-01 Ready 2m v1.29.4+k3s1
worker-02 Ready 90s v1.29.4+k3s1
Managing k3s
# k3s runs as a systemd service:
sudo systemctl status k3s # Check server status
sudo systemctl restart k3s # Restart server
sudo journalctl -u k3s -f # Follow k3s logs
# Uninstall k3s (server):
/usr/local/bin/k3s-uninstall.sh
# Uninstall k3s agent (worker nodes):
/usr/local/bin/k3s-agent-uninstall.sh
# Check k3s resource usage (built-in):
kubectl top nodes
kubectl top pods --all-namespaces
Conclusion
k3s is the best choice for running production Kubernetes on Ubuntu servers with limited resources, or when you want a cluster operational within 60 seconds. The single-binary architecture means there is nothing to update separately — upgrading k3s upgrades the entire control plane. For multi-node production clusters, k3s with an external database (PostgreSQL or MySQL instead of SQLite) provides full HA. Traefik is included as the default Ingress controller, so you can expose HTTP/HTTPS services immediately without additional setup.
FAQ
Is Installing K3s important for Ubuntu administrators?+
Yes. It supports practical Ubuntu administration because it connects directly to server reliability, security, troubleshooting, or daily operations.
Should I practice this on a live server?+
Use a lab VM first. After you understand the command output and rollback path, apply the workflow carefully on real systems.
What should I do after reading this article?+
Run the practice commands, write down what each one shows, and continue to the next article in the Ubuntu roadmap.
Need help with Ubuntu administration?
Work directly with Muhammad Irfan Aslam for Ubuntu Server, Linux, cloud, Docker, DevOps, CI/CD, or infrastructure troubleshooting support.
Hire Me for Support