Docker is available in two versions,
- Docker CE (Community Edition)
- Enterprise Edition (EE)
In this guide we will learn how to install Docker CE (Community Edition) on CentOS 8 or RHEL 8 Server.
System Requirements for Docker CE
- Minimal CentOS 8 / RHEL 8
- Sudo or root privileges
- Internet Connection
Step 1: Enable Docker CE Repository
As we said above, docker packages are not available anymore on CentOS 8 or RHEL 8 package repositories, so run following dnf command to enable Docker CE package repository.
Step 2: Install Docker CE using dnf command
Once the docker ce repo has been configured successfully then run following command to verify which version of docker is available for installation
Now, use beneath dnf command to install latest version of docker,
After the installation of docker, start and enable its service using the following systemctl commands
Run the following command to verify installed docker version
Step 3: Verify and test Docker CE Engine
To verify whether docker ce engine has been setup correctly or not, try to spin up a “hello-world” container using below docker command
Output of above command
As we can see the informational message in above output which confirms docker engine is setup correctly on CentOS 8 / RHEL 8 Server. Let’s move to docker compose installation.
Step 4: Install Docker Compose
As we know that docker compose is used to link multiple containers using a single command. In other words, Docker Compose is useful where we need to launch multiple containers and these containers depends on each other. Examples like launching LAMP/ LEMP applications (WordPress & Joomla etc) insider containers.
Run the following commands to install docker compose on CentOS 8 / RHEL 8,
Note: Replace “1.25.0” with docker compose version that you want to install but at this point of time this is the latest and stable version of docker compose.
Set the executable permission to docker-compose binary
Verify the docker compose version by running the following command.
That’s all from this tutorial, I hope these steps help you to setup docker and docker compose on CentOS 8 and RHEL 8 server.