How to Run Docker on Proxmox the Right Way (and Avoid Common Mistakes)

How to run docker on proxmox the right way

With most running Proxmox or leaning towards running Proxmox in the home lab for the foreseeable future, running Docker containers on top of a Proxmox environment is a given. Proxmox is an enterprise-grade virtualization platform. Docker is still the defacto standard to run application containers. Combining the two is definitely a powerful combination, but many run into confusion about doing this the “right” way. Should you or can you install Docker directly in Proxmox? Should you use LXC or a full virtual machine? Let’s look at the best practices for running Docker on Proxmox and see what pitfalls to avoid.

Is Proxmox a good platform for running Docker containers?

Yes, it is. Proxmox supports many different virtualization solutions. It supports Linux containers (LXCs) and can also run virtual machines on the same hardware. Docker fits really well into Proxmox since it has these options for hosting applications.

With Docker containers, you can run containerized apps for automation, media servers, CI/CD processes, monitoring, etc. Running Docker also allows you to have a clean separation of services. You can spin up a dedicated VM or LXC to serve as a Docker host. I have found this definitely helps to keep your environment organized and prevents a single container from consuming all system resouurces.

The wrong or not so good way to run Docker on Proxmox

Let’s talk about a common mistake or something that you may not want to do. Installing Docker directly on the Proxmox host may be tempting as you can do it. Doing this however can lead to problems and potential conflicts and issues.

When you install Docker, it does several things that could lead to issues with your Proxmox networking:

  • Docker changes system network configurations
  • Your iptables rules get changed
  • Sometimes bridges and virtual networks Proxmox uses for VMs and LXCs might get changed
  • Updates and recovery get dicey because now your host is responsible for running both Proxmox and Docker
  • If you ever need to rebuild or update Proxmox, you will have an issue if you wipe out your containers or configuration.

It is generally better I think, to run Docker inside a VM or an LXC container that’s dedicated to it. This isolates Docker from the Proxmox host so you don’t have the challenges we mention above. It also gives you more control over resources, and when it comes to backup and disaster recovery using something like Proxmox Backup Server, it is much easier.

Running docker stacks
Running docker stacks

If you must run Docker directly on top of your Proxmox host, note the steps below as guidance for doing so.

Your first option is running Docker in a virtual machine

Running Docker in a VM is arguably the best option. You can spin up a full virtual machine using your favorite distro, whether this is Ubuntu Server, Debian, or Rocky Linux for the base OS. Then you can install Docker and Docker Compose on the VM as the Docker host.

Advantages to this:

  • You get the full kernel of the VM and control over everything without affecting Proxmox
  • Backups with Proxmox VM snapshots (snapshots are not really backups but good quick rollbacks) or Proxmox Backup Server
  • Isolated from your Proxmox host
  • Easy to move or clone to another host

Disadvantages:

  • A little higher resource usage due to the full OS overhead of the VM

Best practices for Docker in a VM:

  1. Use Debian or Ubuntu Server – Both work and are supported. I tend to use Ubuntu Server as it has tons of documentation, support, etc.
  2. Add QEMU guest agents – This gives you better integration from Proxmox to the guest VM. This allows you to see network and other information of your Docker host.
  3. Use virtio network adapters – This gives you the best performance
  4. Create a dedicated disk for Docker volumes – this is really a good best practice since it separates your docker volume from root. I have seen many times where Docker volumes grow to the point of filling up a disk and it is better to fill up a dedicated disk than your root disk as well. Create a disk and mount this to /opt or /srv so your app data in Docker is separate from the OS
  5. Back up volumes using rsync, restic, or Proxmox Backup Server – If you are running in a VM you can just use PBS to grab the whole VM. I like to have a second copy though using something like rsync, restic, Duplicati, or something else.

Below is a view of a virtual machines with QEMU guest agent running that allows you to see the guest information.

Qemu agent installed in proxmox virtual machine
Qemu agent installed in proxmox virtual machine

Running Docker inside an LXC container

With Proxmox, LXCs are a great way to run a lot of things. Especially from a resource perspective, it allows you to run apps and host various resources without much overhead. These share the Proxmox host kernel. They are also blazing fast and efficient, booting in seconds. But, you will want to note, there are a few configuration tweaks you want to note with running Docker in an LXC and Docker host in general.

Creating an lxc container in proxmox
Creating an lxc container in proxmox

Advantages:

  • they are lightweight and fast to start
  • Very little storage footprint
  • Great for small apps, web services, or dashboards, etc

