Start with Docker on AWS Linux

Prerequisite for this:

  1. Launch an EC2 Linux Instance on AWS. For more details click here
  2. Connect to an instance using Putty.

Install Docker on the EC2 Instance

  1. Update the installed packages and package cache on your instance by running the below command:

sudo yum update -y ( On linux instance apt-get doesn’t work , so you have to use the yum tool)

2. [ec2-user ~]$ sudo yum install -y docker

3. [ec2-user ~]$ sudo service docker start
Starting cgconfig service: [ OK ]
Starting docker: [ OK ]

4. Add the ec2-user to the docker group so you can execute Docker commands without using sudo

[ec2-user ~]$ sudo usermod -a -G docker ec2-user

5. docker info

Note

In some cases, you may need to reboot your instance to provide permissions for the ec2-userto access the Docker daemon. Try rebooting your instance if you see the following error:

Cannot connect to the Docker daemon. Is the docker daemon running on this host?

Docker is installed successfully. Isn’t it very easy to install docker ?

Written by

Devops Automation Enginneer

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store