DEV Community

Cover image for LXC, Docker or Kubernetes on Proxmox VE: which one, and when?
KVMDR
KVMDR

Posted on

LXC, Docker or Kubernetes on Proxmox VE: which one, and when?

Proxmox VE gives you three common ways to run containers: native LXC containers, Docker inside a VM, and Kubernetes on a set of VMs. They solve different problems, and picking the wrong one usually shows up later, during an upgrade or a recovery.

The short version

LXC Docker in a VM Kubernetes on VMs
What it is A full Linux system sharing the host kernel App containers inside a normal VM A cluster that schedules app containers across several VMs
Managed by Proxmox directly Docker / Compose inside the VM Kubernetes (kubectl, Helm)
Overhead Lowest One VM Several VMs plus the control plane
Isolation Shared kernel Full VM boundary Full VM boundary per node
Best for Lightweight Linux services Single apps and Compose stacks Many apps, scaling, self healing
Runs Windows? No No (Linux containers) No (Linux containers)

1. LXC: a lightweight Linux "server"

An LXC container behaves like a small Linux machine: it has its own init, users, packages and IP address, but uses the Proxmox host's kernel. You create it from the Proxmox UI like a VM, and it starts in a second or two.

Good for: DNS, reverse proxies, Pi-hole, small databases, monitoring, file shares; anything you'd run on a tiny Linux server.

Watch out for:

  • Kernel coupling. A host upgrade changes the kernel your containers run on. Proxmox VE 9 dropped cgroup v1, so containers with very old systemd (CentOS 7, Ubuntu 16.04) won't start.
  • Bind mounts. Data mounted from a host path is outside Proxmox storage and isn't included in backups or snapshots.
  • Docker inside LXC is possible but fragile across updates; Proxmox recommends a VM for Docker.

2. Docker in a VM: the simple app platform

Run a small Linux VM (Alpine, Debian, Ubuntu) and install Docker. Each app is an image; a Compose file describes the whole stack.

Good for: WordPress, Nextcloud, Home Assistant, Gitea, internal tools; any app shipped as a Docker image, especially multi container stacks.

Why a VM and not LXC: the VM has its own kernel, so Docker's networking and storage drivers behave as designed, and Proxmox upgrades don't break it. Everything (images, volumes, compose files) lives on the VM's disks, so the VM is one tidy unit to back up or replicate.

Proxmox VE 9.1 added the option to create containers from OCI (Docker) images, and 9.3 hardened it further. Proxmox's roadmap still lists maturing OCI support and Compose style multi container apps as future work, so for now Docker in a VM remains the safer choice for production.

3. Kubernetes on VMs: when you need orchestration

Kubernetes runs apps across several nodes and keeps them in the state you declared: it restarts failed containers, spreads load and rolls out updates. On Proxmox, each node is a VM. Lightweight distributions like k3s run happily on small Alpine or Debian VMs; a single VM is enough to learn, two or three for a real cluster.

Good for: many services, teams deploying often, apps that need scaling or zero downtime updates, or learning the platform most companies now run on.

Watch out for:

  • Complexity. More moving parts than Compose for a handful of apps.
  • Node IPs are baked into the cluster's certificates. Changing them later is painful, so give nodes static addresses.
  • State lives in two places: the cluster state (etcd, or SQLite on single node k3s) and the persistent volumes holding your data.

How to choose

  • One small Linux service? LXC.
  • An app that ships as a Docker image or Compose file? Docker in a VM.
  • Lots of apps, frequent deploys, or you need self healing and scaling? Kubernetes on VMs.
  • Not sure? Start with Docker in a VM. Moving a Compose stack to Kubernetes later is far easier than untangling Docker from an LXC container.

What this means for backup and DR

  • LXC: protect the container's disks and its config together, keep data off bind mounts, and make sure the recovery host matches (storage IDs, bridges, ID mapping, Proxmox version).
  • Docker in a VM: protect the VM. Images, volumes and Compose files all come with it.
  • Kubernetes: protect every node VM as one group recovered to the same point in time, keep node IPs unchanged at the recovery site, and keep your manifests in Git as a last resort rebuild.

Each approach is easy to protect once you know where its state lives. The mistakes come from treating all three as "just containers".

Next up

In the next article, we'll go hands on: protecting all three on Proxmox VE, step by step. We'll replicate an LXC container, a Docker Compose stack and a k3s cluster to a second site, fail them over, and check that every app and its data come back intact. Follow along so you don't miss it.

Top comments (1)

Collapse
 
userxnom profile image
Abdullah Naseer •

The framing that makes this worth bookmarking is in your first paragraph: picking the wrong one usually shows up later, during an upgrade or a recovery — not when you first deploy. The choice isn't really about performance, it's about which failure mode you inherit.

Two warnings in here are the ones that bite people in practice. The bind-mount one — data mounted from a host path sits outside Proxmox storage and silently isn't in backups or snapshots — is exactly the sort of thing you discover at the worst possible moment. And the kernel coupling point is concrete, not theoretical: Proxmox VE 9 dropping cgroup v1 means a host upgrade can break containers that were running fine the day before.

The backup section actually reframes the whole decision for me. LXC means protecting disks and config together, Docker in a VM means the VM is the unit, Kubernetes means every node VM recovered as one group to the same point in time. So the real question is "what unit do you want to restore?" — and that's worth deciding before you build, not after.

One pushback on the default advice: for someone whose whole workload is a handful of tiny Linux services — Pi-hole, DNS, a monitoring box — does "start with Docker in a VM" still win, or does LXC's near-zero overhead matter enough that the bind-mount discipline is worth learning instead?