How to install Docker on AWS EC2 instance with AMI (CE/EE Update)

To get Docker running on the AWS AMI you should follow the steps below (these are all assuming you have ssh’d on to the EC2 instance).

  1. Update the packages on your instance

    [ec2-user ~]$ sudo yum update -y

  2. Install Docker

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

  3. Start the Docker Service

    [ec2-user ~]$ sudo service docker start

  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

You should then be able to run all of the docker commands without requiring sudo. After running the 4th command I did need to logout and log back in for the change to take effect.

Leave a Comment