I want to make my PM2 as a startup service, because for example when my server loses power or something happens to it, it does not automatically restart the PM2 service.

1 Answer 1


When configuring PM2 is finished and it's working properly, you must run two commands to make your PM2 as a autostart service and enjoy that. 1) Run 'pm2 save': It's save all of your PM2 configure to a file.

admin@server:~$ sudo pm2 save

2) Run 'pm2 startup': This command creates a system service and runs your last change saved with the first step.

admin@server:~$ sudo pm2 startup

So, Run the first command when you changed the configuration to store the last changes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.