PM2 as a Windows Service
PM2 for Node currently doesn't have good windows support. I've started with https://github.com/marklagendijk/node-pm2-windows-startup and added the excellent https://github.com/stephenwvickers/node-os-service library to it to make a PM2 Windows service.
To install, download from Github, then run:
npm install
This will need a native Windows C build enviroment setup to compile the os-service module.
Then run the following to install the service:
node index.js --add
This will create a Windows called Node.JS Process Manager (PM2) Service - go to your Services list in Control Panel -> Administrative Tools -> Services.
You will need to adjust the user that the service runs under, otherwise it won't be able to find PM2 which is in your user's roaming profile folders. Go to the service properties, and then the "Log On" tab. Set the user to your account, and restart the service.
You should find that PM2 comes back up with a reboot and can still be controlled from the command line as before.
To save the current list of processes that PM2 executes:
> pm2 save