To install PM2 on Ubuntu 23.10, follow these steps:
Step 1 : To install PM2 on Ubuntu 23.10, use npm:
Step 2 : Run the following command to set up PM2 to start on boot:
Step 3 : Build a simple Node.js app. You can create a file named app.js
with the following content:
Step 4 : Start the app using PM2:
Step 5 : Manage the app with PM2 using the following commands:
- Restart: pm2 restart my-app
- Reload: pm2 reload my-app
- Stop: pm2 stop my-app
- Delete: pm2 delete my-app
Congratulations! You have successfully installed PM2 on Ubuntu 23.10, built and started a Node.js app.