PM2 Process Manager
Manage Node.js applications with PM2 process manager. Use for deploying, monitoring, and auto-restarting Node apps in production. Covers starting apps, viewing logs, setting up auto-start on boot, and
Manage Node.js applications with PM2 process manager. Use for deploying, monitoring, and auto-restarting Node apps in production. Covers starting apps, viewing logs, setting up auto-start on boot, and
Real data. Real impact.
Emerging
Developers
Per week
Open source
Skills give you superpowers. Install in 30 seconds.
Production process manager for Node.js with built-in load balancer.
npm install -g pm2
# Start an app pm2 start app.js pm2 start npm --name "my-app" -- start pm2 start "npm run start" --name my-appWith specific port/env
pm2 start npm --name "my-app" -- start -- --port 3000 PORT=3000 pm2 start npm --name "my-app" -- start
# List processes pm2 list pm2 lsLogs
pm2 logs # All logs pm2 logs my-app # Specific app pm2 logs --lines 100 # Last 100 lines
Control
pm2 restart my-app pm2 stop my-app pm2 delete my-app pm2 reload my-app # Zero-downtime reload
Info
pm2 show my-app pm2 monit # Real-time monitor
# Save current process list pm2 saveGenerate startup script (run the output command with sudo)
pm2 startup
Example output - run this:
sudo env PATH=$PATH:/opt/homebrew/bin pm2 startup launchd -u username --hp /Users/username
# Build first npm run buildStart production server
pm2 start npm --name "my-app" -- start
Or with ecosystem file
pm2 start ecosystem.config.js
module.exports = { apps: [{ name: 'my-app', script: 'npm', args: 'start', cwd: '/path/to/app', env: { NODE_ENV: 'production', PORT: 3000 } }] }
| Flag | Description |
|---|---|
| Process name |
| Restart on file changes |
| Cluster mode (all CPUs) |
| Auto-restart on memory limit |
| Scheduled restart |
pm2 delete all # Remove all processes pm2 kill # Kill PM2 daemon pm2 unstartup # Remove startup script
No automatic installation available. Please visit the source repository for installation instructions.
View Installation Instructions1,500+ AI skills, agents & workflows. Install in 30 seconds. Part of the Torly.ai family.
© 2026 Torly.ai. All rights reserved.