GenAI – How To Redeploy React JS Changes ?
Table Of Contents:
- Step By Step Process Of Redeploying React JS Changes.
Step 1: Build the React App on Local Machine
npm run build
This generates a fresh
/buildfolder with all updated static files.
Step 2: Connect to Your EC2 / VM
- Use VS Code Remote SSH, or terminal:
ssh ubuntu@<your-server-ip>
Step 3: Remove Existing Old Files on Server
sudo rm -rf /var/www/html/*
Step 4: Upload New build Folder to Server
sudo cp -r /home/Subrat/build/* /var/www/html/
Step 5: Confirm Upload
ls -l /var/www/html/
- Ensure you see files like
index.html,static/, etc.
Step 6: Restart NGINX
sudo systemctl restart nginx
Step 7: Access the React App in Browser
http://10.159.106.140

