AWS – How To Redeploy React JS Changes ?


GenAI – How To Redeploy React JS Changes ?

Table Of Contents:

  1. 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 /build folder 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

Leave a Reply

Your email address will not be published. Required fields are marked *