OpenClaw 是一个 自托管的多渠道 AI 网关 ,让你可以将 WhatsApp、Telegram、Discord、iMessage 等聊天应用与 AI 智能体连接起来。
核心特点:
- 🏠 自托管 :运行在你自己的硬件上,你的数据你做主
- 📱 多渠道支持 :一个网关同时支持多个聊天平台
- 🤖 智能体原生 :专为编程智能体设计,支持工具调用、会话、记忆等
- 🔓 开源 :MIT 许可证,社区驱动
想象一下:你在 WhatsApp 上发一条消息,就能获得一个随时待命的 AI 助手的回复。这就是 OpenClaw 带来的体验。
开始之前,确保你的环境满足以下条件:
- Node.js 22+ (安装脚本会自动检测并安装)
- 操作系统:macOS、Linux 或 Windows
- 推荐 :Windows 用户使用 WSL2
OpenClaw 提供多种安装方式, 推荐使用安装脚本 ,它会自动处理 Node.js 检测、安装和配置向导。
macOS / Linux / WSL2
curl -fsSL https://openclaw.ai/install.sh | bash
GPT plus 代充 只需 145
就这么简单!脚本会自动完成所有工作。
Windows (PowerShell)
讯享网iwr -useb https://openclaw.ai/install.ps1 | iex
跳过配置向导(仅安装二进制文件):
curl -fsSL https://openclaw.ai/install.sh | bash -s – –no-onboard
如果你已经有 Node.js 22+,并且更喜欢自己管理安装过程:
使用 npm
讯享网npm install -g openclaw@latest
openclaw onboard –install-daemon
遇到 sharp 构建错误?
如果你的系统全局安装了 libvips(常见于通过 Homebrew 安装的 macOS),并且 sharp 安装失败,强制使用预编译二进制:
SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install -g openclaw@latest
使用 pnpm
讯享网pnpm add -g openclaw@latest
pnpm approve-builds -g # 批准 openclaw、node-llama-cpp、sharp 等包
openclaw onboard –install-daemon
> 注意 :pnpm 需要显式批准带有构建脚本的包。首次安装显示 “Ignored build scripts” 警告后,运行
pnpm approve-builds -g
并选择列出的包。
适合贡献者或想要从本地检出运行的开发者。
git clone https://github.com/openclaw/openclaw.git
cd openclaw
pnpm install
pnpm ui:build
pnpm build
pnpm link –global
openclaw onboard –install-daemon
或者,跳过链接步骤,直接在仓库内通过
pnpm openclaw …
运行命令。
OpenClaw 还支持多种其他部署方式:
| 方式 | 说明 |
|——|——|
| Docker | 容器化或无头部署 |
| Podman | 无根容器,运行
setup-podman.sh
后使用启动脚本 |
| Nix | 通过 Nix 声明式安装 |
| Ansible | 自动化批量部署 |
| Bun | 通过 Bun 运行时仅使用 CLI |
详细文档请参考 OpenClaw 官方文档。
安装完成后,运行以下命令验证一切正常:
讯享网openclaw doctor # 检查配置问题
openclaw status # 网关状态
openclaw dashboard # 打开浏览器 UI
如果需要自定义运行时路径,可以使用以下环境变量:
-
OPENCLAW_HOME
:基于主目录的内部路径
-
OPENCLAW_STATE_DIR
:可变状态位置
-
OPENCLAW_CONFIG_PATH
:配置文件位置
详见环境变量文档。
openclaw onboard –install-daemon
讯享网openclaw channels login
openclaw gateway –port 18789
网关启动后,在浏览器中打开:
- 本地默认:http://127.0.0.1:18789/
- 远程访问:需要配置 Web Surfaces 或 Tailscale
配置文件位于
/.openclaw/openclaw.json
。
如果不做任何配置 ,OpenClaw 会使用内置的 Pi 二进制文件(RPC 模式),并为每个发送者创建独立会话。
如果需要安全限制 ,可以从
channels.whatsapp.allowFrom
开始设置,以及群组的提及规则。
示例配置:
讯享网{
channels: {
whatsapp: {
allowFrom: [“+”],
groups: { “*”: { requireMention: true } },
},
},
messages: { groupChat: { mentionPatterns: [“@openclaw”] } },
}
快速诊断:
node -v(macOS/Linux)或
npm -v
npm prefix -g
echo “\(PATH"</span><span leaf="" mp-original-font-size="17" mp-original-line-height="1.99999" style="font-size: 17px; line-height: 1.6;"><br mp-original-font-size="17" mp-original-line-height="1.99999" style="font-size: 17px; line-height: 1.6;"></span></code></pre><section mp-original-font-size="17" mp-original-line-height="1.99999" style="font-size: 17px; line-height: 1.6;"><span leaf="" mp-original-font-size="17" mp-original-line-height="1.99999" style="font-size: 17px; line-height: 1.6;"><br mp-original-font-size="17" mp-original-line-height="1.99999" style="font-size: 17px; line-height: 1.6;"></span><span leaf="" mp-original-font-size="17" mp-original-line-height="1.99999" style="font-size: 17px; line-height: 1.6;"><br mp-original-font-size="17" mp-original-line-height="1.99999" style="font-size: 17px; line-height: 1.6;"></span><span leaf="" mp-original-font-size="17" mp-original-line-height="1.99999" style="font-size: 17px; line-height: 1.6;">如果 </span><code style="background-color: rgb(240, 240, 240); padding: 2px 4px; border-radius: 3px; font-size: 17px; line-height: 1.6;" mp-original-font-size="17" mp-original-line-height="1.99999"><span leaf="" mp-original-font-size="17" mp-original-line-height="1.99999" style="font-size: 17px; line-height: 1.6;">\)(npm prefix -g)/bin\((npm prefix -g)</span></code><span leaf="" mp-original-font-size="17" mp-original-line-height="1.99999" style="font-size: 17px; line-height: 1.6;">(Windows)</span><strong mp-original-font-size="17" mp-original-line-height="1.99999" style="font-size: 17px; line-height: 1.6;"><span leaf="" mp-original-font-size="17" mp-original-line-height="1.99999" style="font-size: 17px; line-height: 1.6;">不在</span></strong><span leaf="" mp-original-font-size="17" mp-original-line-height="1.99999" style="font-size: 17px; line-height: 1.6;">你的 </span><code style="background-color: rgb(240, 240, 240); padding: 2px 4px; border-radius: 3px; font-size: 17px; line-height: 1.6;" mp-original-font-size="17" mp-original-line-height="1.99999"><span leaf="" mp-original-font-size="17" mp-original-line-height="1.99999" style="font-size: 17px; line-height: 1.6;">\)PATH 中,你的 shell 就找不到全局 npm 二进制文件(包括 openclaw)。
修复方法:将其添加到 shell 启动文件(/.zshrc 或 /.bashrc):讯享网export PATH=”\((npm prefix -g)/bin:\)PATH”
在 Windows 上,将 npm prefix -g 的输出添加到你的 PATH。
然后打开新终端(或在 zsh 中运行 rehash,在 bash 中运行 hash -r)。
运行 npm config get prefix 并将该目录添加到你的用户 PATH(Windows 上不需要 \bin 后缀),然后重新打开 PowerShell。
安装脚本默认设置 SHARP_IGNORE_GLOBAL_LIBVIPS=1,以避免 sharp 针对系统 libvips 进行构建。如需覆盖:
SHARP_IGNORE_GLOBAL_LIBVIPS=0 curl -fsSL https://openclaw.ai/install.sh | bash
安装 Git for Windows,重新打开 PowerShell,重新运行安装程序。
讯享网npm update -g openclaw@latest
或重新运行安装脚本。
npm uninstall -g openclaw
如需彻底清理,删除 /.openclaw 目录。
安装完成后,你可以:
- 📖 阅读完整功能列表
- 🔄 了解多智能体路由
- 🔒 配置安全设置
- 📱 设置iOS 和 Android 节点
OpenClaw 的安装非常简单,一条命令即可完成:
讯享网curl -fsSL https://openclaw.ai/install.sh | bash
然后运行配置向导,连接你喜欢的聊天平台,就能拥有一个随时待命的 AI 助手了!
开始你的 OpenClaw 之旅吧! 🦞
本文档基于 OpenClaw 官方文档编写,更多详细信息请访问:https://docs.openclaw.ai
版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容,请联系我们,一经查实,本站将立刻删除。
如需转载请保留出处:https://51itzy.com/kjqy/212507.html