Disadvantages:

  • Some Docker features may not work (depending on kernel modules)
  • Not all images work
  • More effort to configure correctly in some cases

How to set it up:

  1. When creating the LXC, enable nesting and keyctl under “Options” in Proxmox
  2. Use a Debian or Ubuntu LXC template as I have found these are best for compatibility
  3. Install Docker
  4. Verify cgroup v2 support and that overlay and aufs modules are on the host
  5. Map persistent storage from the host to the LXC using Proxmox volume mounts or bind mounts to /opt/appdata

This setup works great for lightweight apps like Nginx Proxy Manager, Dozzle, or AdGuard Home. However, if you do happen to run into kernel compatibility issues or unusual permission errors, moving those containers into a VM will likely solve the issue from what I have seen.

Proxmox networking when running Docker containers

Networking can get tricky if you don’t account for it. Both Proxmox and Docker use Linux bridges. As we mentioned earlier, that can be tricky or lead to conflicts if you let Docker create its own bridge networks that overlap with Proxmox’s management network, so take note of that. This is why it is recommended to run Docker in an isolated environment inside an LXC container or a virtual machine as this tends to be the best approach for isolation and simplicity.

Docker networks
Docker networks

If you must run Docker on top of Proxmox, keep these things in mind:

  • Use the Proxmox’s default bridge vmbr0 for VM and container traffic
  • Use macvlan or ipvlan drivers in Docker to attach containers to your LAN if you need this
  • Disable Docker’s iptables tweaks and mods by setting “iptables”: false in /etc/docker/daemon.json if it conflicts with Proxmox’s bridge rules

Another option is creating a dedicated bridge in Proxmox (like vmbr1) just for Docker networks. This might be the best option for keeping things separated. You can then attach your Docker VM’s virtual NIC to this bridge. This will give you allowing full control over things like IPs and VLANs as well.

Check out my Docker networking tutorial: Docker Networking Tutorial: Bridge vs. Macvlan vs. Overlay for Home Labs.

Docker storage considerations and best practices

One of the topics in general that can be confusing and a point to learn in general is Docker storage. By default, Docker keeps its data under the directory /var/lib/docker. This works by defaultin most cases, but this will leave it sitting on your system disk. And as we mentioned above, that can lead to disk filling up issues.

You need to keep in mind that if you have it on your system disk, the storage can grow without any limits. You can leave it like this, but be sure to have monitoring on your system disk and do your normal housekeeping tasks. See my post on the docker prune command which is what I highly recommend for this: Docker Prune Automating Cleanup Across Multiple Container Hosts.

Reclaiming space on a docker host
Reclaiming space on a docker host

As mentioned, you can mount a separate disk for your Docker persistent data and then just mount it as something like /opt/docker or /srv/docker. This is separate and the safest option. In Proxmox, you can attach a secondary virtual disk or bind a CephFS or NFS share to that directory.

Using this disk layout, it makes it easy to snapshot, migrate, or back up your Docker data. That way you don’t have to mess with the rest of the system. It also keeps you from having your main OS volume from filling up due to Docker images or logs.

Backup your Docker environment on Proxmox

This is a subject that needs to be addressed with careful thinking. There’s a common misconception that you can just back up containers and call it done. The truth is that the container is disposable. What matters are your volumes, configurations, and images.

You can back up Docker environments on Proxmox in several ways that makes sense.

  • VM snapshots – If Docker runs in a VM, you can take full Proxmox snapshots or backups with Proxmox Backup Server. This captures both OS and data disks.
  • Volume sync – You can use rsync, rclone, or restic to back up your /opt/docker directory to a NAS or cloud location
  • Git repository – Store your Docker Compose files and environment files in a private Git repo. This can act as your blueprint for recreating the environment quickly. See my post here about backing up your home lab: Ultimate Home Lab Backup Strategy (2025 Edition).
  • Portainer backups – If using Portainer, you can export your stack configurations and settings on a regular basis

The best setups combine VM-level protection with volume-level copies. That way, if you ever rebuild your VM, you can restore data and bring containers back online with the single command:

docker compose up -d

Definitely monitor

Like any technology monitoring your Docker containers helps you to catch performance issues and any other bottlenecks if these come up. Proxmox already gives you a decent dashboard for the host itself. There you can monitor CPU, memory, disk latency/usage, etc. However, container-level visibility means you need additional tools for that job.

