Running Docker on Proxmox VE: LXC container or VM

Docker and Compose workloads on Proxmox VE belong in a VM by default. This page explains when Docker in LXC is acceptable, what nesting and keyctl cost in isolation, and how to decide.

On this page

Running Docker on Proxmox VE: where should the containers live?

For Docker and Compose stacks on Proxmox VE, the recommended home is a KVM virtual machine. Docker depends on kernel features, namespaces and storage drivers, and a VM gives it its own kernel, so the Docker daemon, firewall rules and container runtime stay inside one guest that you can snapshot, back up and migrate as a unit. The other options are an LXC container (privileged or unprivileged), the OCI application container feature, which is still in preview, and a Kubernetes VM for stacks that need orchestration across several hosts. Decide per workload, default to a VM unless a specific reason points elsewhere, and record that reason along with the risk you accept.

Teams still consider LXC for Docker when the workload is small, the host is tightly sized and they want fast-starting containers alongside other system containers. Docker inside an LXC container usually needs the nesting feature and, depending on the Docker and storage setup, the keyctl feature as well. Both widen what the container can do against the host kernel. An unprivileged container with these features still shares the host kernel, and a privileged one is much closer to root on the host. Ask the platform team to name each feature you enable, why it is needed and who reviews it, and confirm the exact settings for your Docker version in a test container before you rely on them.

Before you choose LXC for any stack, check three things in a pilot: that the images start with the features you have enabled, that bind-mounted data keeps the ownership Docker expects, and that a restored backup starts the whole stack and passes a health check. For the OCI preview, confirm its status and supported scope in the release notes for your Proxmox VE version before any production use, since preview features can change. Kubernetes VMs fit when you need scheduling, rolling updates or multi-node failover across services, and they bring their own control plane, etcd and upgrade planning. The Proxmox VE administration guide introduction explains the guest types the platform supports.

Four places Docker workloads can run on Proxmox VE

Each option places Docker or container workloads at a different layer of the stack, and that layer sets the isolation boundary, the privileges you must grant and the upgrade work you inherit. Compare the four before you choose a home for a Compose stack or a Kubernetes cluster.

Docker in a KVM virtual machine

Docker runs in a full guest with its own Linux kernel and its own Docker daemon, and the hypervisor separates that guest from the Proxmox host. This is the recommended home for Docker and Compose workloads on Proxmox VE, because Docker gets the kernel features it expects without changes to the host. Check that the guest OS receives security updates, that the VM disk is included in your backup job, and that you can restore the whole guest as one unit.

Proxmox VE FAQ

Docker inside an LXC container

The container shares the Proxmox host kernel, and isolation comes from kernel namespaces rather than a hardware virtualization boundary. Running Docker inside it usually means enabling the nesting feature and often keyctl, and each of those features widens what the container may do on the host. Pick this option when you need a lighter footprint and accept a weaker boundary. Confirm which features your Docker version needs before you grant them.

OCI application containers in preview

Proxmox VE can run OCI images as application containers without a Docker daemon inside a guest, which removes one layer from the stack. The feature is in preview, so confirm its status for your exact Proxmox VE version and whether the vendor supports it for production before you plan a workload around it. Isolation is still container-based and shares the host kernel. Review the release notes and test image pulls, updates and rollback in a non-production cluster first.

Kubernetes in virtual machines

Kubernetes runs as a set of VMs, each with its own kernel, and Kubernetes adds its own scheduling, networking and API layer on top. The kubeadm high availability guide describes at least three control plane nodes behind a TCP load balancer on port 6443, so plan for more guests than a single Docker host needs. Choose this option for multi-node orchestration. Budget for etcd backups, version skew rules and the minor release cadence before you commit.

kubeadm HA guide

Docker in LXC features: nesting, keyctl and privilege settings

