Last updated: November 28, 2026
Two places to run Docker on Proxmox, and how they differ.
Proxmox VE gives you two places to run Docker: inside an LXC container or inside a virtual machine. Both work. They differ in isolation, in the settings you must change, and in what happens when you move or back up the guest. This guide compares them using the Proxmox documentation, then shows the commands for each, with a small docker compose file to test.
If you are still deciding which apps belong on Proxmox at all, start with our guide to self-hosted apps that run better on Proxmox than Docker. This article covers the next step: where to put Docker itself.
Docker in an LXC container compared with Docker in a VM.
How an LXC Container and a VM Differ
Proxmox describes containers as a lightweight alternative to fully virtualized machines. A container uses the kernel of the host instead of emulating a whole operating system, so its runtime cost is usually negligible. The trade-offs, in Proxmox's words, are that only Linux distributions can run in a container, and that access to host resources is restricted through separate namespaces and blocked system calls.
A VM has its own kernel and virtual hardware. That costs more memory and CPU, but it is a stronger boundary. The Proxmox documentation says that because containers share the host kernel, they expose an attack surface, and that in general full virtual machines provide better isolation. It names containers given to unknown or untrusted people as the case where that matters.
| LXC container | Virtual machine | |
|---|---|---|
| Kernel | Shares the Proxmox host kernel | Has its own kernel |
| Isolation | Namespaces, AppArmor and seccomp. Proxmox says VMs isolate better | Full virtualization |
| Docker needs | nesting and keyctl features, unprivileged container recommended | Nothing special, install Docker as on any Linux server |
| Moving it between nodes | No live migration. A restart migration shuts down, moves and starts it | Live migration is possible |
| Guest OS | Linux only | Linux, Windows and others |
| Overhead | Usually negligible, per Proxmox | Full OS plus virtual hardware |
Docker in an LXC Container
This section covers the container route: why its settings matter, then the commands to create it.
Why the container settings matter
New containers are unprivileged by default. In an unprivileged container, root inside the container is mapped to an ordinary user on the host, so most escape problems affect that user and not the host. Proxmox says the LXC team thinks unprivileged containers are safe by design. Privileged containers are the opposite: the LXC team considers them unsafe and will not treat new escape bugs as security issues worth a quick fix. Keep them for trusted environments only.
Docker needs two features. According to the Proxmox container reference, keyctl allows the keyctl() system call, which is required to use Docker inside an unprivileged container. nesting allows nested containers and exposes the host's procfs and sysfs contents to the guest, so enable it only on the container that needs it.
Create the container
Download a Debian system template, then create the container. The names in angle brackets are yours to fill in. The syntax follows the Proxmox pveam and pct examples.
pveam update
pveam available --section system
pveam download local <template-name>
pct create 200 local:vztmpl/<template-name> \
-hostname docker-lxc -cores 2 -memory 2048 \
-rootfs local-lvm:16 \
-net0 name=eth0,bridge=vmbr0,ip=dhcp \
-unprivileged 1 -features nesting=1,keyctl=1
pct start 200
pct enter 200
Here local-lvm:16 allocates a new 16 GiB root volume on the storage called local-lvm. Change the ID 200, the storage name and the bridge to match your server. If the container already exists, you can add the features later with pct set 200 -features nesting=1,keyctl=1 and restart it.
Docker in a Virtual Machine
A VM needs no special flags. Create it in the web interface with a Debian or Ubuntu Server ISO. Proxmox suggests ticking the QEMU Agent box if you plan to install the QEMU guest agent, because it lets Proxmox show more information and handle actions such as shutdown and snapshots more intelligently. Then install the agent inside the guest and continue with the Docker steps below.
sudo apt install qemu-guest-agent
sudo systemctl enable --now qemu-guest-agent
Install Docker and Test It
The steps are the same in the container and the VM. Add Docker's apt repository and install the packages as described in the Docker Engine install guide for Debian, which includes the docker-compose-plugin package. Then check the install:
sudo docker run hello-world
For a real test, save the compose file below as compose.yaml. It is the example from the Uptime Kuma project, a self-hosted uptime monitor. The image tag and options come from that project, so check its page for the current ones before you rely on them.
services:
uptime-kuma:
image: louislam/uptime-kuma:2
restart: unless-stopped
volumes:
- ./data:/app/data
ports:
- "3001:3001"
docker compose up -d
docker compose ps
Open http://<guest-ip>:3001 in a browser to finish setup. The data folder sits next to the compose file, so it lives on the guest's own disk.
Backups, Snapshots and Moving the Guest
Proxmox backs up containers with vzdump and restores them with pct restore. Because Docker keeps its data on the container's root disk in the setup above, one backup of the container captures Docker and its volumes together. The same reasoning holds for a VM disk. Bind mounts are different: Proxmox says they are not managed by the storage subsystem, so you cannot snapshot them or apply quotas to them from inside the container, and they are never included in backups.
Moving is where the two differ most. Proxmox says running containers cannot be live-migrated because of technical limitations. A restart migration shuts the container down, moves it and starts it again on the target node, and Proxmox says that because containers are lightweight this normally means a downtime of only some hundreds of milliseconds. A VM can be live-migrated, as long as the CPU types of the nodes are compatible.
What About Proxmox OCI Support?
Recent Proxmox VE versions can also create containers straight from OCI images, the same format Docker images use. Proxmox labels these application containers as a technology preview. It also states that for maximum isolation and the ability to live-migrate, nesting containers inside a Proxmox QEMU VM remains a recommended practice. Treat OCI support as something to try on a test node, not as a replacement for the setup above yet.
Planning Resources and Storage
Before you create anything, decide how much of the host the guest gets. A container only takes what it uses, because it shares the host kernel. A VM reserves its memory and runs a full operating system, so it costs more RAM at idle. Both let you set CPU cores and memory when you create them, as the commands in this guide show.
Where Docker keeps its data
Docker writes images and volumes to the guest's own disk unless you point it elsewhere. That is why one Proxmox backup of the guest captures everything in the simple setup above. Mount a separate disk or a bind mount only when you have a reason, and remember what Proxmox says about bind mounts: they sit outside the storage subsystem, so no snapshots, no quotas and no backups for that data.
Sizing a first guest
The examples use 2 cores, 2048 MiB of memory and a 16 GiB disk. That is a starting point for one or two small services, not a recommendation for every workload. Watch real usage in the Proxmox web interface for a week, then resize. Proxmox lets you change these values later, so there is no need to guess large.
Common Mistakes to Avoid
Most problems with Docker on Proxmox come from the choices above, not from Docker itself. These are the ones the Proxmox documentation points toward.
- Using a privileged container to make Docker work. Turn on
nestingandkeyctlin an unprivileged container instead. - Leaving nesting on for every container. Proxmox notes it exposes the host procfs and sysfs contents to the guest, so enable it only where needed.
- Assuming bind-mounted data is backed up. It is not, according to Proxmox.
- Expecting live migration for a container. Only a restart migration is available.
- Copying a compose file without checking its image tag. Projects change tags, so read the project page first.
When you are ready to look at the wider picture, our comparison of VMware and Proxmox explains where each platform fits, and the Windows Server 2025 lab guide for Hyper-V, VMware and Proxmox shows Proxmox next to its alternatives.
Which One Should You Pick?
- Trusted apps on one home server: an unprivileged LXC with nesting and keyctl. You save memory and get fast start-up.
- Public-facing services or images from sources you do not know: a VM. The extra RAM buys a stronger boundary.
- A cluster where guests must move without stopping: a VM.
- An app that needs its own kernel modules or drivers: a VM.
Frequently Asked Questions About Docker on Proxmox
Conclusion and Next Steps: Choosing Between LXC and a VM
Docker works well on Proxmox in both places. An unprivileged LXC container with nesting and keyctl is the light, fast choice for trusted home lab apps. A VM costs more memory but gives stronger isolation and live migration. Avoid privileged containers.
Your next step: pick the guest type from the list above, create it with the commands shown, and run the Uptime Kuma compose file as a test. Then take a backup before you add real services.
We'd love to hear your thoughts! Leave a comment below
and share your experience or questions.