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.
Confirm in the security settings of your EC2 instance, if you have the port 22 open.
Run an update:
sudo yum update -y
- Installing Docker:
# installing sudo amazon-linux-extras install docker
- tarting the service
sudo service docker start
- Add ec2-user to docker group so you won’t need to type “sudo” all the time
sudo usermod -a -G docker ec2-user
- Start docker service even after restarting the server
sudo systemctl enable docker
- Last step is just reboot the server.
sudo restart -n