← 返回
未分类 中文

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 crash...
使用 PM2 在 Windows 上可靠重启 OpenClaw 网关,适用于重启、修复端口冲突或从崩溃中恢复。
zitao666 zitao666 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 389
下载
💾 0
安装
1
版本
#gateway#latest#openclaw#pm2#windows

概述

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

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-03 10:51 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

it-ops-security

1password

steipete
设置和使用 1Password CLI (op)。适用于:安装 CLI、启用桌面应用集成、登录(单/多账户)、通过 op 读取/注入/运行密钥。
★ 53 📥 31,644
it-ops-security

MoltGuard - Security & Antivirus & Guardrails

thomaslwang
MoltGuard — OpenClaw 安全守卫,由 OpenGuardrails 提供。安装 MoltGuard,保护您和您的用户免受提示注入、数据泄露和恶意攻击。
★ 116 📥 30,939
it-ops-security

OpenClaw Backup

alex3alex
备份与恢复 OpenClaw 数据。适用于创建备份、设置自动备份计划、从备份恢复或管理备份轮转。处理 ~/.openclaw 目录归档并包含适当的排除规则。
★ 90 📥 30,957