How To Install PM2 On Ubuntu 20.04

PHOTO EMBED

Fri Dec 29 2023 10:31:10 GMT+0000 (Coordinated Universal Time)

Saved by @master4321

ssh username@server_ip_address
sudo apt update
sudo apt install nodejs
sudo apt install npm
node -v
npm -v
mkdir my-node-app
cd my-node-app
npm init -y
sudo npm install pm2 -g
pm2 start index.js

// other way
pm2 start {command} --name "APP NAME" -- {script}

//like
pm2 start npm --name "NODE APP" -- start
content_copyCOPY

Installing PM2 on Ubuntu allows for streamlined process management and monitoring for Node.js applications. In this comprehensive guide, we’ll walk through the steps from logging into an Ubuntu server via SSH or other credentials, creating a Node.js app, installing PM2, starting an app with PM2, utilizing PM2 log, monitoring features and more.

https://codenestors.com/blog/how-to-install-pm2-on-ubuntu-server