Docker Compose vs Kubernetes (and k3s) for Home Labs
The Docker Compose vs Kubernetes question usually comes up once a home server has a few containers running and you start wondering whether you’re doing it “properly.” The honest answer is that they solve problems at different scales. Compose runs a set of containers on one machine from a single file. Kubernetes runs containers across many machines and continuously works to keep them in the state you declared.
This guide compares the two for self-hosting, with a closer look at k3s, the lightweight Kubernetes distribution aimed at home labs and edge devices. It was checked in December 2026 against the Docker Compose v2 plugin (docker compose) and the Kubernetes release page, which lists 1.37, 1.36 and 1.35 as the supported minor versions (latest patches 1.37.3, 1.36.7 and 1.35.11, released November 25, 2026). For Compose basics, see Docker Compose vs docker run.
Already running Proxmox? Proxmox vs Kubernetes explains how the two layers fit together, including running k3s or Talos in VMs.
What Docker Compose does
Docker describes Compose as “a tool for defining and running multi-container applications,” managing services, networks and volumes in a single YAML file. You write a compose.yaml (or docker-compose.yml), run one command, and Docker creates everything on the host it’s connected to.
Its appeal for home servers is directness:
- One readable file per app stack, easy to keep in Git and back up.
- Restart policies (
restart: unless-stopped) bring services back after a reboot. - Most self-hosted projects publish a ready-made Compose file as their primary install method.
- Day-to-day commands are short and predictable:
docker compose up -d,docker compose pull,docker compose logs -f.
What it doesn’t do: schedule work across several machines, move containers to another host when one fails, or roll out updates gradually with automatic rollback. If the host goes down, so do its containers.
What Kubernetes adds
Kubernetes’ own overview lists what it provides: service discovery and load balancing, storage orchestration, automated rollouts and rollbacks, self-healing (restarting or replacing failed containers and withholding traffic until they’re ready), secret and configuration management, and horizontal scaling.
The same page is clear about what it is not: it doesn’t build your application, doesn’t provide databases or other middleware as built-in services, and doesn’t dictate logging or monitoring. You assemble those pieces yourself, which is where most of the learning curve lives. Each Kubernetes minor version also gets roughly one year of patch support, so a cluster needs regular upgrades.
Docker Compose vs Kubernetes at a glance
| Feature | Docker Compose | Kubernetes (e.g. k3s) |
|---|---|---|
| Scope | One Docker host | A cluster of one or more nodes |
| Config format | One YAML file per stack | Many YAML manifests (Deployments, Services, Ingress, volumes), often templated with Helm |
| Learning curve | Low | High |
| Self-healing | Restart policies on one host | Reschedules failed pods, including onto other nodes |
| Rolling updates and rollback | Manual (pull, recreate) | Built in |
| Networking and ingress | Docker networks; add a reverse proxy yourself | Cluster DNS and Services; k3s bundles Traefik as ingress |
| Persistent storage | Bind mounts and named volumes on the host | PersistentVolumes; k3s bundles a local-path provisioner |
| Minimum resources | Whatever your containers need | k3s server: 2 cores, 2 GB RAM; agent: 1 core, 512 MB |
| Upgrade burden | Docker Engine and images | Kubernetes minor version roughly yearly, plus images and add-ons |
| Best home-lab fit | Single server running many apps | Multi-node labs, learning, high-availability experiments |
The same app both ways
A small web service shows the difference in effort. With Compose:
services:
whoami:
image: traefik/whoami:latest
ports:
- "8080:80"
restart: unless-stopped
docker compose up -d
docker compose ps
The Kubernetes equivalent needs a Deployment (what to run and how many copies) and a Service (how to reach it):
apiVersion: apps/v1
kind: Deployment
metadata:
name: whoami
spec:
replicas: 2
selector:
matchLabels:
app: whoami
template:
metadata:
labels:
app: whoami
spec:
containers:
- name: whoami
image: traefik/whoami:latest
ports:
- containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
name: whoami
spec:
type: LoadBalancer
selector:
app: whoami
ports:
- port: 8080
targetPort: 80
On k3s, the bundled ServiceLB load-balancer controller exposes a LoadBalancer Service on the nodes’ addresses, so this works without extra components:
sudo k3s kubectl apply -f whoami.yaml
sudo k3s kubectl get pods,svc
The Kubernetes version runs two replicas and will replace either one if it crashes, or move it if a node fails. That’s real value in a cluster, and extra ceremony on a single box.
k3s: Kubernetes sized for home labs
The K3s project describes itself as “Lightweight Kubernetes. Easy to install, half the memory, all in a binary of less than 100 MB,” and lists home labs, edge, IoT and single-board computers among its target uses. It bundles the pieces a small cluster needs: containerd, Flannel networking, CoreDNS, Traefik ingress, the ServiceLB load balancer, a local-path storage provisioner and, by default, SQLite as the datastore (etcd, MySQL and Postgres are options).
Requirements
- Server node: 2 CPU cores and 2 GB RAM minimum; agent node: 1 core and 512 MB.
- Storage: the docs say performance depends on the datastore and recommend SSDs. On Raspberry Pi and other ARM boards they recommend an external SSD, warning that etcd is write-intensive and that SD cards and eMMC can’t handle the I/O load.
- Ports: 6443/TCP must be reachable by all nodes; 10250/TCP for the kubelet; 8472/UDP for Flannel VXLAN (keep it closed to the internet); 2379–2380/TCP between servers only for embedded-etcd high availability.
Install a single-node k3s cluster
The quick-start installs k3s as a service that restarts automatically:
curl -sfL https://get.k3s.io | sh -
sudo k3s kubectl get nodes
As with any curl | sh installer, you can download the script and read it before running it. To add worker nodes, read the join token from the server and run the installer on each agent with the server’s address:
sudo cat /var/lib/rancher/k3s/server/node-token
curl -sfL https://get.k3s.io | K3S_URL=https://myserver:6443 K3S_TOKEN=mynodetoken sh -
The admin kubeconfig is written to /etc/rancher/k3s/k3s.yaml. Treat it like a root password: anyone with that file controls the cluster. Don’t make it world-readable, and don’t expose port 6443 to the internet; use a VPN for remote management. A Proxmox host is a convenient place to run three small VMs as a practice cluster; see Proxmox vs Docker for how these layers fit together.
Day-to-day maintenance compared
The bigger difference shows up after installation, when you update apps. With Compose, updating a stack is two commands run from its folder, and rolling back means pinning the previous image tag in the file and running up again:
docker compose pull
docker compose up -d
In Kubernetes you change the image in the Deployment (or let a GitOps tool do it), and the cluster replaces pods gradually, keeping the old ones until new ones are ready. If something breaks, the previous version is one command away:
sudo k3s kubectl set image deployment/whoami whoami=traefik/whoami:latest
sudo k3s kubectl rollout status deployment/whoami
sudo k3s kubectl rollout undo deployment/whoami
That safety net is genuinely useful, but it comes with its own upkeep: the cluster itself must be upgraded through supported Kubernetes versions, and bundled components such as Traefik change with it. On a single home server, Compose’s simpler model usually means less total maintenance.
Moving from Compose to Kubernetes
You don’t have to rewrite everything by hand. Kompose, documented on kubernetes.io, converts Compose files into Kubernetes resources:
kompose convert -f compose.yaml -o k8s/
sudo k3s kubectl apply -f k8s/
It writes one Deployment and one Service file per Compose service. The documentation’s own example shows it ignoring unsupported keys such as build and networks, so review every generated file, especially volumes, environment variables and secrets, before applying it. Stateful apps with databases need the most attention, because storage that was a simple bind mount in Compose becomes a PersistentVolumeClaim tied to a node or storage class.
Decision checklist
- Choose Docker Compose if you run one home server, want to follow each project's official install docs, and prefer minimal maintenance.
- Choose k3s if you want to learn Kubernetes for work, run three or more nodes for failover, or use GitOps tools that deploy from a Git repository.
- Stay on Compose for databases and photo libraries unless you're comfortable with Kubernetes storage; a mistake there risks data, not just uptime.
- Don't use Kubernetes as a backup strategy. Self-healing restarts containers; it doesn't protect data. Back up volumes either way.
- Mix them if you like: many labs run production home services on Compose and a separate k3s cluster for experiments.
If you’re starting out, install Docker with the Compose plugin first (see install Docker Compose on Ubuntu) and learn the lifecycle commands in docker compose down vs stop. More guides are in the Docker section.
Frequently asked questions
Is Kubernetes overkill for a home server?
For a single machine running a handful of apps, usually yes. Compose gives you the same containers with far fewer moving parts. Kubernetes starts to pay off with several nodes, or when learning it is the goal.
Is k3s real Kubernetes?
Yes. The K3s project describes it as a fully compliant Kubernetes distribution packaged as a single binary under 100 MB, with defaults such as SQLite, Traefik and a local-path storage provisioner chosen for small setups.
Can I convert a docker-compose.yml to Kubernetes automatically?
Kompose can generate Kubernetes Deployments and Services from a Compose file with 'kompose convert'. It skips keys it doesn't support, such as build and networks, so treat the output as a starting point and review it.
What about Docker Swarm?
Swarm is Docker's built-in clustering mode and sits between Compose and Kubernetes in complexity. It's an option if you want simple multi-node scheduling with familiar Compose-style files, but Kubernetes has the larger ecosystem.
Sources
- Docker Compose overview: Docker Docs
- Overview (Kubernetes): Kubernetes
- Releases: Kubernetes
- K3s - Lightweight Kubernetes: K3s Project
- Requirements: K3s Project
- Quick-Start Guide: K3s Project
- Translate a Docker Compose File to Kubernetes Resources: Kubernetes
We research every guide from manufacturer documentation, government and standards bodies, and other primary sources, which are cited at the end of each article. We do not accept payment for coverage. Read our editorial policy to see how articles are researched, fact-checked and updated, or tell us if something is out of date.