
安装部署
方式一:一键安装脚本(推荐)
macOS / Linux / WSL2
curl -fsSL https://openclaw.ai/install.sh | bashWindows PowerShell
iwr -useb https://openclaw.ai/install.ps1 | iexcurl -fsSL https://openclaw.ai/install.sh | bash -s -- --no-onboard方式二:npm 手动安装
# 确保 Node.js 22+node --version# 全局安装 OpenClawnpm install -g openclaw@latest# 运行配置向导(同时安装守护进程)openclaw onboard --install-daemon
方式三:Docker 部署
docker pull openclaw/openclaw:latestdocker run -d \--name openclaw \-p 18789:18789 \-v ~/.openclaw:/root/.openclaw \-e ANTHROPIC_API_KEY=sk-ant-xxx \openclaw/openclaw:latest
安装后验证是否安装成功
openclaw --versionopenclaw doctoropenclaw gateway statusopenclaw dashboard
若是+ openclaw dashboard 能正常打开,说明网关已可用。
常见问题
命令找不到
npm prefix -gexport PATH="$(npm prefix -g)/bin:$PATH"
sharp 编译失败(macOS 常见)
SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install -g openclaw@latest端口冲突
lsof -i :18789openclaw gateway --port 19000
网关无法启动
openclaw doctoropenclaw doctor --fixopenclaw logs --follow
夜雨聆风