Install docker on Amazon Linux Instance

0
1418
views
Install docker on ec2

How to Install Docker on Amazon Linux Server

In this tutorial, we would see steps on how to install docker on Amazon Linux 2 Instance

I am assuming that you already have an Amazon Linux Instance launched, if not then please go and do it and then proceed with below steps

Ec2 logo

After creating an EC2 instance

Connect to your Instance and start performing the below steps

1. Install Updates

$ sudo yum update -y

2. Install docker using yum

$ sudo yum install docker -y

3. Add ec2-user to the docker group

$ sudo usermod -aG docker ec2-user

4. Command to check if docker is running

$ sudo service docker status

5. If docker is inactive (dead) then start using this command

$ sudo service docker start

6. Run below command to make sure that the docker service is up and running automatically after a reboot

$ sudo chkconfig docker on

7. Run the below command to get more details on docker

$ sudo docker info

Well done!

We now have docker running on our instance. Now we are all set to deploy the docker containers

Some extra commands that you need to be aware of

8. Run the below command to stop docker

$ sudo service docker stop

9. Run the below command to check the docker version

$ docker -v

10. Run the below command to remove docker

$ sudo yum remove docker

I hope this article helped you

Facing any issue while installing docker?

Let’s connect on Linkedin