- Clone this project
git clone https://github.com/Mohamed-Ismail-Dev/AWS-Session.git
- Initialise and start the project
npm install
npm run dev
- Create an IAM user & login to your AWS Console
- Access Type - Password
- Permissions - Admin
- Create an EC2 instance
- Select an OS image - Ubuntu
- Create a new key pair & download
.pem
file - Instance type - t2.micro
- Connecting to the instance using ssh
ssh -i instance.pem ubuntu@<IP_ADDRESS>
- Updating the outdated packages and dependencies
sudo apt update
- Install Git - Guide by DigitalOcean
- Configure Node.js and
npm
- Guide by DigitalOcean
sudo apt install nodejs
sudo apt install npm
- Initialise and start the project
npm install
npm run dev -- --host 0.0.0.0
- Clone this project in the remote VM
git clone https://github.com/Mohamed-Ismail-Dev/AWS-Session.git
For this project, we'll have to set up an Elastic IP Address for our EC2 & that would be our DOMAIN
- Initialise and start the project
npm install
npm run start
NOTE - We will have to edit the inbound rules in the security group of our EC2, in order to allow traffic from our particular port
-
Configure Inbound Rules for EC2
- Open AWS Console → Go to EC2 → Click on Security Groups.
- Find the security group associated with your EC2 instance and click Edit Inbound Rules.
- Add a new Custom TCP Rule:
- Port:
5173
(if using Vite) or3000
(if using React’s default dev server). - Source:
0.0.0.0/0
(for testing, restrict for production).
- Port:
- Click Save Rules.
-
Allocate and Associate an Elastic IP Address
- Open AWS Console → Go to EC2 → Click on Elastic IPs.
- Click Allocate Elastic IP address and confirm the allocation.
- Once allocated, select the Elastic IP and click Associate Elastic IP address.
- Choose your EC2 instance and associate it.
- Use this Elastic IP instead of the dynamic public IP for a stable deployment.