Matomo Analytics

By default, the PM2 service will not start the services that you are running on boot. This requires an additional step, luckily this step is very easy.

First, run every service you want with PM2 so you're sure all the services you want to be started up on reboot, are started.

Next, run the following command:

pm2 startup

This will give the output like following:

[PM2] Init System found: systemd
[PM2] To setup the Startup Script, copy/paste the following command:
sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u ploi --hp /home/ploi

Next, run that sudo command in your terminal (this will ask for your sudo password):

sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u ploi --hp /home/ploi

After this, PM2's services that have been spawned will be started again upon reboot.

01 February 2022 (last updated 3 months ago)

531 views

Back to Server