Closed 7daytheory closed 2 weeks ago
Used Putty to sign in to server, installed node
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
Load NVM
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # loads nvm bash_completion
Install NVM and Node :
nvm install node # installs latest Node.js version
nvm use node # use installed node
Install PM2 - You can just use node but PM2 has some good features like auto-restart if server goes down :
npm install pm2@latest -g # Installs PM2 globally
Start Application :
pm2 start index.js --name "app name" # I used index.js but it might be server.js or app.js - and insert your app name from package
Test Endpoint :
curl http://localhost:3000/resume
If it comes back with the correct message everything is working - I had an error so I removed everything except a basic messsage. Everything works now so will slowly be adding everything back
Set up auto-start and save current list of processes
pm2 startup
```bash
pm2 save
NEXT : Check Server Configuration - I can connect to the server via SSH but not via URL
Update Nginx configuration
No point paying for a VSH server when you're barely using it
Installed VPM server, connected via SSH