One Big Server or Several Small Ones
k3s needs only 2 cores and 2 GB for a server node, so even a small VPS (Bronze, $37.50 a month) runs it for learning and light apps. For real workloads the choice is between one large dedicated server, where every pod shares fast local cores, memory and NVMe with no network in between, and three or more machines, which keep running when one fails.
| Server | Cores / threads | Memory | From | Location |
|---|---|---|---|---|
| AMD Ryzen 9 5950X | 16 / 32 | 128 GB | $399.00/mo | Ashburn, Dallas |
| AMD Ryzen 9 9950X | 16 / 32 | 192 GB | $669.00/mo | Ashburn, Dallas |
| AMD EPYC 4585PX | 16 / 32 | 128 GB | $849.00/mo | Dallas |
| AMD EPYC 7443P | 24 / 48 | 512 GB | $969.00/mo | Ashburn, Dallas |
| AMD EPYC 9455P | 48 / 96 | 512 GB | $999.00/mo | Dallas |
| AMD Dual EPYC 7702 | 128 / 256 | 512 GB | $1,099.00/mo | Ashburn, Dallas |
| AMD EPYC 9455 | 48 / 96 | 512 GB | $2,299.00/mo | Dallas |
1. Install the First Node
On a fresh Ubuntu 24.04 or Debian 13 server, after securing it:
curl -sfL https://get.k3s.io | sh - sudo kubectl get nodes # one node, STATUS Ready sudo kubectl get pods -A # coredns, traefik, local-path, metrics-server
k3s runs as the k3s systemd service and installs its own kubectl, which reads /etc/rancher/k3s/k3s.yaml. To use kubectl without sudo on the server:
mkdir -p ~/.kube sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config sudo chown $USER: ~/.kube/config export KUBECONFIG=~/.kube/config # add to ~/.bashrc
2. Use kubectl from Your Computer
Copy the same file to your computer as ~/.kube/config. It points at https://127.0.0.1:6443, which works through an SSH tunnel without opening the port:
ssh -N -L 6443:127.0.0.1:6443 [email protected] & kubectl get nodes
3. Firewall Rules
With ufw, allow the pod and service networks k3s uses by default, and the API only from your nodes:
sudo ufw allow from 10.42.0.0/16 to any # pods sudo ufw allow from 10.43.0.0/16 to any # services sudo ufw allow 80,443/tcp # Traefik ingress sudo ufw allow from 198.51.100.21 to any port 6443 proto tcp # each other node
| Port | Between | Purpose |
|---|---|---|
| TCP 6443 | Agents to servers | Kubernetes API and k3s supervisor |
| UDP 8472 | All nodes | Flannel VXLAN; never open to the internet |
| UDP 51820 | All nodes | Flannel over WireGuard, if you choose it |
| TCP 10250 | All nodes | Kubelet metrics and logs |
| TCP 2379–2380 | Servers only | Embedded etcd, for several server nodes |
4. Add More Nodes
Read the token on the first server, then install k3s on each new machine as an agent:
sudo cat /var/lib/rancher/k3s/server/node-token # on the new machine: curl -sfL https://get.k3s.io | K3S_URL=https://203.0.113.10:6443 K3S_TOKEN=paste-token sh -
Every machine needs its own hostname. Pod traffic between nodes is not encrypted by default, so for nodes that talk over the public internet start the first server with INSTALL_K3S_EXEC="--flannel-backend=wireguard-native" instead, and open UDP 51820 between them. VPS nodes in the same location can use private networking for that traffic.
5. Deploy Something
kubectl create deployment hello --image=nginx --replicas=2 kubectl expose deployment hello --port=80
Then route a domain to it through Traefik with an Ingress:
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: hello
spec:
rules:
- host: hello.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: hello
port:
number: 80kubectl apply -f hello-ingress.yaml
Point hello.example.com at the server and it answers on port 80. For HTTPS, install cert-manager with Helm and add a Let's Encrypt issuer.
Storage, Backups and Removal
- Volumes: the built-in
local-pathstorage class keeps volumes on the node under/var/lib/rancher/k3s/storage, which is fast on NVMe but tied to that node. - Backups: keep your manifests or Helm values in Git, and back up volumes and
/var/lib/rancher/k3s/serveroff the server, for example to object storage. - Starting over:
/usr/local/bin/k3s-uninstall.shremoves k3s from a server node, andk3s-agent-uninstall.shfrom an agent.
Not sure you need Kubernetes? Docker Compose or Coolify run a handful of apps on one server with far less to learn.