PM2 Remote Manager

v1.0.0

SSH-based PM2 service management for remote servers. List processes, restart/stop services, view logs, monitor CPU/memory usage, and perform common PM2 opera...

0· 139·0 current·0 all-time

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for qoohsuan/pm2-remote-manager.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "PM2 Remote Manager" (qoohsuan/pm2-remote-manager) from ClawHub.
Skill page: https://clawhub.ai/qoohsuan/pm2-remote-manager
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Bare skill slug

openclaw skills install pm2-remote-manager

ClawHub CLI

Package manager switcher

npx clawhub@latest install pm2-remote-manager
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
medium confidence
Purpose & Capability
The name/description (PM2 Remote Manager) match the SKILL.md contents: all examples are SSH commands that run pm2 on a remote host. The operations requested (list/restart/logs/monitor/scale/etc.) are exactly what PM2 and SSH provide. Nothing in the instructions requires unrelated services or credentials.
Instruction Scope
The instructions direct the agent (or user) to run ssh/scp and pm2 commands on remote servers. This is within the stated purpose, but the SKILL.md implicitly assumes the local environment has ssh/scp and that the user controls working SSH keys. The doc also suggests following runtime instructions produced by pm2 (e.g., pm2 startup) which may ask the user to run additional elevated commands on the remote host — expected for this workflow but worth being aware of.
Install Mechanism
This is an instruction-only skill with no install spec and no code files. That is the lowest-risk install model and matches the content (examples only).
Credentials
The skill declares no required environment variables or credentials — appropriate because SSH keys/credentials live outside the skill. One minor omission: SKILL.md presumes availability of ssh/scp on the agent's host but the registry metadata lists no required binaries; this is an informational gap rather than a functional mismatch.
Persistence & Privilege
always is false and the skill does not request persistent system changes or declare it will modify other skills or system-wide settings. The skill's actions are limited to instructing the user/agent to run remote commands via SSH.
Assessment
This skill is essentially documentation showing ssh + pm2 commands. Before using it: (1) verify you trust whoever supplied the server addresses you will connect to; the skill does not store credentials, so SSH keys/credentials remain under your control; (2) confirm your local environment has ssh/scp and that you use key-based auth or otherwise secure credentials; (3) be cautious if you allow an autonomous agent to invoke this skill — ssh commands can execute arbitrary remote commands on servers you point it at (test on a staging host first); (4) the SKILL.md doesn't declare required binaries explicitly (ssh/scp), so keep that in mind when evaluating readiness.

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

devopsvk979y0fbrx5t7ztjfn2qp9gfbx83nn7hlatestvk979y0fbrx5t7ztjfn2qp9gfbx83nn7hmonitoringvk979y0fbrx5t7ztjfn2qp9gfbx83nn7hnodejsvk979y0fbrx5t7ztjfn2qp9gfbx83nn7hpm2vk979y0fbrx5t7ztjfn2qp9gfbx83nn7hprocess-managementvk979y0fbrx5t7ztjfn2qp9gfbx83nn7hservervk979y0fbrx5t7ztjfn2qp9gfbx83nn7hsshvk979y0fbrx5t7ztjfn2qp9gfbx83nn7h
139downloads
0stars
1versions
Updated 1mo ago
v1.0.0
MIT-0

PM2 Manager

Manage remote PM2 processes via SSH connection. This skill provides commands for monitoring, controlling, and maintaining Node.js applications deployed with PM2 process manager on remote servers.

Prerequisites

  • SSH access to target server
  • PM2 installed on remote server
  • SSH key-based authentication (recommended)
  • Target server accessible from local machine

Usage

Basic Process Management

List all processes:

ssh user@server "pm2 list"
ssh user@server "pm2 status"

Start/Stop/Restart services:

# Start specific app
ssh user@server "pm2 start ecosystem.config.js"
ssh user@server "pm2 start app.js --name myapp"

# Restart specific process
ssh user@server "pm2 restart myapp"
ssh user@server "pm2 restart 0"  # by ID

# Stop process
ssh user@server "pm2 stop myapp"
ssh user@server "pm2 delete myapp"  # completely remove

# Restart all processes
ssh user@server "pm2 restart all"

Log Management

View real-time logs:

# All processes
ssh user@server "pm2 logs"

# Specific process
ssh user@server "pm2 logs myapp"
ssh user@server "pm2 logs 0"

