DEV Community

muckitymuck
muckitymuck

Posted on

PM2, node, NextJS, Express

A quick collection of building and monitoring commands in Linux.

To get ExpressJS started under pm2:

/home/ec2-user/expressjs/bin

pm2 start --name expressjs www
Enter fullscreen mode Exit fullscreen mode

PM2
List the processes:

pm2 list
Enter fullscreen mode Exit fullscreen mode

NPM build, start process

npm ci
npm test --if-present
npm run build
npm run start
pm2 start npm -- start
pm2 start --name AppName npm -- start
Enter fullscreen mode Exit fullscreen mode

Restart the processes:

pm2 restart all
pm2 restart <app name>
Enter fullscreen mode Exit fullscreen mode

Top comments (0)