U
U
urajo2020-01-30 12:07:28
Node.js
urajo, 2020-01-30 12:07:28

How to make it auto start on server restart?

Now I'm running a project using pm2, the question arose of what to do if, for example, the server itself reboots? Well, for example, power surges.
Now I googled what pm2 startup is, but I don’t quite understand whether it works for these purposes and how it works?
It turns out that I need to first write pm2 save to save the processes, then pm2 startup and I will receive a command to start? Or pm2 save can be left out? And if he gives a command to start, then it means that when the server is rebooted, it still needs to be entered manually, if so, how then to be?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
grinat, 2020-01-30
@grinat

Yes, it is for these purposes, you just need to execute the command once, which will appear when you enter pm2 startup. After that, when you rebuy pm2, everything will restart itself

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question