Install Docker on Amazon AWS EC2 - tooltwist/documentation GitHub Wiki

#Install Docker on Amazon AWS EC2

By default, Amazon EC2 instances do not include Docker. The default Amazon repositories should now include docker so it is no longer required to use a separate repository like EPEL to install it. However if the commands below do not work, please follow the steps at: Installing EPEL Repository on Amazon AWS EC2 to install EPEL before installing docker.

##Install Docker Invoke the command below to install docker:

$ sudo su
# yum install -y docker

##Add the user to the docker user group

The non-root user that will be used when running docker on the server must be added to the docker user group to make sure one would be able to run docker command without using sudo. In this example, the user is tooltwist.

# sudo usermod -aG docker tooltwist

##Start docker service To get docker running on the server, run the following command:

# service docker start

##Install docker-compose If you will only be using docker, this section can be skipped. However, if you will be needing the additional features included with docker-compose, we need to do a separate install since the docker installation in EPEL does not come with it.

The commands below will install docker-compose 1.6 which is the latest at the time of this writing:

# curl -L https://github.com/docker/compose/releases/download/1.6.0/docker-compose-`uname -s`-`uname -m` > docker-compose
# chown root docker-compose
# mv docker-compose /usr/local/bin
# chmod +x /usr/local/bin/docker-compose