Saving State via PM2 on a VPS Server
With PM2, you can save the current list of scripts so that they automatically restart after a server reboot.
To do this, you first need to initialize the saving:
pm2 startup
After this, whenever the list of scripts changes, you need to save the current state:
pm2 save
Start your test scripts in the usual way. Reboot the server. Make sure that the sites are not working.
Save the running scripts. Reboot the server. Make sure that the sites are now working.