You can run a real Kubernetes cluster at home with k3s in about 15 minutes on a single machine, or across several small boxes for a proper multi-node setup. k3s is a lightweight, certified Kubernetes distribution that packages the control plane into a single binary, so it installs with one command and uses far fewer resources than a full kubeadm cluster. This guide walks through the standard single-node install first, then how to add worker nodes, and finishes with the checks and fixes that catch most first-time problems.
What You'll Need
- A Linux machine (Ubuntu, Debian, Raspberry Pi OS, or similar) with at least 2 GB RAM and 2 CPU cores for the server node. A Raspberry Pi 4 with 4 GB or more works well.
- 64-bit OS. k3s does not run on 32-bit installs.
- SSH access and sudo rights on every node.
- Unique hostnames on each machine, and a static IP or DHCP reservation for the server node.
- Ports open between nodes if you use a firewall: TCP 6443 (API), TCP 10250 (kubelet), UDP 8472 (VXLAN), and TCP 2379-2380 if you run multiple servers.
- Optional: a domain name and a load balancer or port-forward if you want to reach services from outside your LAN.
Step-by-Step
- Update the OS and set the hostname. Run
sudo apt update && sudo apt upgrade -y(or your distro's equivalent), thensudo hostnamectl set-hostname k3s-server. Give each worker a different name. - Disable swap. Kubernetes expects swap off. Run
sudo swapoff -a, then comment out any swap line in/etc/fstabso it stays off after reboot. - Install k3s on the server node. The official installer is a single command:
curl -sfL https://get.k3s.io | sh -. It installs the k3s service, starts it, and writes a kubeconfig to/etc/rancher/k3s/k3s.yaml. - Verify the server. Run
sudo k3s kubectl get nodes. You should see one node listed as Ready. If you want to use plainkubectlas your normal user, copy the kubeconfig to~/.kube/configand change the server address from127.0.0.1to the node's LAN IP. - Get the join token. On the server, read
/var/lib/rancher/k3s/server/node-token. You will paste this on each worker. - Join worker nodes. On each worker, run the installer with the server URL and token:
curl -sfL https://get.k3s.io | K3S_URL=https://<server-ip>:6443 K3S_TOKEN=<token> sh -. Use the server's LAN IP, notlocalhost. - Confirm the cluster. Back on the server, run
sudo k3s kubectl get nodesagain. All nodes should show Ready within a minute or two. - Deploy a test workload. Create a small deployment to prove scheduling works:
sudo k3s kubectl create deployment hello --image=nginx, thensudo k3s kubectl expose deployment hello --port=80 --type=NodePort. Find the assigned port withsudo k3s kubectl get svc helloand openhttp://<node-ip>:<nodeport>in a browser. - Set up kubectl access from your laptop (optional). Copy the kubeconfig from the server, replace the server address with the LAN IP, and keep the file private. Do not expose the API port to the internet; use a VPN or SSH tunnel instead.
Common Mistakes
- Leaving swap enabled. The kubelet will refuse to start or behave unpredictably.
- Using
localhostin the worker join command. Workers must reach the server by its LAN IP or hostname. - Duplicate hostnames. Two nodes with the same name confuse the cluster; set unique hostnames before joining.
- Firewall blocking VXLAN. Pod-to-pod traffic across nodes needs UDP 8472. If pods on different nodes cannot talk, check this first.
- Exposing the API server publicly. Port 6443 should stay on your LAN or behind a VPN.
Tips
- Use DHCP reservations or static IPs for every node so the cluster survives router reboots.
- Keep the kubeconfig file readable only by you (
chmod 600). - For a home lab, the built-in Traefik ingress and local-path storage class are usually enough; you do not need to install extra components on day one.
- Back up
/var/lib/rancher/k3s/serveron the server node if you start storing real data in the cluster.
Troubleshooting
If a node never reaches Ready, check the service first: sudo systemctl status k3s on the server or sudo systemctl status k3s-agent on a worker. Then read the logs with sudo journalctl -u k3s -e (or k3s-agent). The most common causes are swap still on, a wrong server IP in the join command, an expired or mistyped token, or a firewall dropping traffic between nodes. If kubectl cannot connect, confirm the kubeconfig points at the right IP and that the API server is listening on 6443. If pods stay Pending, the node may be low on memory or marked unschedulable; check kubectl describe node. If you need to start over on a worker, uninstall with /usr/local/bin/k3s-agent-uninstall.sh, then rejoin. On the server, /usr/local/bin/k3s-uninstall.sh removes the cluster and its data, so back up anything you want to keep first.
Frequently Asked Questions
Can I run k3s on a single Raspberry Pi?
Yes. A 64-bit Pi 4 with 4 GB RAM or more is a common single-node setup. Expect it to be fine for learning and light workloads, not heavy production use.
Do I need Docker installed first?
No. k3s ships with containerd as its container runtime and manages it for you. Installing Docker alongside is optional and not required.
How do I access the cluster from another computer?
Copy the kubeconfig from /etc/rancher/k3s/k3s.yaml, replace the server address with the node's LAN IP, and place it in your user's ~/.kube/config. Keep the file private and do not expose port 6443 to the internet.
Can I add more server nodes for high availability?
Yes. k3s supports multiple server nodes using an embedded etcd datastore. Start the first server with the cluster-init flag, then join additional servers with the same token and server URL. This is more advanced than a single-server setup.
What happens if the server node goes down?
In a single-server cluster, the control plane is unavailable and you cannot make changes, though existing pods on workers may keep running. For resilience, run multiple server nodes or accept the downtime in a home lab.
Is k3s really Kubernetes?
Yes. k3s is a certified Kubernetes distribution. Standard manifests, Helm charts, and kubectl commands work, with a few optional components trimmed or replaced by lightweight defaults.