Prerequisites
-
AWS EC2 Instance
- Ubuntu 22.04 LTS recommended
-
MobaXterm
- For connecting to the EC2 instance and uploading project files
-
Runner Configuration Variables (.env file)
- GITHUB_PAT: your personal access token
- REPO: GitHub repository in username/repo format
- RUNNER_NAME: a unique name for your self-hosted runner
-
Project Folder with the following files:
1. Launch EC2 Instance
- AWS Console → EC2 → Launched Instance
- Choosed:
- AMI: Ubuntu 22.04 LTS
- Instance type: t2.micro
- Key pair: Create or use an existing one
- Security Group: Open port 22 for SSH
2. Connect to EC2
In MobaXterm
3. Install Docker and Docker Compose
sudo apt-get update
sudo apt-get install -y docker.io docker-compose
sudo systemctl start docker
sudo systemctl enable docker