As I explained in my previous post, pm2 default startup feature that very easy to configure with Linux and Mac OS environments. You just need to execute the 2 short commands in the terminal.
First, please install and start the pm2 and your node.js application in your system using npm if you haven’t done yet.
npm install pm2@latest -g i
pm2 start server.js -o ./logs/trace.log
Then you need to generate the startup script to type this command:
Now, need to save your current process list to automatically start when system reboot and that is important.
That’s it. I hope this will help. 🙂