This table compares the LXC container settings that affect whether Docker runs, how much isolation you keep and how mounted files behave. Read each row as a trade-off: the setting that makes Docker work is usually the one that widens the container's reach into the host. Confirm exact option names and behavior in the Proxmox VE container documentation for your version before you change anything.

SettingWhat it enablesRisk or trade-offWhen it fits
NestingLets the container create its own namespaces and mounts, which Docker's runtime needs to start containersWidens what a container can do inside the host kernel, so a container escape has a larger surfaceSimple single-tenant Docker hosts where you accept the added kernel exposure
KeyctlAllows the kernel keyring syscalls that some container tooling and systemd components useAdds another kernel interface to the attack surface, and it is usually enabled together with nesting for DockerContainers that fail at startup with keyring-related errors and that you already trust
Privileged containerRemoves most user namespace mapping, so container root maps to host rootContainer root is effectively host root, so a compromise of the workload compromises the hostRarely appropriate for Docker workloads; prefer a VM when you need this level of access
Unprivileged containerMaps container root to an unprivileged host user through user namespacesSome Docker images and host-side device or file access need extra mapping work, and some features may not workDefault choice for LXC; confirm which Docker features work under your mapping before rollout
AppArmor profileApplies a host-side confinement profile to the container's processesProfiles that are too strict can block Docker's own mounts or actions, and loosening them reduces protectionKeep the default profile unless testing shows a specific required exception
File permissions on mountsLets the container read and write shared host paths or volumesUnder unprivileged mapping, host file owners and IDs may not match what the container expects, causing permission errorsData directories with known ownership; plan UID mapping before you mount storage
Overall fit for DockerRuns Docker and Compose inside a lightweight container with shared host kernelCombines the risks above, and backups and migrations must account for the container settingsLow-risk, trusted internal workloads where a separate VM is not justified

How to set up a Docker host on Proxmox VE

This sequence builds the recommended Docker host as a Debian virtual machine on Proxmox VE, then adds a checkpoint for teams that still want Docker inside an LXC container. Each step ends with a check you can run before moving on.

  1. Confirm the host and guest sizing

    Before creating anything, confirm the Proxmox VE node has spare CPU, memory and storage for the Docker workload plus the VM overhead, and that the node runs a supported Proxmox VE release. The Proxmox VE 9 series is the current line, and Proxmox VE 8 on Debian 12 has reached end of life, so check the release notes for your environment. Size the VM from the containers you plan to run, not from the host's total capacity. Done when you have a written resource request (vCPU, memory, disk) that the node can satisfy with headroom for other guests.

  2. Create the Debian virtual machine

    In the Proxmox VE web interface, create a KVM virtual machine from a current Debian cloud or installer image, using the disk controller and CPU type your team has standardized on. Enable the QEMU guest agent option in the VM settings at creation time so the agent can be installed in the guest later. Use a dedicated disk for Docker data if your storage design allows it, so image and volume growth does not fill the operating system disk. Done when the VM boots to a Debian login prompt and shows the expected CPU, memory and disk in the Proxmox VE summary.

  3. Install Docker Engine and the Compose plugin

    Inside the VM, install Docker Engine from Docker's official Debian repository rather than the older distribution package, then add the Compose plugin as part of the same installation. Confirm the package source in your own change process, because repository details change over time. Add only the administrative users who need Docker access, since membership in the docker group grants root-equivalent control of the host. Done when docker version and docker compose version both report a server and plugin version, and docker run --rm hello-world completes.

  4. Place image and volume storage deliberately

    Decide where Docker keeps images, containers and named volumes, and mount the dedicated disk at that path before pulling images. Keep the data root on a filesystem you can size, monitor and back up, and record the path in your runbook. Avoid placing Docker data on a path that other services also write to. Done when docker info shows the expected data root, a test named volume is created on the dedicated disk, and the free space on that filesystem is visible to your monitoring.

  5. Attach the VM to the correct VLAN

    Set the VM's network device on the Proxmox VE bridge and VLAN tag that match the segment your services belong to, and confirm that the firewall rules on that segment allow only the ports your containers publish. Keep management access to the Docker host on a separate path where possible. Done when the VM obtains an address on the intended subnet, a test connection from an allowed client succeeds, and a test connection from a client outside the policy fails.

  6. Enable the guest agent and backups

    Install the QEMU guest agent package inside Debian, enable the service, and confirm the Proxmox VE VM summary shows the agent as responding. Then add the VM to a backup job in Proxmox VE, using a backup mode your storage supports, and run one manual backup. Restore is the test that matters, so plan a restore to a scratch VM as a separate check. Done when the guest agent reports an IP address in Proxmox VE and the manual backup appears in the backup list with a completed status.

  7. Checkpoint: test Docker in LXC only when required

    Use this branch only if a specific workload cannot run in a VM. In an LXC container, nesting and keyctl are the features usually needed for Docker, and enabling them widens what the container can do on the shared host kernel. Enable only what the test needs, start a container, and run docker run --rm hello-world inside it. Record in your change log which features you enabled, why, and who accepted the trade-off. Done when the test container starts and the change record names the features, the workload and the owner. If the test fails or the trade-off is not accepted, return to the VM path above.

  8. Record the trade-off and hand over

    Write a short record for the Docker host that states whether it runs in a VM or an LXC container, the storage path, the VLAN, the backup job and the restore test date. For an LXC host, also record the enabled features and the reason they were needed. Ask your security team to review that record against your hardening baseline before production use. Done when the record exists in your runbook store, the owner and the restore test are named, and the host has been added to monitoring.

