pm2Manage 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 managing multiple processes.
Install via ClawdBot CLI:
clawdbot install asteinberger/pm2Production 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-app
# With 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 ls
# Logs
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 save
# Generate 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 build
# Start 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 |
|------|-------------|
| --name | Process name |
| --watch | Restart on file changes |
| -i max | Cluster mode (all CPUs) |
| --max-memory-restart 200M | Auto-restart on memory limit |
| --cron "0 " | Scheduled restart |
pm2 delete all # Remove all processes
pm2 kill # Kill PM2 daemon
pm2 unstartup # Remove startup script
Generated Mar 1, 2026
Deploy and manage Node.js-based SaaS applications in production environments with PM2. It ensures high availability through auto-restart, load balancing across CPU cores, and zero-downtime reloads for updates. This is ideal for web services requiring continuous uptime and scalability.
Orchestrate multiple Node.js microservices for an e-commerce platform using PM2. Manage processes like payment gateways, inventory systems, and user APIs with centralized logging and monitoring. PM2's cluster mode optimizes performance during peak shopping seasons.
Host backend API servers for mobile applications with PM2 to ensure reliability and performance. Use features like memory limit auto-restart and file watching for development, and set up auto-start on boot for server reboots. This supports real-time data synchronization and user interactions.
Run Node.js-based CMS platforms like Strapi or Ghost with PM2 for production stability. Monitor logs for errors, schedule restarts during low-traffic hours, and use ecosystem files for environment-specific configurations. This ensures seamless content delivery and admin operations.
Manage Node.js servers that process data from IoT devices using PM2. Handle high volumes of incoming data streams with load balancing, set up cron-based restarts for maintenance, and use real-time monitoring to track server health. This is crucial for industries like smart manufacturing or logistics.
Offer PM2-based managed hosting for Node.js applications, providing clients with deployment, monitoring, and maintenance. Charge subscription fees for uptime guarantees, performance optimization, and 24/7 support. This model targets small to medium businesses lacking in-house DevOps expertise.
Provide consulting services to help companies integrate PM2 into their production workflows, including setup, configuration, and best practices. Offer training workshops or online courses on PM2 usage, generating revenue from one-time project fees or course enrollments. This appeals to tech teams seeking to improve operational efficiency.
Develop and sell tools or plugins that enhance PM2 functionality, such as advanced monitoring dashboards, automated backup systems, or integration with CI/CD pipelines. Monetize through licensing fees or premium features, targeting developers and enterprises looking to extend PM2's capabilities.
💬 Integration Tip
Integrate PM2 with existing CI/CD pipelines by adding commands like 'pm2 start' in deployment scripts, and use ecosystem files for environment-specific settings to streamline production workflows.
Manage Trello boards, lists, and cards via the Trello REST API.
Sync and query CalDAV calendars (iCloud, Google, Fastmail, Nextcloud, etc.) using vdirsyncer + khal. Works on Linux.
Manage tasks and projects in Todoist. Use when user asks about tasks, to-dos, reminders, or productivity.
Master OpenClaw's timing systems. Use for scheduling reliable reminders, setting up periodic maintenance (janitor jobs), and understanding when to use Cron v...
Calendar management and scheduling. Create events, manage meetings, and sync across calendar providers.
Kanban-style task management dashboard for AI assistants. Manage tasks via CLI or dashboard UI. Use when user mentions tasks, kanban, task board, mission con...