How to deploy react app in lightsail (VPS) with nginx

Requirement :

  • 1 GB ram
  • ubuntu
  • nginx server
  • AWS or any VPS
  • node 13X version

Step one:

Login in aws lightsail or vps through ssh access

Step two:

install node js in ubuntu

Step three:

install nginx in your machine(vps)

Step four:

Clone your repository in here

I put a (.)dot that all file stay html folder

Give those permission your project folder that nginx can have access permission

Step five:

setup nginx server to server your react app build file

follow this bellow to write config file

config file will be like this

Step six:

Enable the file by linking to the sites-enabled dir

Testing nginx configuration

Restart nginx server

Open your ip in a browser and happy deploying

 

Shariful Islam Nayon

Shariful Islam | Full Stack Python/Django Developer I am Linux lover self motivated software craftsman open source contributor.My interested area Data Structure,Algorithm,Big data,Machine learning Dhaka, Bangladesh http://nayon.net/

Leave a Reply


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