When a Kubernetes VM fits better than a Docker host

Move from Compose to Kubernetes only when you need what a single Docker host cannot give you: scheduling across several nodes, rolling workload replacement, and a declarative API that your delivery tooling can drive. If the workloads are a handful of services that one host can carry and a short restart window is acceptable, a Docker VM stays simpler. When you do go to Kubernetes on Proxmox VE, plan for a highly available control plane from the start. The kubeadm high availability guide describes at least three control plane nodes, with a TCP load balancer in front of kube-apiserver on port 6443 so clients never depend on one node's address.

The control plane also carries etcd, which holds cluster state. Kubernetes documentation says etcd should run with an odd number of members, and recommends five members in production. You choose between stacked etcd on the control plane nodes and an external etcd cluster, and both need a backup plan. Confirm with your platform team who takes etcd snapshots with etcdctl snapshot save, where they are stored off the cluster, and how a restore is rehearsed with etcdutl. Without that rehearsal, a failed Proxmox host can take the cluster state with it.

Upgrades carry the most ongoing cost. The version skew policy requires kube-apiserver to be upgraded one minor version at a time, before kube-controller-manager, kube-scheduler and kubelets, and allows kubelets to be up to three minor versions older than the API server. Kubernetes maintains only the three most recent minor releases, so every cluster needs a scheduled minor upgrade. Compared with one Docker host, the recurring work is larger: control plane patching, etcd checks, node drains, add-on compatibility and certificate handling. Ask any partner to quote that run cost explicitly, not only the initial build.

Choosing the right home by team and workload

A single Compose stack owned by one small team is the simplest case. Docker Engine inside a KVM virtual machine keeps the container runtime on its own guest kernel, so the team can follow standard Docker guidance without changing the Proxmox VE host. An LXC container can also run Docker, but it typically depends on settings such as nesting and keyctl, which loosen container restrictions. Confirm those choices before you commit to a design.

  • Default choice: a VM with Docker Engine and the Compose plugin, sized for the stack and included in your standard Proxmox VE backup schedule.
  • LXC option: reasonable for a trusted, low-risk stack if the team accepts the nesting and keyctl settings and retests them after each host update.
  • Patching: the VM's guest OS and Docker packages are patched independently of the Proxmox VE host, which keeps the change window small.
  • Migration: a VM moves with the same procedure as other guests, while container migration depends on the storage type of its volumes.

