DEV Community

Cover image for Docker Compose vs Kubernetes: You Probably Don't Need Kubernetes (Yet)
FlatlinerAtheist | CLI-NERDS
FlatlinerAtheist | CLI-NERDS

Posted on Originally published at clinerds.com

Docker Compose vs Kubernetes: You Probably Don't Need Kubernetes (Yet)

Somewhere around your second self-hosted app, a very persuasive voice appears — usually from a YouTube thumbnail — and tells you that you need Kubernetes. Containers at scale! Declarative infrastructure! The thing Google runs!

Maybe. But let me offer the less glamorous truth from someone who runs both: most people running a handful of apps do not need Kubernetes, and Docker Compose is the better tool for them. Not because Kubernetes is bad, but because every tool charges rent, and Kubernetes charges it in complexity.

What Docker Compose actually is

One YAML file that describes your whole stack. Here is a real, complete setup — an app, a database, and a reverse proxy:

services:
  app:
    image: myapp:latest
    restart: unless-stopped
    environment:
      - DATABASE_URL=postgres://app:secret@db:5432/app
    depends_on:
      - db
  db:
    image: postgres:16
    restart: unless-stopped
    volumes:
      - ./data:/var/lib/postgresql/data
  proxy:
    image: nginx:alpine
    restart: unless-stopped
    ports:
      - "80:80"
      - "443:443"
    volumes:
      - ./nginx.conf:/etc/nginx/nginx.conf:ro
Enter fullscreen mode Exit fullscreen mode

docker compose up -d and the stack is running. The file goes in git, so your entire infrastructure is versioned next to your code. On a single VPS, a home server, or a Raspberry Pi, this covers a shocking amount of real-world needs: my own closet server runs exactly this way, and our Compose stack guide walks through making it reliable.

What Kubernetes actually gives you

Kubernetes answers a different question. Not "how do I run these containers?" but "how do I run containers across many machines, keep them alive when machines die, roll out changes without downtime, and let a team share all that safely?"

Its real superpowers:

  • Self-healing across nodes — a machine dies, the workload moves. Compose restarts containers on the same box; it cannot help you if the box itself is gone
  • Declarative scaling and rollouts — replica counts, rolling updates, autoscaling, all first-class
  • A giant shared vocabulary — Deployments, Services, Ingress, RBAC, so a team of fifty can work on the same platform without stepping on each other

Notice that none of those matter much for "three apps on one server". They matter enormously for "three hundred services across fifty nodes".

The honest cost comparison

Docker Compose Kubernetes
Time to first working stack An afternoon Days to weeks, honestly
Moving parts Docker, one YAML file API server, etcd, scheduler, CNI, CSI...
When something breaks docker compose logs A debugging skill set of its own
Best at One machine, a few apps, small team Many machines, many services, bigger teams
Career value Useful everywhere Very high, if your goal is platform work

That debugging row is the one people skip. Compose failures are almost always "the container exited, here is why". Kubernetes failures can live in four different subsystems at once. You are not just adopting a tool; you are adopting a part-time job.

My actual decision rule

  • One server, a few apps, just you: Compose. Spend the saved weekend on backups.
  • A few servers, want HA without the full K8s learning curve: look at Docker Swarm (yes, still) or a managed service before raw Kubernetes.
  • Learning for a DevOps career, or genuinely running multi-node production: Kubernetes, absolutely — it is the industry standard for a reason, and our Kubernetes Cookbook series will take you from a local cluster to RBAC step by step.
  • "I will need it someday": no, adopt it when someday arrives. Compose YAML and Kubernetes manifests share the same container images, so nothing you build now is wasted.

The senior-engineer move is not always choosing the most powerful tool. It is choosing the smallest tool that fully solves your problem — and being able to explain the trade-off in one sentence. "I use Compose because I have one server and no cluster to manage" is a much stronger statement than "I use Kubernetes because it is what professionals use".

Top comments (0)