Install Docker on CentOS
Installing Docker on CentOS is fairly straightforward and only takes a few commands. So let's go through it step by step.
Before we start, we need to remove any Docker dependencies. If you've never installed Docker, don't worry. You can skip this step.
We need to install the yum-utils package. yum-utils gives us the yum-config-manager that we need to set up the repository.
With yum-utils installed, we can go ahead and install Docker.
Now everything is installed, we should test if it's working. So start Docker.
Now, start a container to check that Docker is installed correctly.
You'll notice that if you want to start Docker as a non-root user, you'll probably run into this error.
Don't worry. There's an easy fix for that. First, let's create the Docker group.
Then add the non-root user to the group.
With all that done, you've got Docker set up and ready to use.