Confirm which Docker features the stack needs, whether any container must run privileged, and whether your team can maintain the guest operating system long term.

How the Docker host, container and Proxmox VE layers fit

The diagram starts at the Proxmox VE host kernel, which every workload shares. From there, Docker and Compose run either in a KVM guest with its own kernel or in an LXC container that shares the host kernel with Docker nested inside. A Kubernetes VM option places control-plane nodes behind a load balancer. Storage, backups and SSO attach at the edges, so check which layer owns each hand-off: the host kernel is shared by every LXC container, while a VM isolates its own kernel.

Docker sits inside either a KVM guest or an LXC container, both on the shared Proxmox VE host.

Security trade-offs of Docker in LXC compared with a VM

Running Docker inside an LXC container shares the host kernel and usually requires relaxed container settings, so the risk profile differs from a VM that carries its own kernel. The cards below cover each risk that changes the decision, the least-privilege setting to aim for, and the check to run before the workload goes live.

Shared host kernel

An LXC container runs on the Proxmox VE host kernel, so a kernel flaw that a container exploits affects the host and every guest on it. A VM runs its own guest kernel behind the KVM hypervisor, which adds a boundary. Keep the host patched on a regular schedule and confirm that the workloads you place in containers match the trust level of the other guests on that node.

Proxmox VE overview

Relaxed privileges for nesting and keyctl

Docker needs the nesting feature, and many images also need keyctl, to run its own namespaces and kernel keyring calls inside the container. Enable only the features the workload needs, keep the container unprivileged where possible, and record the exact features in the container configuration so reviewers can see the reduced isolation. Verify with pct config that no other feature flags were added.

AppArmor interaction

Docker inside an LXC container can conflict with the AppArmor profile applied to the container, which may block operations that Docker expects. Teams often respond by loosening the profile, which weakens containment. Test the container with the default profile first, and only change it with a documented reason. Confirm the effective profile after each change and retest the Docker service start.

Mount permissions and UID mapping

Unprivileged containers map container UID 0 to a high host UID, so files on bind mounts owned by root on the host appear inaccessible or wrongly owned inside the container. Docker volumes that expect specific UIDs fail for the same reason. Plan the host ownership of each mount point against the mapped range before the first start, and verify by running ls -ln inside the container and comparing it with the expected IDs.

Docker socket exposure

Any process that can reach /var/run/docker.sock can start a privileged container and reach the host filesystem, so the socket is effectively root on the machine. Do not mount the socket into other containers, including monitoring or CI agents, unless that tool is in the same trust zone. Check the mounts of every container with pct config and confirm no socket path appears.

Secrets in Compose files

Compose files often hold database passwords and API keys in plain text, and those files are copied into backups, templates and Git history. Move secrets into environment files or a secrets store with restricted file permissions, and keep Compose files free of literal values. Ask the team to confirm that backups of the container include only the secret files they intend to protect, and that the repository is scanned for committed credentials.

Questions teams ask before running Docker on Proxmox VE

Is running Docker inside an LXC container on Proxmox VE supported?

Docker inside an LXC container works on many setups, but it is not the configuration Proxmox VE recommends for Docker and Compose workloads, which is a virtual machine. Running Docker in a container usually means enabling the nesting feature and often keyctl, and both loosen isolation between the container and the host kernel. Confirm the current guidance in the Proxmox VE documentation for your release, then test your exact images, storage layout and privilege settings before any production use. Your own security team should decide whether the trade-off is acceptable for each workload.

What does moving Docker workloads from an LXC container to a VM involve?

The move has four parts: building a VM sized for the Docker host, recreating the Docker and Compose layout, moving persistent data, and cutting over DNS, certificates and backups. Effort rises with the number of stacks, how much data sits in bind mounts or named volumes, how many images depend on host-specific paths, and whether you need a parallel run for testing. Ask any provider to break the quote into inventory, build, data migration, cutover and rollback, and to state which items are one-time and which recur.

