The Be Sure Blog

Code Snippets | Problem Solving | Tips & Tricks

The Be Sure Blog banner

Useful PM2 commands for Linux

posted on 18.11.2023 by Below Surface in "PM2"

PM2 is a good working process manager for the Node.js runtime. Here are some helpful commands:

pm2 start app_name // start a process for a Node.js application, like "server.js"
pm2 restart app_name // restart the process
pm2 reload app_name // reload the process
pm2 stop app_name // stop the process
pm2 delete app_name // delete the process
pm2 stop all // stop all processes
pm2 delete all // delete all processes
pm2 startup // generate a startup script configuration, just copy the generated sudo command and run it
pm2 save // save the app list, to be restored after a system restart
pm2 logs // show live logs of PM2

Tags:

pm2
node process manager
useful commands

More posts of this category

Disabling the auto restart of PM2 processes

Sometimes the server would run out of ressources, this is how i fixed it

PM2

Troubleshoot why a PM2 process errors

Some helpful commands and logs to look at to identify the issue

PM2