
What is Clawdbot?
Clawdbot 是一个Open Source的自托管 AI 助手框架,由社区开发者维护(官网:clawd.bot),它允许你将 AI 模型(如 Anthropic 的 Claude、OpenAI 的 GPT 或其他 API 支持的模型)集成到聊天应用中。通过自然语言对话,你可以让 AI 执行服务器命令、读写文件、搜索互联网、管理日历、发送邮件、控制其他服务,甚至访问手机摄像头或推送通知。它本质上是一个网关服务,桥接 AI API 和消息通道,支持多代理路由、自动化工作流和 cron 任务调度。
与传统本地 LLM(大型语言模型)不同,Clawdbot 不需要强大 GPU,因为它主要依赖云 AI API(节省本地计算资源)。它适用于开发者、系统管理员或个人用户,想要一个私人、自定义的 AI 助手,而无需依赖第三方平台。安全性高,支持本地运行和远程访问,但需注意权限控制,以防 AI 误操作。
系统要求
- hardware:最低 1GB RAM、1 CPU 核心、25GB 存储。推荐 2GB RAM / 2 CPU 以确保流畅。适用于 VPS(如 DigitalOcean、Linode 或 €4/月的廉价云服务器)、树莓派、旧 PC 或虚拟机。不建议在主力电脑上部署,以避免潜在风险。
- operating system:Ubuntu 22.04/24.04 LTS(推荐)、Debian 或其他 Linux 发行版;Windows 10/11(通过 PowerShell);macOS(类似 Linux,但教程不详述)。
- 软件依赖:Node.js 20+(安装脚本会自动处理)。无互联网安装需求,但配置国外 AI 模型(如 Claude)需 VPN/代理。
- other:AI API 密钥(e.g., Anthropic API key 或 Claude Pro 订阅);聊天应用 token(如 Telegram Bot Token)。
- cost:免费开源。VPS 费用 ~$5/月;AI API 按使用付费(Claude 免费额度有限)。
步骤 1: 准备环境
获取服务器:
- 如果使用 VPS:选择 Ubuntu 24.04 LTS,配置 1GB RAM / 1 CPU / 25GB NVMe。记录服务器 IP。
- 如果本地:安装 Ubuntu 或在虚拟机(如 VirtualBox)中运行。
- 对于树莓派:安装 Raspberry Pi OS(基于 Debian),确保 SSH 启用。
SSH 登录:
- 使用终端:ssh root@你的服务器IP(替换为实际 IP)。
- 如果是新用户,创建 sudo 用户(推荐安全实践):
adduser clawd
usermod -aG sudo clawd
su – clawd
- 更新系统:sudo apt update && sudo apt upgrade -y。
Windows 用户准备:
- 打开 PowerShell(管理员模式)。
- 无需额外服务器,直接在本地运行(但不推荐用于生产)。
步骤 2: 安装 Clawdbot
安装使用一键脚本,自动处理 Node.js 和依赖。
Linux/Ubuntu:
curl -fsSL https://clawd.bot/install.sh | bash
脚本会下载 Node.js(如果缺失)、安装 Clawdbot 全局包,并配置环境。
完成后,重载 shell: exec bash或重启终端。
Windows:
iwr -useb https://clawd.bot/install.ps1 | iex
这会在 PowerShell 中运行,安装类似。
安装后,验证:运行 clawdbot –version ,应显示版本号。
步骤 3: 配置 Clawdbot
- 运行向导:
clawdbot setup –wizard
或 clawdbot onboard –install-daemon(安装后台服务)。
- 向导会引导:
- 选择网关模式:本地(local)或远程(remote)。
- 配置认证:输入 Anthropic API 密钥(从 claude.ai 获取)或其他模型(如 OpenAI)。支持 OAuth。
- 选择默认模型:e.g., claude-3-5-sonnet-20240620。
- 设置通道:Telegram、WhatsApp、Discord 或 iMessage。
- 安装 daemon:Linux 用 systemd,Windows 用服务管理器,macOS 用 launchd。确保服务自动启动。
更换模型:
- 运行 clawdbot config,选择模型部分,输入新 API 密钥或切换提供商。
- 支持多模型路由:不同联系人用不同代理。
安全设置:
- 设置密码或 token 认证。
- Limit permission: AI defaults a shell access, but can configure a white list command。
- For remote access, use SSH Tunnel: ssh-L 18789:127.0.0.1:18789 clawd@yourIP。
Step 4: Set up chat channels (as in Telegram)
Create Telegram Bot:
- Search @BotFather in Telegram, send /newbot, follow the hint to create bot, get Token。
Configure Channels:
- Enter Token in the wizard, or manually:。
- your Token
Launch gateway:
{\bord0\shad0\alphah3d}lawdbot gateway – bind lan –port 18789
- This start-up service, bugging local port 18789。
- for background running: use daemon mode。
Bot:
- At Telegram DM your bot, send a message. It'll return the pairing。
- runs on the server: codedbot。
Test: Send "Hello", AI should reply to bot. Test commands such as "run lls" or "search X news"。
Other corridors are similar:
- WhatsApp: Get token using Twilio or similar services。
- Discord: create bot app, get token。
- iMESSAGE: need macOS, configure AppleScript。
Step 5: Start and run
Start Service:
- Linux: Sudo systeml start lawdbot (if daemon is installed)。
- Windows: Start through the service manager。
- access dashboard: browser opens http://127.0.0.1:18789 (local) or remotely through tunnels。
Advanced Functions:
- automation: set-up cron: e.g., codedbot cron add "today send report"。
- Multinodes: mobile phone as node enabled camera/notice: codedbot node add phone。
- Develop Usage: Commands such as "deploy app" (integrated Git), "review PR" or "check logs"。
- Web Search: AI can internalize search, configure SerpaPI etc。
- Document management: “write file present to test.txt”。
Monitor and Log:
- view log: clawdbot logs。
- update: npm update-g codebot。
Step 6: Fault removal and best practices
- Frequently asked questions:
- API key error: Check the claude.ai account to ensure that there is a limit。
- port conflict: change port -port other。
- Model response slow: Switch providers or check networks (to go through external models)。
- installation failed: ensure curl/iwr is available and the firewall (ufw allow 18789) is checked。
- Best practices:
- Use Tailscale/ZeroTier for secure remote access。
- backup configuration: ~/.clawdbot/config.json。
- surveillance resources: top/htop, to ensure no limit。
- Community resources: official network docs.clawd.bot, GitHub warehouse, X Search #Clawbot。
- Risk: AI has shell access, using a sandbox environment for testing。
Conclusion
The deployment of Clawdbot takes only 15-30 minutes to have a strong AI assistant to increase productivity. Cheap VPS is cheaper than buying $600 Mac Mini. If you have a programming background, you can customize the extension; starter follows the wizard. Start experimenting -- from simple commands to complex automation, it will change your work flow! In case of problems, refer to official documents or community discussions。
document: https://docs.clawd.bot/
GitHub: https://github.com/clawdbot/clawdbot