Can our own team move Docker workloads to a VM without outside help?

Yes, many platform teams do this themselves, especially for a small number of stacks with simple volumes. The work is mostly routine Linux and Proxmox VE administration, but it needs someone who can read Compose files, handle volume ownership and run a rollback test. Outside help tends to pay off when stacks are numerous, data is hard to move, or the team lacks time to test restores. Compare the internal estimate with a written scope before deciding, and make sure the cutover plan has a named owner.

How long does a VM-based Docker host take to deliver?

Duration depends on scope rather than on a fixed template: the number of hosts, the number and size of stacks, the state of existing data, the network and DNS changes, and how many approval steps your change process requires. A single host with a few stacks is a different job from a set of hosts with shared storage and monitoring. No duration is stated here because it has not been established for your environment. Ask for a timeline tied to specific milestones in the written scope.

What do we need to provide for a Docker on VM project?

Plan to provide administrative access to the Proxmox VE cluster or the relevant nodes, a network plan with addressing, VLANs, DNS names and firewall rules, a list of backup targets and retention requirements, and named owners for each application and for the change window. You also need the current Compose files, image sources, secret locations and a view of which data must survive the move. Missing items often delay projects more than the technical work, so request this checklist in writing before the kickoff.

What does a Kubernetes migration add on top of a Docker VM host?

Kubernetes adds a control plane, etcd, worker node management, an upgrade plan tied to a short support window per minor release, identity integration and secrets handling. For example, a three-node control plane with stacked etcd needs a load balancer in front of the API server and regular etcd snapshot backups. Kubernetes releases come roughly three times per year, and the project maintains only the three most recent minor versions, so upgrades become a recurring cost. Ask for the upgrade cadence, backup and restore tests, and secrets approach as separate line items in the quote.

What drives the cost of moving Docker to a VM, and what recurs afterward?

The one-time cost covers assessment, build, data migration, testing and cutover, and it grows with the number of stacks, the volume of data and the number of integrations. Recurring costs include backups, patching of the guest operating system and Docker, monitoring, and any support subscription. Proxmox VE subscriptions are priced per CPU socket per year, with tiers that differ in support tickets and response times, according to the Proxmox VE pricing page, so license cost depends on your socket count and chosen tier. Ask any quote to separate one-time services from recurring retainers.

How DeployOpen scopes and delivers Docker hosting on Proxmox VE

DeployOpen plans, builds, documents and supports Docker and Compose hosting on Proxmox VE inside infrastructure you control. We start from where your Docker workloads should run, then deliver a fixed scope agreed in writing before any work starts.

How we scope

  • We inventory the Compose stacks, images, storage paths and network exposure you plan to run on Proxmox VE.
  • We record the choice between a VM and a privileged or unprivileged LXC container for each workload, with the reasons written down.
  • The written scope lists the nesting and keyctl settings, backup approach and access model we will implement, so you can review them before work starts.

How we build

  • We create the Docker host VMs or containers, configure storage and networking, and install Docker and Compose in a repeatable way.
  • We test each stack's startup, restart and upgrade behavior on the chosen guest type before it is placed in service.
  • We check container privilege settings and mount permissions against what each workload needs, and remove anything it does not.

How we hand over

  • You receive configuration documentation covering guest settings, Compose file layout, mounts, secrets handling and access roles.
  • You receive a backup and restore runbook that has been tested for the Docker host, including the data directories your stacks write to.
  • Handover includes a walkthrough with your platform team so they can run upgrades, add stacks and troubleshoot without us.

How we support

  • Engagements are fixed-scope, and changes to the written scope are agreed in writing before they are built.
  • Ongoing support, Docker and Proxmox VE upgrades, and continuous testing are available as a retainer.
  • Ask any provider to confirm how they will track Docker and Proxmox VE release changes that affect your hosts before you sign.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.