Home >Operation and Maintenance >CentOS >How to install docker on centos
To install Docker on a CentOS system, you need to perform the following steps in order: Enable the EPEL repository. Add Docker Yum repository. Install Docker CE. Start the Docker service. Add your user to the Docker group.
How to install Docker in CentOS system
Docker is an open source container platform that can be used for easy deployment and management Applications across different platforms. This tutorial will guide you to install Docker on CentOS system.
Step 1: Enable the Extra Packages for Enterprise Linux (EPEL) repository
<code>sudo yum install epel-release</code>
Step 2: Add the Docker Yum repository
<code>sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo</code>
Step 3: Install Docker CE
<code>sudo yum install docker-ce</code>
Step 4: Start the Docker service
<code>sudo systemctl start docker</code>
Step 5: Add your Add your user to the Docker group
To run Docker commands without sudo permissions, add your user to the docker group:
<code>sudo usermod -aG docker $USER</code>
Verify Docker Installation
To verify that Docker has been installed successfully, run the following command:
<code>sudo docker run hello-world</code>
This will pull and run a simple "Hello World" container. If the command runs successfully, you should see a "Hello from Docker!" message.
What to do next
Now that you have successfully installed Docker in CentOS, you can start using it to build, deploy, and manage your application containers. For more information about how to use containers with Docker, see the Docker documentation.
The above is the detailed content of How to install docker on centos. For more information, please follow other related articles on the PHP Chinese website!