O'Reilly logo

Continuous Integration, Delivery, and Deployment by Sander Rossel

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

PM2

The last thing we need to do is make sure that PM2, and our webshop, starts automatically when your VM starts. PM2 has a built-in command for just that, startup. Running this command will generate a command that you have to run. Just copy it and run it:

pm2 startup systemd[PM2] You have to run this command as root. Execute the following command:sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u [username] --hp /home/[username]sudo env PATH=$PATH:/usr/bin /usr/lib/node_modules/pm2/bin/pm2 startup systemd -u [username] --hp /home/[username]

systemd is for Ubuntu 16 and higher and CentOS, Arch, and Debian. There are other supported systems, such as Darwin, MacOSx, Gentoo, and FreeBSD. It is pretty well documented ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required