Installing Docker Engine

(on RHEL derivatives)

Also See Official Docker Documentation Install Docker Engine

While other methods are provided in the offical documentation (see above), I prefer adding the offical Docker repository to my package manager as my source for Docker packages.

sudo dnf -y install dnf-utils
sudo dnf-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Note

Even though the repo URL used above references ‘centos’ these packages are suitable for Red Hat-family OS’s. Fedora and RHEL have their own URLs, so you can use those for Fedora and Red Hat respectively as you wish (see the documentation).

Add the packages

sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Note

In the past Docker Compose would need to be installed from a separate Github project, but these days the enhancement is added with the docker-compose-plugin package. Nice!

Enable the Docker system service and start it

sudo systemctl enable --now docker

Portainer Management of Docker

Portainer offers an excellent management webgui for your Docker host. Simply run the Portainer Docker Compose project to get it going. See my article Installing Portainer to get the steps.


Considerations for Hosting Docker

When considering my designs for hosting services in containerized or virtualized infrastructure I realized that I could reduce all services to containers and then just run docker engine directly on my server farm (an environment with 100% containers, 0% VMs). In the end I chose to install a VM hypervisor directly on the servers instead (ProxMox VE), with docker installed as a virtual machine. This allowed me the flexibility to run full virtual machines from time to time, while most of my services would be containers on Docker. ProxMox has compatibility to run LXC containers directly, but not Docker containers; I enabled Docker containers by running my Docker engine inside a full virtual machine under ProxMox.

Initially I had concerns about how performance would turn out, but for the workloads I run in my homelab this hasn’t been a real concern. For the type and quantity of services run in a home lab I don’t have any problem recommending this setup.