<< All Posts
How to install Docker on Amazon Linux 2


On Amazon AWS, they have their own distribution called Amazon Linux. This linux comes with a special support provided by AWS engineers and some cool features and a nice integration with the AWS environment itself.

Fist step to get Docker installed on there is update your distro. But first, a quick tip after you create your EC2 instance.

  1. Confirm in the security settings of your EC2 instance, if you have the port 22 open.

  2. Connect using: ssh ec2-user@THE-PUBLIC-ADDRESS-OR-IP

  3. Run an update:

sudo yum update -y
  1. Installing Docker:
# installing
sudo amazon-linux-extras install docker
  1. tarting the service
sudo service docker start
  1. Add ec2-user to docker group so you won’t need to type “sudo” all the time
sudo usermod -a -G docker ec2-user
  1. Start docker service even after restarting the server
sudo systemctl enable docker
  1. Last step is just reboot the server.
sudo restart -n



<< All Posts