Proxmox is a name you’ll hear a lot from the self-hosting and home lab communities, and having used it as my experimenting workstation for months, I can confirm that the platform lives up to its reputation. In addition to its rock-solid performance and a host of security measures, Proxmox also possesses all the advanced features you’ll ever want in a virtualization environment – all without forcing you to pay a dime!
Although LXC containers deployed using TurnKey templates work surprisingly well for most tasks, they can't fully replace their Docker counterparts. Thankfully, you can integrate Docker containers into your Proxmox workflow with just a few steps.
25 essential commands every Docker user should know
Docker's command-line interface may seem intimidating, but these commands can help you master it in no time!
Running Docker containers inside a virtual machine
Before I detail the setup procedure, it’s worth noting that you can technically run Docker inside an LXC container. However, it’s not recommended to do so, as VMs feature better isolation provisions and are far easier to troubleshoot when things go wrong. While I haven’t faced this issue myself, I’ve heard about users running into trouble with ZFS pools.
So, we’ll take the hassle-free path and set up Docker inside a normal Proxmox virtual machine. I’ve detailed the procedure to deploy a VM in my beginner’s guide to Proxmox, but here’s a short version of the whole process:
- Head to the local (username) section under the Primary Node and press the Upload button inside the ISO Images tab.
- Click on Select File, pick the ISO file for the operating system you’d like to use for the Docker VM, and hit the Upload button. I’ve used the GUI version of Debian, but you’re free to use any other OS, including the more lightweight CLI distros.
- Once Proxmox shows the Task OK message, tap the Create VM button and give your virtual machine a Name. Be sure to hit Next after each step.
- Click on the drop-down arrow next to the ISO image option and pick the ISO file you transferred to the Proxmox server earlier.
- Allocate the Storage, CPU, and Memory to the VM in their respective tabs before hitting the Finish button to deploy the virtual machine.
- Press the Start button and hit Console to access the virtual machine.
After the first boot, you’ll want to install the operating system on the virtual machine. Most distros have an easy-to-follow setup wizard to walk you through the installation procedure. Once that's done, you can follow these steps to configure Docker on the virtual machine:
- Open the terminal app.
-
Execute the following command to install Docker:
sudo apt-get install docker.io -y
-
Assuming your OS has the curl utility pre-installed, use it to grab the Docker Compose standalone plugin.
curl -SL https://github.com/docker/compose/releases/download/v2.29.6/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
-
Modify the permissions of the Docker Compose package with the chmod keyword.
chmod +x /usr/local/bin/docker-compose
On most Debian-based distros, curl should set /usr/local/bin as the location for Docker Compose.
Turning your Proxmox server into a self-hosting battlestation with Docker
With that, you should be able to run docker pull, docker run, and other essential commands to run your favorite services inside Docker containers. Heck, you can even create docker-config.yml files and run the docker-compose command to deploy containers with them.
But if you still prefer setting up Docker inside containers, you can do so by entering the same commands inside a Debian LXC container or by pasting tteck’s bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/docker.sh)" script inside the Shell tab of your Proxmox node.
A beginner’s guide to setting up nested virtualization on Proxmox
Ever wanted to run a Proxmox VM inside your Proxmox home lab? Here's how it's done
