- Update and upgrade
sudo yum update
sudo yum upgrade
- Install docker with docker-compose plugin
sudo yum install docker -y
sudo service docker start
- Create non-sudo user: worker
sudo useradd -m worker
sudo passwd worker
(workerworker as password, password authentication is disabled by default)sudo usermod -aG docker worker
sudo usermod -aG docker ec2-user
su worker
cd /home/worker
mkdir app
- Create ssh keys
ssh-keygen -b 4096
mv /home/worker/.ssh/id_rsa.pub /home/worker/.ssh/authorized_keys
Copy private key to github action for deployment