Prepare the Server

A few system packages are needed:

  • Curl: used to downloading the install
  • Nginx: used as a webserver proxy
  • Pm2: used as the requests runner
  • Node 18: the website is build in node
  • Dotnev: used to pass variables into the site
  • Lsof: (ubuntu, centos); needed to check open ports
  • Git: (ubuntu, centos); needed for installs
  • Grep: (apline); need to update default version
  • System build tools
Note
Many of the commands below require root access. If you are not a root user, run them with sudo.

Install Deps

apt-get update
apt-get -y install curl nginx lsof build-essential git
curl -fsSL https://deb.nodesource.com/setup_18.x | bash -
apt-get install -y nodejs
npm i -g pm2 dotenv-cli
pm2 install pm2-logrotate

# allow pm2 to start on reboot (need sudo if you are not running as root)
pm2 startup

You can check the node version by running node --version.