Start Node JS application when server reboots with pm2

后端 未结 2 1132
滥情空心
滥情空心 2021-01-21 01:47

I am trying to use the module pm2 to start my node js app everytime the server boots. I have used the command pm2 startup ubuntu but each time I restar

2条回答
  •  感情败类
    2021-01-21 02:29

    Make sure you do save your processes:

    pm2 start app.js 
    pm2 startup ubuntu 
    pm2 save
    

    Once you have started the apps and want to keep them on server reboot do: pm2 save

    Source: https://github.com/Unitech/PM2/blob/master/ADVANCED_README.md#startup-script

提交回复
热议问题