Starting Applications Automatically After Reboot Using PM2
To create a startup script for PM2, we will use the pm2 startup command, which identifies the init system as systemd and generates a setup command:
$ pm2 startup [PM2] Init System found: systemd [PM2] To setup the Startup Script, copy/paste the following command: sudo env PATH=$PATH:/usr/bin /usr/local/lib/node_modules/pm2/bin/pm2 startup systemd -u labenv --hp/home/labenv