PM2 Process Manager

v1.0.0

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.

3· 3k·4 current·6 all-time
byAndy Steinberger@asteinberger
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
Name/description (manage Node.js apps with PM2) match the SKILL.md contents: npm install -g pm2 and common pm2 commands for starting, monitoring, and auto-start on boot.
Instruction Scope
Instructions are limited to installing and using pm2 and creating an ecosystem file. They show use of environment variables (PORT) and advise running the pm2 startup command (which may require sudo). That startup step will modify system startup scripts — expected for PM2 but a privileged action the user should approve.
Install Mechanism
No install spec in the skill bundle (instruction-only). The doc recommends npm install -g pm2 (a global npm install), which is a normal approach but will modify system/global packages and requires network access; this is expected for installing PM2.
Credentials
The skill does not request environment variables, secrets, or config paths. Example usage shows typical NODE_ENV/PORT settings but no unexplained credential or cross-service access.
Persistence & Privilege
The documented commands (pm2 save, pm2 startup) create persistent background services and startup scripts. Those are legitimate for a process manager but are persistent, system-level changes that require user/admin consent (sudo).
Assessment
This skill is an instruction-only guide for PM2 and is internally consistent. It does not ask for secrets or install code itself, but following the steps will install PM2 globally and may require sudo to register startup scripts. Only proceed if you trust running global npm installs on this machine and understand that pm2 startup + pm2 save will create persistent services and modify system startup. Prefer running installs as the intended user (or via your OS package manager if available), review any ecosystem.config.js before starting apps, and avoid running untrusted application code under PM2 with elevated privileges.

Like a lobster shell, security has layers — review code before you run it.

latestvk9789qfn48edjve1ebbp832bn97zwzpe
3kdownloads
3stars
1versions
Updated 1mo ago
v1.0.0
MIT-0

PM2 Process Manager

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

Install

npm install -g pm2

Quick Start

# 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

# 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

# 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

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

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

Useful Flags

FlagDescription
--nameProcess name
--watchRestart on file changes
-i maxCluster mode (all CPUs)
--max-memory-restart 200MAuto-restart on memory limit
--cron "0 * * * *"Scheduled restart

Cleanup

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

Comments

Loading comments...