# Last N lines
ssh user@server "pm2 logs myapp --lines 100"

# Error logs only
ssh user@server "pm2 logs myapp --err"

Log rotation and cleanup:

# Flush all logs
ssh user@server "pm2 flush"

# Install log rotation
ssh user@server "pm2 install pm2-logrotate"

Monitoring and Performance

Real-time monitoring:

# Monitor dashboard
ssh user@server "pm2 monit"

# Show detailed info
ssh user@server "pm2 show myapp"
ssh user@server "pm2 describe 0"

Memory and CPU usage:

# List with memory usage
ssh user@server "pm2 list --sort memory"

# JSON output for parsing
ssh user@server "pm2 jlist"
ssh user@server "pm2 prettylist"

Advanced Operations

Environment management:

# Start with different environment
ssh user@server "pm2 start ecosystem.config.js --env production"
ssh user@server "pm2 start app.js --env development"

# Update environment variables
ssh user@server "pm2 restart myapp --update-env"

Process scaling:

# Scale to 4 instances
ssh user@server "pm2 scale myapp 4"

# Start in cluster mode
ssh user@server "pm2 start app.js -i max"  # use all CPUs
ssh user@server "pm2 start app.js -i 4"    # 4 instances

Health checks and auto-restart:

# Set max memory before restart
ssh user@server "pm2 start app.js --max-memory-restart 100M"

# Set restart delay
ssh user@server "pm2 start app.js --restart-delay 3000"

# Disable auto-restart
ssh user@server "pm2 start app.js --no-autorestart"

Ecosystem Configuration

Create ecosystem.config.js for complex deployments:

module.exports = {
  apps: [
    {
      name: 'main-app',
      script: './app.js',
      instances: 2,
      env: {
        NODE_ENV: 'development',
        PORT: 3000
      },
      env_production: {
        NODE_ENV: 'production',
        PORT: 8080
      }
    },
    {
      name: 'worker',
      script: './worker.js',
      instances: 1,
      cron_restart: '0 0 * * *',  // restart daily
      max_memory_restart: '200M'
    }
  ]
};

Deploy with ecosystem:

# Upload and start
scp ecosystem.config.js user@server:/path/to/app/
ssh user@server "cd /path/to/app && pm2 start ecosystem.config.js"

# Production environment
ssh user@server "cd /path/to/app && pm2 start ecosystem.config.js --env production"

Startup and Persistence

Save current process list:

ssh user@server "pm2 save"

Setup startup script:

# Generate startup script
ssh user@server "pm2 startup"
# Follow the instructions to run the generated command

# Save and enable startup
ssh user@server "pm2 save && pm2 startup systemd"

Batch Operations Script Example

#!/bin/bash
# pm2-batch-restart.sh

SERVER="user@10.0.0.213"
APPS=("main-app" "linebot-server" "liff-server")

echo "Restarting PM2 services on $SERVER..."

for app in "${APPS[@]}"; do
    echo "Restarting $app..."
    ssh $SERVER "pm2 restart $app"
    if [ $? -eq 0 ]; then
        echo "✅ $app restarted successfully"
    else
        echo "❌ Failed to restart $app"
    fi
done

echo "Checking status..."
ssh $SERVER "pm2 list"

Troubleshooting

Common issues and solutions:

  1. Process not starting:
ssh user@server "pm2 logs myapp --err"
ssh user@server "pm2 show myapp"
  1. High memory usage:
ssh user@server "pm2 restart myapp"  # Quick fix
ssh user@server "pm2 reload myapp"   # Zero-downtime restart
  1. Port conflicts:
ssh user@server "pm2 show myapp | grep 'port'"
ssh user@server "netstat -tlnp | grep :3000"
  1. Clear PM2 cache:
ssh user@server "pm2 kill && pm2 start ecosystem.config.js"

Production Example (Pro-Power System)

# Production server management
SERVER="administrator@10.0.0.213"

# Check all services
ssh $SERVER "pm2 list"

# Restart specific services
ssh $SERVER "pm2 restart main-app"
ssh $SERVER "pm2 restart linebot-server"
ssh $SERVER "pm2 restart ProPower-tunnel"

# View logs
ssh $SERVER "pm2 logs main-app --lines 50"

# Monitor performance
ssh $SERVER "pm2 monit"

This skill streamlines remote PM2 management, making it easy to maintain Node.js applications running on production servers.

Comments

Loading comments...