如何安装 ClawdBot:完整指南
想知道如何安装 ClawdBot?本综合指南涵盖了您需要了解的关于如何在任何平台上安装 ClawdBot 的一切。无论您使用 Mac、Windows 还是 Linux,我们都会逐步向您展示如何安装 ClawdBot。
安装 ClawdBot 之前
在学习如何安装 ClawdBot 之前,请确保您具备:
系统要求
| 平台 | 最低要求 |
|---|---|
| macOS | macOS 12+(Monterey),4GB 内存 |
| Windows | Windows 10+,4GB 内存 |
| Linux | Ubuntu 20.04+,4GB 内存 |
| Node.js | 版本 20 或更高 |
所需账户
要安装 ClawdBot,您需要:
- AI 提供商 API 密钥:Anthropic(Claude)、OpenAI 或其他支持的提供商
- 消息平台账户:Telegram、WhatsApp、Discord 或其他
如何安装 ClawdBot:快速方法
安装 ClawdBot 最快的方式是使用一行命令安装器:
macOS/Linux 安装
curl -fsSL https://molt.bot/install.sh | bashWindows 安装
irm https://molt.bot/install.ps1 | iex运行安装器后,按照提示完成 ClawdBot 安装。
如何安装 ClawdBot:NPM 方法
要更好地控制如何安装 ClawdBot,请使用 NPM:
步骤 1:安装 Node.js
首先,安装 Node.js(安装 ClawdBot 所需):
macOS(使用 Homebrew):
brew install nodeWindows: 从 nodejs.org 下载
Linux(Ubuntu/Debian):
curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs步骤 2:通过 NPM 安装 ClawdBot
现在全局安装 ClawdBot:
npm install -g clawdbot步骤 3:运行 ClawdBot 设置
使用设置向导完成 ClawdBot 安装:
clawdbot onboard如何安装 ClawdBot:开发者方法
想要自定义 ClawdBot 的开发者可以从源码安装:
# 克隆仓库
git clone https://github.com/moltbot/moltbot.git
# 进入目录
cd moltbot
# 安装依赖
pnpm install
# 构建 ClawdBot
pnpm run build
# 运行设置向导
pnpm run clawdbot onboard如何在不同平台上安装 ClawdBot
如何在 macOS 上安装 ClawdBot
在 Mac 上安装 ClawdBot:
- 打开终端
- 运行快速安装器:
curl -fsSL https://molt.bot/install.sh | bash - 按照设置向导操作
- 配置您的 AI 提供商
- 连接您的消息平台
macOS 伴侣应用: ClawdBot 还为 macOS 14+ 提供菜单栏应用:
- 从 GitHub releases 下载
- 拖到应用程序文件夹
- 启动并配置
如何在 Windows 上安装 ClawdBot
在 Windows 上安装 ClawdBot:
- 以管理员身份打开 PowerShell
- 运行安装器:
irm https://molt.bot/install.ps1 | iex - 完成设置向导
- 可选择安装为 Windows 服务
如何在 Linux 上安装 ClawdBot
在 Linux 上安装 ClawdBot:
- 打开终端
- 运行安装器:
curl -fsSL https://molt.bot/install.sh | bash - 配置为 systemd 服务以实现 24/7 运行
安装后配置
安装 ClawdBot 后,完成以下配置步骤:
配置 AI 提供商
# 设置您的 AI 提供商
clawdbot config set llm.provider anthropic
# 添加您的 API 密钥
clawdbot config set llm.apiKey YOUR_API_KEY启用消息渠道
# 启用 Telegram
clawdbot config set channels.telegram.enabled true
clawdbot config set channels.telegram.botToken YOUR_BOT_TOKEN
# 启用 Discord
clawdbot config set channels.discord.enabled true
clawdbot config set channels.discord.botToken YOUR_BOT_TOKEN启动 ClawdBot
# 启动 ClawdBot 网关
clawdbot gateway --port 18789
# 或安装为守护进程以后台运行
clawdbot onboard --install-daemon验证 ClawdBot 安装
安装 ClawdBot 后,验证其是否正常工作:
# 检查 ClawdBot 状态
clawdbot status
# 查看 ClawdBot 版本
clawdbot --version
# 测试 ClawdBot 连接
clawdbot testClawdBot 安装故障排除
常见安装问题
安装后"命令未找到":
# 重新加载 shell
exec bash
# 或对于 zsh
exec zsh安装时权限错误:
# 不要对 npm -g 使用 sudo
# 而是修复 npm 权限
mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
export PATH=~/.npm-global/bin:$PATHNode.js 版本过旧:
# 更新 Node.js
nvm install 22
nvm use 22常见问题
安装 ClawdBot 需要多长时间?
ClawdBot 安装通常需要 5-10 分钟,包括配置。
我可以不安装 Node.js 就安装 ClawdBot 吗?
不可以,安装 ClawdBot 需要 Node.js。先安装 Node.js,然后安装 ClawdBot。
安装后如何更新 ClawdBot?
npm update -g clawdbot我可以在 VPS 上安装 ClawdBot 吗?
是的,您可以在任何运行 Linux 的 VPS 上安装 ClawdBot。这是 24/7 运行的推荐设置。
准备好安装 ClawdBot 了吗?立即开始安装

