Skip to content
Back to skills

Pm2

ASecurity

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 managing multiple processes.

  • 651 stars
  • 0 votes
  • 0 copies
  • 2 views
  • Added February 10, 2026
devopsjavascriptjavabashnextjsnode

Security analysis

A96/100
  • mediumInstalls packages at runtime which could introduce malicious dependencies

Pro shows the line behind each finding and how to fix it

Scanned February 12, 2026

npx -y skills add sundial-org/awesome-openclaw-skills --skill pm2 --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Pm2?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Pm2
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/sundial-org-pm2/badge)](https://www.skillsdirectory.com/skills/sundial-org-pm2)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: pm2
description: 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 managing multiple processes.
---

# PM2 Process Manager

Production process manager for Node.js with built-in load balancer.

## Install

```bash
npm install -g pm2
```

## Quick Start

```bash
# 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
```

## Common Commands

```bash
# 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
```

## Auto-Start on Boot

```bash
# 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
```

## Next.js / Production Builds

```bash
# Build first
npm run build

# Start production server
pm2 start npm --name "my-app" -- start

# Or with ecosystem file
pm2 start ecosystem.config.js
```

## Ecosystem File (ecosystem.config.js)

```javascript
module.exports = {
  apps: [{
    name: 'my-app',
    script: 'npm',
    args: 'start',
    cwd: '/path/to/app',
    env: {
      NODE_ENV: 'production',
      PORT: 3000
    }
  }]
}
```

## Useful Flags

| 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 |

## Cleanup

```bash
pm2 delete all        # Remove all processes
pm2 kill              # Kill PM2 daemon
pm2 unstartup         # Remove startup script
```

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.