If you want to go the open-source route, you can use cAdvisor and Node Exporter inside your Docker environment. These tools allow you to export metrics to something like Prometheus. Then you can visualize them in Grafana. I have a full tutorial on how to set this up here: Docker Container Monitoring with cAdvisor Node Exporter Prometheus and Grafana.

Cadvisor providing docker insights
Cadvisor providing docker insights

For a commercial solution that has a home lab license, I use Netdata, which monitors both the Proxmox host and Docker containers at the same time. You can check out my overview of Netdata here: Netdata Docker Monitoring for Home Lab.

Viewing cgroup information for containers in netdata
Viewing cgroup information for containers in netdata

Recap of the common mistakes to avoid

Just to review, note the following common mistakes that are often made with running Docker with Proxmox:

  1. Installing Docker on the Proxmox host – Can cause network and update conflicts. Also, this makes it much more difficult to backup and recover a host/containers
  2. No persistent storage – If you don’t use bind mounts for persistent data, your data disappears when containers are recreated
  3. Improper or no backups – Snapshots without volume copies aren’t enough. You need to include persistent directories
  4. Overlapping bridges – Plan your IP ranges to prevent Docker’s default subnet from colliding with your LAN addresses if those overlap
  5. Not monitoring – Without visibility on your Docker host and for the containers themselves, you won’t know when a container is resource-hungry or unhealthy or when disk space might be getting low

Video overview of how to install Docker on Proxmox

Wrapping up

Both Docker and Proxmox are amazing tools for the home lab and allow you to self-host and learn many other different technologies, services, and applications. I think these tools can complement each other. However, as we have explored, there are definitely some things you want to keep in mind and mistakes to avoid when running both in parallel. The good thing is that Proxmox has a couple of resources in virtual machines and LXC containers that make great Docker container hosts. Using these and noting the pros and cons of each will allow you to use both to their full potential and run containers without issue. How about you? What are you using in Proxmox to host your Docker containers?

Google
Add as a preferred source on Google

Google is updating how articles are shown. Don’t miss our leading home lab and tech content, written by humans, by setting Virtualization Howto as a preferred source.

About The Author

Brandon Lee

Brandon Lee

Brandon Lee is the Senior Writer, Engineer and owner at Virtualizationhowto.com, and a 7-time VMware vExpert, with over two decades of experience in Information Technology. Having worked for numerous Fortune 500 companies as well as in various industries, He has extensive experience in various IT segments and is a strong advocate for open source technologies. Brandon holds many industry certifications, loves the outdoors and spending time with family. Also, he goes through the effort of testing and troubleshooting issues, so you don't have to.

5 1 vote
Article Rating
Subscribe
Notify of
guest
9 Comments
Oldest
Newest Most Voted
Jan Bachelor

Great article, Brandon, thank you! I’m just about to start learning Ansible and was thinking of deploying a few Docker containers when I never deployed them on Proxmox. Will use the VM route.

Btw you have a duplicate unfinished paragraph there:

“Networking is always an area where it is best to plan ahead. Both Proxmox and Docker use bridges. You can get into a situation where conflicts can happen if you” – just need to delete it.

Keep it coming!

JohnnyD

I need to get more into Ansible for home lab projects.

Cole Snyder

I am running docker containers in a Kubernetes cluster which I have running on Debian VMs hosted in Proxmox. For container storage I’m using rook-ceph. I then backup the VMs to PBS. It’s not great for visibility into what I’m backing up but it’s taught me a lot about K8s and has been extremely convenient to quickly spin up new docker containers and get them networked with my VM based services.

Cole Snyder

I went with a vanilla Debian setup. 3 workers and 1 control plane. Eventually I’ll expand that to 5 workers and maybe a redundant control plane. Vanilla K8s as well. It’s been surprisingly easy to upgrade. Only annoying thing was disabling swap on the nodes permanently. I had to set a parameter in /etc/default/grub to force systemd to stop bringing swap back from beyond the grave. Rook has been great but I will confess I know practically nothing about ceph under the hood.

Roland

>The much better approach is to run Docker inside a VM or an LXC
>container that’s dedicated to it

it’s an absolute bad idea to recommend docker inside LXC, as this has issues very often. just as now

https://forum.proxmox.com/threads/docker-inside-lxc-net-ipv4-ip_unprivileged_port_start-error.175437/

plase, do NOT recommend that

also see

https://bugzilla.proxmox.com/show_bug.cgi?id=4712