node-pm2-windows-startup icon indicating copy to clipboard operation
node-pm2-windows-startup copied to clipboard

PM2 doesn't start after server reboot

Open abc245 opened this issue 8 years ago • 5 comments

Hi,

I have a weird problem, if I restart the remote server and do not log in after wards to it the pm2 doesn't start automatically, however if after restart I log in to the server the pm2 starts as expected.

What can be the issue? I'm using Windows Server 2012 R2.

abc245 avatar Nov 30 '17 11:11 abc245

+1

jianbingfang avatar Mar 14 '18 09:03 jianbingfang

Yes same here. I am using it on a Win10 SBC. PM2 only seem to start when I log in with a user.

nygma2004 avatar Sep 12 '18 21:09 nygma2004

Everyone who is looking this issue, I have found this article: https://blog.cloudboost.io/nodejs-pm2-startup-on-windows-db0906328d75 I have implemented Solution 2 (installing pm2-windows-service), and it works. Now I have a system service and Node Red is being started on Windows startup.

nygma2004 avatar Sep 13 '18 06:09 nygma2004

I used an easier solution - created a windows scheduled task which runs "pm2 resurrect" on start up as SYSTEM user. Works without anyone having to log in.

dluk avatar Dec 12 '18 13:12 dluk

I used an easier solution - created a windows scheduled task which runs "pm2 resurrect" on start up as SYSTEM user. Works without anyone having to log in.

did you create a .bat file that only contains "pm2 resurrect" in it and set it to run on startup from Win Task Scheduler? Is that what you mean?

uzbeki avatar Mar 25 '21 04:03 uzbeki