CyberKeeda In Social Media

How to install and configure Docker-CE on CentOS


  • Begin with updating your system packages and docker dependencies.
$  sudo yum update
$  sudo yum install yum-utils device-mapper-persistent-data lvm2
  • Add docker stable repository for centos within your system
$  sudo yum-config-manager --add-repo
  • Once docker repository is enabled, proceed ahead to install Docker-CE ( Community Edition.
$  sudo yum install docker-ce
  • Now docker-ce has been installed, lets start the docker daemon and enable it on boot.
$  sudo systemctl start docker
$  sudo systemctl enable docker
  • To verify the status of  docker, run the below command.
$  sudo systemctl status docker

  • In case, if you want to check your installed docker version.
$  sudo docker -v

Run Docker commands without sudo

By default managing Docker requires administrator privileges. If you want to run Docker commands as a non-root user without adding sudo within yoir command you need to add your user to the docker group which is created during the installation of the Docker CE package. Add your user to docker group by below command.

$  sudo usermod -aG docker $USER

Logout- Login to reflect the changes.

No comments:

Post a Comment

Designed By Jackuna