pm2-gateway-restart

Use PM2 to reliably restart OpenClaw gateway on Windows. Use when the user wants to restart the OpenClaw gateway, fix port conflicts, or recover from a crashed gateway. This skill handles the Windows-specific issues with FIN_WAIT_2 TCP connections and scheduled task failures that plague the standard openclaw gateway start/stop commands.

Safety Notice

This listing is from the official public ClawHub registry. Review SKILL.md and referenced scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "pm2-gateway-restart" with this command: npx skills add zitao666/pm2-gateway-restart

PM2 Gateway Restart

This skill provides reliable gateway restart using PM2 process manager instead of the built-in openclaw gateway commands.

Why PM2?

The standard openclaw gateway start/stop commands on Windows suffer from:

  • FIN_WAIT_2 TCP connection timeouts (~60 seconds)
  • Scheduled task race conditions
  • Inconsistent startup state reporting

PM2 handles process resurrection and provides reliable restarts.

Commands

Quick Restart (Production)

pm2 restart openclaw-gateway

Wait ~15 seconds for the gateway to fully initialize, then verify with:

curl http://127.0.0.1:18789/

Full Cycle Restart (When Issues Persist)

pm2 restart openclaw-gateway; sleep 3; pm2 restart openclaw-gateway

Check Status

pm2 status
pm2 logs openclaw-gateway --lines 50

Start Gateway (If Not Running)

pm2 start "D:/Program Files/nodejs/node.exe" --name "openclaw-gateway" -- "C:/Users/Administrator/AppData/Roaming/npm/node_modules/openclaw/dist/index.js" gateway --port 18789

Troubleshooting

Port Still in Use After Restart

Wait 65 seconds for Windows TCP timeout to clear FIN_WAIT_2 connections, then:

pm2 restart openclaw-gateway

RPC Probe Fails But Gateway Listening

The RPC check may fail briefly during startup. Wait 15 seconds and retry:

curl http://127.0.0.1:18789/

PM2 Process Not Found

Reinstall the gateway process:

pm2 start "D:/Program Files/nodejs/node.exe" --name "openclaw-gateway" -- "C:/Users/Administrator/AppData/Roaming/npm/node_modules/openclaw/dist/index.js" gateway --port 18789
pm2 save

Setup (One Time)

npm install -g pm2
pm2 start "D:/Program Files/nodejs/node.exe" --name "openclaw-gateway" -- "C:/Users/Administrator/AppData/Roaming/npm/node_modules/openclaw/dist/index.js" gateway --port 18789
pm2 save

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

General

OpenClaw Gateway Manager

Unified multi-cloud management tool for detecting, configuring, restarting, verifying, creating, and safely deleting all OpenClaw gateway instances on macOS.

Registry Source
1590Profile unavailable
General

OpenClaw Windows Fix Scheduled Task Idle-Kill Bug Patch

Fixes the Windows scheduled task bug that kills OpenClaw processes during idle. One script, permanent fix.

Registry SourceRecently Updated
2800Profile unavailable
General

OpenClaw Model Manager

Fetch and display OpenRouter AI models with pricing and context limits, and configure OpenClaw to use selected models via automatic or fallback settings.

Registry SourceRecently Updated
1.3K1Profile unavailable
General

Gateway Auto-Fix

Automatically monitor OpenClaw gateway status and fix when RPC probe fails. Uses OpenClaw cron system - just install and it works!

Registry Source
5230Profile unavailable