To install PM2 on CentOS Stream 9, follow the steps below.
Step 1 : Install PM2 using npm
Step 2 : Run pm2 startup
Step 3 : Create a basic Node.js application, for example, a file named app.js with the following content:
Step 4 : Start the app with PM2
Step 5 : Manage the app with PM2 (restart, reload, stop, delete)
- Restart the app:
- Reload the app:
- Stop the app:
- Delete the app from PM2:
Congratulations! You have successfully installed PM2 on CentOS Stream 9.