How to install Docker CE on Rocky Linux 8

Hello, friends. In this post, you will learn how to install Docker CE on Rocky Linux 8. The process is simple, and we will be able to install the latest stable version of the tool.

Docker is a technology that allows us to deploy applications and operating systems in containers that are distributed in images.

Many blogs have commented on Docker, including ours. That is why this technology is so popular and so widely used worldwide.

As we know, CentOS 8 came to an end on December 31 of last year, so we have to migrate to alternatives such as Rocky Linux or Alma Linux.

So let’s go for it.

Installing Docker CE on Rocky Linux 8

Docker has a dedicated CentOS repository that we can apply to Rocky Linux. So, the ideal would be to add it to the system and install it from there.

First access your server via SSH or, if you are using Rocky Linux from the desktop, open a terminal.

Now install the yum-utils package.

sudo dnf install yum-utils

With this package installed, we can add the Docker repository.

sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

Output:

Adding repo from: https://download.docker.com/linux/centos/docker-ce.repo

If you want to check if the repository has been successfully added, you can run

sudo dnf repolist
1.- Rocky Linux repos
1.- Rocky Linux repos

Thereafter, you can install Docker CE and its packages on the system.

sudo dnf install docker-ce docker-ce-cli containerd.io
2.- Installing Docker on Rocky Linux 8
2.- Installing Docker on Rocky Linux 8

With this process, Docker is already installed, but its service is not started.

To start the Docker service, run

sudo systemctl start docker

It is convenient that the service starts with the system, to do this

sudo systemctl enable docker

Output:

Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /usr/lib/systemd/system/system/docker.service

Finally, you can check the status of the service

sudo systemctl status docker
3.- Docker status
3.- Docker status

In conclusion, Docker is installed correctly.

First steps with Docker CE on Rocky Linux

Using Docker requires root permissions. This can be a problem for many people, so a real option would be to add the user to the docker group.

To complete this, run the following command

sudo usermod -aG docker $USER

Now, you can run Docker and for this you can use the test image.

docker run hello-world
4.- Docker running properly
4.- Docker running properly

In case you get permissions error, just restart the terminal or the SSH session.

So, you will get an output screen similar to this one.

Indicating that Docker has been successfully installed on the system.

Conclusion

In this post, you have learned how to install Docker CE on Rocky Linux 8, I hope it has helped you. Don’t forget to share the post.

Angelo
I am Angelo. A systems engineer passionate about Linux and all open-source software. Although here I'm just another member of the family.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest articles

You might also likeRELATED

How to install ExpressJS on Debian 11?

In this post, you will learn how to install ExpressJS on Debian 11. Hello, developer friends and all. If you are just starting in front...

Keep on eye on your bugs by installing bugzilla on Debian 11

Hello, friends. In this post, we continue with the bug tracking that is so important in many work teams. So today we will show...

How to install Mantis bug tracker on Debian 11?

Hello friends. In this post, you will learn how to install Mantis Bug Tracker on Debian 11. Install LAMP on Debian 11 Mantis is a web...