Install
openclaw skills install @zitao666/pm2-gateway-restartUse 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.
openclaw skills install @zitao666/pm2-gateway-restartThis skill provides reliable gateway restart using PM2 process manager instead of the built-in openclaw gateway commands.
The standard openclaw gateway start/stop commands on Windows suffer from:
PM2 handles process resurrection and provides reliable restarts.
pm2 restart openclaw-gateway
Wait ~15 seconds for the gateway to fully initialize, then verify with:
curl http://127.0.0.1:18789/
pm2 restart openclaw-gateway; sleep 3; pm2 restart openclaw-gateway
pm2 status
pm2 logs openclaw-gateway --lines 50
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
Wait 65 seconds for Windows TCP timeout to clear FIN_WAIT_2 connections, then:
pm2 restart openclaw-gateway
The RPC check may fail briefly during startup. Wait 15 seconds and retry:
curl http://127.0.0.1:18789/
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
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