Note this is just one time step please dont repeat more than once for the same EC2 instance.
ssh -i <your key> ubuntu@<public ip>
mkdir app
cd app
git clone <your repo url>
cd <your directory name>
Please run the below commands one by one.
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
sudo apt-get install docker-ce
Now verify docker installation
docker --version
Now enable to docker to run when systen starts up
sudo systemctl start docker
sudo systemctl status docker
Please run the below commands one by one.
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
Now verify docker installation
docker–compose --version
docker-compose up -d --build