<aside> 🏹
As part of setting up our CI/CD infrastructure, we provisioned a self-hosted GitHub Actions runner inside a Docker container on an EC2 instance. Below is a detailed walkthrough of what we did:
</aside>
We logged into the AWS Management Console and navigated to EC2 → Launch Instance.
Configuration details:
.pem key file for secure SSH access. We named it tcs-runner-key.pem.
In the infrastruture repo, we configured the the runner files to match our variables
Dockerfile
docker-compose.yaml
entrypoint.sh
.env
In the .env file, we updated the following
The-Cloud-Squad/tcs_infra which had already been created on githubdocker-runnerIn the docker-compose.yaml we commented out the user: root, since we ere not using the roort user credentials to connect

The other files were left as is.
SSH → Remote Host:
Specify username as ubuntu and use the .pem file as identity.
We also used the built-in SFTP browser type in MobaXterm to upload files directly to the server.

sudo apt update && apt install docker.io docker-compose -y
sudo apt install tree
#added the Ubuntu user to the Docker group to allow non-root Docker access:
sudo usermod -aG docker ubuntu
exit # logout and re-login for group change to apply
sudo su - ubuntu
sudo usermod -aG docker ubuntu
exit # logout and re-login for group change to apply
sudo su - ubuntu
