Guides
Working with Docker

Install Docker on CentOS

7min

Installing Docker on CentOS is fairly straightforward and only takes a few commands. So let's go through it step by step.

1. Remove Docker

Before we start, we need to remove any Docker dependencies. If you've never installed Docker, don't worry. You can skip this step.

Linux


2. Set up the repository

We need to install the yum-utils package. yum-utils gives us the yum-config-manager that we need to set up the repository.

Linux


3. Install Docker

With yum-utils installed, we can go ahead and install Docker.

Linux


4. Test its working

Now everything is installed, we should test if it's working. So start Docker.

Linux


Now, start a container to check that Docker is installed correctly.

Linux


5. Add non-root users

You'll notice that if you want to start Docker as a non-root user, you'll probably run into this error.

Linux


Don't worry. There's an easy fix for that. First, let's create the Docker group.

Linux


Then add the non-root user to the group.

Linux


With all that done, you've got Docker set up and ready to use.