# The simpler way to install Docker CE on Amazon Linux 2

To start our series of posts, with the main objective of knowledge sharing, I'll explain the simpler way to install Docker CE and Docker Compose within an EC2 instance.

Since the second version of Amazon Linux AMI, AWS has changed the way of installing some OS packages, for that, we won't use the default package manager yum. For more details, take a look at the [release notes](https://aws.amazon.com/amazon-linux-2/release-notes/).

### Installing Docker CE

```sh
sudo amazon-linux-extras install docker
sudo service docker start
sudo usermod -a -G docker ec2-user
``` 

Enabling Docker service to automatic start at boot.

```sh
sudo chkconfig docker on
```

Installing some extra packages, git and netcat (nc).

```sh
sudo yum install -y git nc
``` 

### Installing Docker Compose

Download the latest version, directly from GitHub.

```sh
sudo curl -L https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m) -o /usr/local/bin/docker-compose
``` 

Change the file permissions, to make it executable.

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

Check the Docker Compose version.


```sh
docker-compose version
``` 








