This is an English translation of a Japanese blog. Some content may not be fully translated.
AWS

Installing Docker on EC2 (Amazon Linux)

Place this in user data when creating the EC2, or run it manually after launch.

#!/bin/bash
sudo yum update -y
sudo amazon-linux-extras install docker
sudo systemctl start docker
sudo systemctl enable docker
sudo usermod -a -G docker ec2-user

For verification:

docker -v
docker run hello-world
Suggest an edit on GitHub