Install Docker on AWS


First thing first. Launch an instance with the Amazon Linux AMI and Connect to your instance.

Install Docker

Update the installed packages and package cache on your instance.

sudo yum update -y

Install Docker and Start the service.

sudo yum install -y docker
sudo service docker start

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

sudo usermod -a -G docker ec2-user

Install Docker Compose

sudo curl -L "$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose

Apply executable permissions to the binary

sudo chmod +x /usr/local/bin/docker-compose

Log out and log back in again to pick up the new docker group permissions.

docker-compose --version
docker --version