basforge

Search titles, text and the “If it doesn’t work” cases.

    RU

    Docker on Proxmox goes in a VM, not on the host or in LXC

    Docker on the Proxmox host itself sets the FORWARD chain policy to DROP, and guests on bridges lose their network. In an LXC container Docker works, but it relies on permissions that break with updates to the kernel, AppArmor and Docker itself. Proxmox explicitly recommends a VM: Ubuntu with Docker inside behaves like any VPS and costs 300–500 MB more memory.

    Three places to run Docker on Proxmox, and what happens with each:

    Where What happens
    On the host Docker bends the host’s iptables to its needs: the FORWARD policy becomes DROP, and guest bridges stop passing traffic. Proxmox FAQ: installing Docker on the host isn’t recommended
    In an LXC container works with nesting=1, sometimes also keyctl=1. Breaks with updates: in November 2025, containerd 1.7.29, after the fix for CVE-2025-52881, stopped starting containers inside an unprivileged LXC (VM or LXC)
    In a VM its own kernel, its own iptables, its own cgroups. Docker behaves like on a VPS, and every Docker guide works without caveats

    Why it’s fragile in a container: Docker inside LXC is a container in a container. It expects rights from the kernel that LXC deliberately cuts: mounting overlayfs, writing to /proc/sys, creating its own cgroups. Each such hole is opened by an option, and every update to the kernel, LXC, AppArmor or runc can close it. It usually doesn’t break right away, but after the next apt upgrade in the guest.

    A VM costs the memory of the guest OS: idle Ubuntu 24.04 takes 300–500 MB. In return:

    • ufw, nftables and Docker ports work like on any server (Docker ports bypass the input chain);
    • the VM can move to another node without stopping;
    • Docker and its networks don’t touch the host: a broken daemon.json won’t bring Proxmox down.

    How to build it: an Ubuntu template with cloud-init (VM template with cloud-init), then Docker from Docker’s repository (Docker on Ubuntu). For a dozen compose stacks, 2 cores and 4 GB of memory are enough.

    If it doesn’t work

    Docker went onto the host — VMs and containers lost their network

    Cause
    Docker enables br_netfilter and sets iptables -P FORWARD DROP. Guest traffic through the bridge now passes the FORWARD chain and gets dropped.
    Fix
    Remove Docker from the host (apt purge docker-ce docker.io containerd.io), restore iptables -P FORWARD ACCEPT and reboot the host. Docker goes into a VM.

    How to check

    There’s no Docker on the host, and the FORWARD policy is untouched:

    command -v docker || echo "no docker on the host"
    iptables -S FORWARD | head -1        # -P FORWARD ACCEPT

    In the VM: docker run --rm hello-world prints Hello from Docker!.