We have been pioneering a new solution that is the ultimate virtualization and container setup for development servers/ labs. We have used Proxmox VE for many years as a stable, Debian Linux based, KVM virtualization platform. Aside from virtualization, Proxmox VE has features such as high-availability clustering, Ceph storage, ZFS storage and etc built-in. While enterprises may love VMware ESXi, Proxmox VE is a great open alternative that saves an enormous amount on license costs.
Given the market Proxmox VE is targeted at, it adopted LXC as its container solution. We have many readers that love the Proxmox VE for its power and simplicity but wanted to add Docker containers given their popularity. With the next-generation Debian Stretch-based Proxmox VE 5.0 coming, we wanted to do a how-to guide on getting everything setup so that you can have Proxmox plus Docker with a Portainer web GUI to manage everything.
If you want to discuss this here is the original thread.
Proxmox VE + Docker + Portainer GUI How-to Video
Here is a video guide showing the setup from installation through starting a Monero Mining container via the Portainer web GUI.
We do want to caution that you may want to change the directories and users involved, and we will not recommend this for production. As a developer system, it works great. As described here, it is a security nightmare
Proxmox VE + Docker + Portainer.io GUI Steps and Commands
Video coming soon but I wanted to document the steps:
1. Install Proxmox VE 5.0
2. Make the following sources adjustments so you can update:
To fix this first add the no subscription sources:
# nano /etc/apt/add: deb stretch pve-no-subscription
Then remove the enterprise source:
# nano /etc/apt/comment out (add a # symbol in front) of this line: # deb stretch pve-enterprise
apt-get update && apt-get dist-upgrade -y
4. Install docker-ce:
apt-get install -y apt-transport-https ca-certificates curl gnupg2 software-properties-common curl -fsSL| apt-key add - apt-key fingerprint 0EBFCD88 add-apt-repository "deb [arch=amd64] $(lsb_release -cs) stable" apt-get update && apt-get install docker-ce -y
You should now be able to do docker ps and see no containers are running.
5. Install Portainer with a persistent container
Just for ease of getting started, we are going to make a directory on the boot drive. You should move this to other storage, but this makes it simple for a guide:
Install Portainer for a Docker WebGUI:
docker run -d -p 9000:9000 -v /root/portainer/data:/data -v /var/run/portainer/portainer
Again, make the directory on ZFS storage or similar, not in the root directory.
Wait about 15-30 seconds after you see Portainer start (you can check “docker ps” to see status.)
6. Your login URLs will be the following ports:
Proxmox GUI: https://<serverip>:8006 Portainer GUI: http://<serverip>:9000
At this point, you now have a GUI for everything you might want.
7. You may also configure Proxmox to restart on boot:
sudo systemctl enable docker
Update for those using a ZFS rpool for Proxmox VE Installation
If you are following this guide, and you installed Proxmox VE on a ZFS rpool, some things have changed (as of July 2018.) Docker will default to using ZFS as the storage driver and the system will not boot properly after you make a container. There is an easy fix to change the Docker ZFS path. We have a quick guide and video here Setup Docker on Proxmox VE Using ZFS Storage. The steps should take under 1 minute. Those steps are equally useful if you want to change the ZFS storage pool for Docker storage.