- Install dependencies
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -;
sudo apt-get install -y nodejs;
npm install pm2 -g;
pm2 install pm2-logrotate;
git clone https://github.com/apeboard/monitor.git;
npm install -C ./monitor;
- Add
pm2.json
nano pm2.json;
{
"apps": [
{
"name": "monitor",
"cwd": "./monitor",
"script": "npm start"
}
]
}
- Start
pm2
service
pm2 start pm2.json;