Deloy Next or React App to VPS
Step by Step how to deploy next or react application to vps Login to your VPS ssh user@hostname Generate SSH public key and add it to your GitHub project cat ~/.ssh/id_rsa.pub Clone the project to your VPS clone git@github.com:username/project.git cd project Install all necessary packages npm install npm run build npm install pm2 --save-dev npx pm2 start npm --name my-project -- start -- --port=3001 npx pm2 restart my-project npx pm2 save Visit the application on the provided port https://hostname:3001 Congratulations Your Website is live! Note: There are some necessary adjustments you need to make based on the type of OS and application on the VPS. @abdulsalamamtech #vps #deploy #next #react

Step by Step how to deploy next or react application to vps
- Login to your VPS
ssh user@hostname
Generate SSH public key and add it to your GitHub project
cat ~/.ssh/id_rsa.pub
Clone the project to your VPS
clone git@github.com:username/project.git
cd projectInstall all necessary packages
npm install
npm run build
npm install pm2 --save-dev
npx pm2 start npm --name my-project -- start -- --port=3001
npx pm2 restart my-project
npx pm2 save
Visit the application on the provided port
https://hostname:3001
Congratulations Your Website is live!
Note: There are some necessary adjustments you need to make based on the type of OS and application on the VPS.
@abdulsalamamtech #vps #deploy #next #react