Now we’ll install PM2, which is a process manager for Node.js applications. PM2 provides an easy way to manage and daemonize applications (run them in the background as a service).
We will use
npm, a package manager for Node modules that installs with Node.js, to install PM2 on our server. Use this command to install PM2:
sudo npm install -g pm2
-g option tells
npm to install the module globally, so that it's available system-wide.