Deploying React Static Site on EC2 using Nginx + HTTPS (Certbot)

1) Build React frontend locally

npm install
npm run build

This generates the production build in dist/ (Vite) or build/ (CRA).


2) Verify the build locally

Open the generated folder using VS Code Live Server (or any static server) and ensure the site works properly.


3) Buy a domain

Example:


4) Create an EC2 Ubuntu instance


5) Allocate and attach Elastic IP

This ensures your server IP remains fixed.