Skip to content

Instantly share code, notes, and snippets.

@dharma017
Created August 20, 2024 08:38
Show Gist options
  • Save dharma017/6224c982681812bbfa9856722a5d7e93 to your computer and use it in GitHub Desktop.
Save dharma017/6224c982681812bbfa9856722a5d7e93 to your computer and use it in GitHub Desktop.
NodeJS process manager
# List all running application
pm2 list
# Save application to be opened at reboot (only if you are adding new projects or path modified)
pm2 save
# Restart all saved application automatically
(When server restarted and no Node running process or when server down)
pm2 resurrect
# check process number with pm2 list and restart
pm2 restart 0
# check logs
pm2 logs 0 --lines=10000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment