Phenom Dev Stack Provisioning

Instructions for provisioning an EC2 instance from scratch for the DEV Phenom backend, including Git and Docker setup.

Phenom Dev Stack Provisioning

This document provides instructions for provisioning an EC2 instance from scratch for the DEV Phenom backend.

1. Connect to your EC2 instance

First, connect via AWS to your EC2 instance (vanilla).

2. Install Git

Once connected, run these commands to install Git:

sudo yum groupinstall "Development Tools" -y
sudo yum install curl-devel expat-devel gettext-devel openssl-devel perl-devel zlib-devel -y
sudo yum remove git -y
cd /usr/src
sudo curl -O https://mirrors.edge.kernel.org/pub/software/scm/git/git-2.43.0.tar.gz
sudo tar -zxf git-2.43.0.tar.gz
cd git-2.43.0
sudo make prefix=/usr/local all
sudo make prefix=/usr/local install

Verify the Git installation:

git --version
git config --list

3. Update PATH and Source for Immediate Usage

Update the PATH to where Git was installed and source it for immediate usage:

echo 'export PATH=/usr/local/bin:$PATH' >> ~/.bash_profile
source ~/.bash_profile

4. Add Identifying Information

Add identifying information for this instance (REPLACE BELOW, DO NOT COPY PASTE):

git config --global user.name "YOUR_GITHUB_USERNAME - EC2 id: i-xxxxxxxxxxxxxxxxx" # Replace with your GitHub username and EC2 instance ID
git config --global user.email "YOUR_GITHUB_EMAIL" # Replace with your GitHub email

This will preserve your one-time credentials for convenience on subsequent Git pulls:

git config --global credential.helper store

5. Clone the Repository

Generate your personal token in GitHub, ensuring it’s a classic token and the top repo box of permissions is checked. Enter your GitHub username and generated token (see above) as the password.

Clone the repository to ~/:

git clone https://github.com/Phenom-earth/phenom-backend

6. Update and Install Docker

sudo yum update -y
sudo amazon-linux-extras enable docker
sudo yum install -y docker

7. Start Docker and Enable at Boot

sudo systemctl start docker
sudo systemctl enable docker

8. Add Current User to Docker Group

sudo usermod -aG docker $USER

9. Apply Group Change Immediately

Apply group change immediately (no logout needed):

newgrp docker <<EONG

10. Create CLI Plugins Folder

mkdir -p ~/.docker/cli-plugins

11. Download Docker Compose v2

curl -SL https://github.com/docker/compose/releases/download/v2.27.0/docker-compose-linux-x86_64 \
  -o ~/.docker/cli-plugins/docker-compose

12. Make Docker Compose Executable

chmod +x ~/.docker/cli-plugins/docker-compose

13. Test Docker and Docker Compose

docker version
docker compose version
EONG

Last modified July 19, 2025: Update _index.md (79adc70)