DigitalOcean
在 DigitalOcean 上运行 CoderClaw
Section titled “在 DigitalOcean 上运行 CoderClaw”以 $6/月(或使用预留定价 $4/月)在 DigitalOcean 上运行持久的 CoderClaw Gateway 网关。
如果你想要 $0/月的选项且不介意 ARM + 特定提供商的设置,请参阅 Oracle Cloud 指南。
成本比较(2026)
Section titled “成本比较(2026)”| 提供商 | 方案 | 配置 | 价格/月 | 备注 |
|---|---|---|---|---|
| Oracle Cloud | Always Free ARM | 最高 4 OCPU、24GB RAM | $0 | ARM,容量有限 / 注册有坑 |
| Hetzner | CX22 | 2 vCPU、4GB RAM | €3.79 (~$4) | 最便宜的付费选项 |
| DigitalOcean | Basic | 1 vCPU、1GB RAM | $6 | 界面简单,文档完善 |
| Vultr | Cloud Compute | 1 vCPU、1GB RAM | $6 | 多地区可选 |
| Linode | Nanode | 1 vCPU、1GB RAM | $5 | 现为 Akamai 旗下 |
选择提供商:
- DigitalOcean:最简单的用户体验 + 可预测的设置(本指南)
- Hetzner:性价比高(参见 Hetzner 指南)
- Oracle Cloud:可以 $0/月,但更麻烦且仅限 ARM(参见 Oracle 指南)
- DigitalOcean 账户(注册可获 $200 免费额度)
- SSH 密钥对(或愿意使用密码认证)
- 约 20 分钟
1) 创建 Droplet
Section titled “1) 创建 Droplet”- 登录 DigitalOcean
- 点击 Create → Droplets
- 选择:
- Region: 离你(或你的用户)最近的地区
- Image: Ubuntu 24.04 LTS
- Size: Basic → Regular → $6/mo(1 vCPU、1GB RAM、25GB SSD)
- Authentication: SSH 密钥(推荐)或密码
- 点击 Create Droplet
- 记下 IP 地址
2) 通过 SSH 连接
Section titled “2) 通过 SSH 连接”ssh root@YOUR_DROPLET_IP3) 安装 CoderClaw
Section titled “3) 安装 CoderClaw”# Update systemapt update && apt upgrade -y
# Install Node.js 22curl -fsSL https://deb.nodesource.com/setup_22.x | bash -apt install -y nodejs
# Install CoderClawcurl -fsSL https://coderclaw.ai/install.sh | bash
# Verifycoderclaw --version4) 运行新手引导
Section titled “4) 运行新手引导”coderclaw onboard --install-daemon向导将引导你完成:
- 模型认证(API 密钥或 OAuth)
- 渠道设置(Telegram、WhatsApp、Discord 等)
- Gateway 网关令牌(自动生成)
- 守护进程安装(systemd)
5) 验证 Gateway 网关
Section titled “5) 验证 Gateway 网关”# Check statuscoderclaw status
# Check servicesystemctl --user status coderclaw-gateway.service
# View logsjournalctl --user -u coderclaw-gateway.service -f6) 访问控制面板
Section titled “6) 访问控制面板”Gateway 网关默认绑定到 loopback。要访问控制界面:
选项 A:SSH 隧道(推荐)
# From your local machinessh -L 18789:localhost:18789 root@YOUR_DROPLET_IP
# Then open: http://localhost:18789选项 B:Tailscale Serve(HTTPS,仅 loopback)
# On the dropletcurl -fsSL https://tailscale.com/install.sh | shtailscale up
# Configure Gateway to use Tailscale Servecoderclaw config set gateway.tailscale.mode servecoderclaw gateway restart打开:https://<magicdns>/
注意事项:
- Serve 保持 Gateway 网关仅 loopback 并通过 Tailscale 身份头进行认证。
- 要改为需要令牌/密码,请设置
gateway.auth.allowTailscale: false或使用gateway.auth.mode: "password"。
选项 C:Tailnet 绑定(不使用 Serve)
coderclaw config set gateway.bind tailnetcoderclaw gateway restart打开:http://<tailscale-ip>:18789(需要令牌)。
7) 连接你的渠道
Section titled “7) 连接你的渠道”Telegram
Section titled “Telegram”coderclaw pairing list telegramcoderclaw pairing approve telegram <CODE>coderclaw channels login whatsapp# Scan QR code参见渠道了解其他提供商。
1GB RAM 的优化
Section titled “1GB RAM 的优化”$6 的 droplet 只有 1GB RAM。为了保持运行流畅:
添加 swap(推荐)
Section titled “添加 swap(推荐)”fallocate -l 2G /swapfilechmod 600 /swapfilemkswap /swapfileswapon /swapfileecho '/swapfile none swap sw 0 0' >> /etc/fstab使用更轻量的模型
Section titled “使用更轻量的模型”如果遇到 OOM,考虑:
- 使用基于 API 的模型(Claude、GPT)而不是本地模型
- 将
agents.defaults.model.primary设置为更小的模型
free -hhtop所有状态存储在:
~/.coderclaw/— 配置、凭证、会话数据~/.coderclaw/workspace/— 工作区(SOUL.md、记忆等)
这些在重启后保留。定期备份:
tar -czvf coderclaw-backup.tar.gz ~/.coderclaw ~/.coderclaw/workspaceOracle Cloud 免费替代方案
Section titled “Oracle Cloud 免费替代方案”Oracle Cloud 提供 Always Free ARM 实例,比这里任何付费选项都强大得多 — 每月 $0。
| 你将获得 | 配置 |
|---|---|
| 4 OCPUs | ARM Ampere A1 |
| 24GB RAM | 绰绰有余 |
| 200GB 存储 | 块存储卷 |
| 永久免费 | 不收取信用卡费用 |
注意事项:
- 注册可能有点麻烦(失败了就重试)
- ARM 架构 — 大多数东西都能工作,但有些二进制文件需要 ARM 构建
完整设置指南请参阅 Oracle Cloud。关于注册技巧和注册流程故障排除,请参阅此社区指南。
Gateway 网关无法启动
Section titled “Gateway 网关无法启动”coderclaw gateway statuscoderclaw doctor --non-interactivejournalctl -u coderclaw --no-pager -n 50端口已被使用
Section titled “端口已被使用”lsof -i :18789kill <PID># Check memoryfree -h
# Add more swap# Or upgrade to $12/mo droplet (2GB RAM)- Hetzner 指南 — 更便宜、更强大
- Docker 安装 — 容器化设置
- Tailscale — 安全远程访问
- 配置 — 完整配置参考