Docs
Refer friends. Keep the rewards coming!Your friend can unlock up to 10M tokens · earn up to 30% revenue share.
+500K TokensGenerate link

部署与运维 (Archive)

Archived original-language source from the legacy CrabClaw docs. This page is intentionally not machine-translated.

本指南介绍如何在生产环境中部署和管理 Crab Claw。

系统要求

项目最低要求推荐
操作系统macOS 13+ / Ubuntu 22.04+ / Windows 10+macOS 14+ / Ubuntu 24.04
内存2 GB4 GB+
磁盘1 GB10 GB+(含模型缓存)
Go1.22+(从源码构建)
Rust1.75+(从源码构建)

守护进程

安装守护进程

bash
# 安装并启用守护进程
crabclaw daemon install

# 启动
crabclaw daemon start

# 停止
crabclaw daemon stop

# 卸载
crabclaw daemon uninstall
# 安装并启用守护进程
crabclaw daemon install

# 启动
crabclaw daemon start

# 停止
crabclaw daemon stop

# 卸载
crabclaw daemon uninstall

平台实现

平台守护方式配置文件位置
macOSlaunchd~/Library/LaunchAgents/com.acosmi.crabclaw.plist
Linuxsystemd~/.config/systemd/user/crabclaw.service
Windowsschtasks计划任务 CrabClaw Gateway

端口配置

端口服务默认值
Gateway 主端口WebSocket RPC + HTTP19001
Browser Control浏览器控制服务19002
Extension Relay浏览器扩展中继19004
Control UIWeb 管理界面18789

crabclaw.json 中自定义:

json
{
  "gateway": {
    "port": 19001
  }
}
{
  "gateway": {
    "port": 19001
  }
}

TLS 配置

启用 TLS 加密通信:

json
{
  "gateway": {
    "tls": {
      "enabled": true,
      "certFile": "/path/to/cert.pem",
      "keyFile": "/path/to/key.pem"
    }
  }
}
{
  "gateway": {
    "tls": {
      "enabled": true,
      "certFile": "/path/to/cert.pem",
      "keyFile": "/path/to/key.pem"
    }
  }
}

多节点部署

Crab Claw 支持多节点联邦架构:

bash
# 在主节点上添加远程节点
crabclaw nodes add --name worker-1 --host 192.168.1.100

# 查看节点状态
crabclaw nodes list
# 在主节点上添加远程节点
crabclaw nodes add --name worker-1 --host 192.168.1.100

# 查看节点状态
crabclaw nodes list

节点间通过 TLS + mDNS 自动发现和安全通信。

Docker 部署

bash
# 使用官方镜像
docker run -d \
  --name crabclaw \
  -p 19001:19001 \
  -p 18789:18789 \
  -v ~/.crabclaw:/root/.crabclaw \
  acosmi/crabclaw:latest
# 使用官方镜像
docker run -d \
  --name crabclaw \
  -p 19001:19001 \
  -p 18789:18789 \
  -v ~/.crabclaw:/root/.crabclaw \
  acosmi/crabclaw:latest

日志管理

bash
# 查看实时日志
crabclaw logs

# 查看历史日志
crabclaw logs --since 1h

# 按模块过滤
crabclaw logs --filter gateway
crabclaw logs --filter channels
# 查看实时日志
crabclaw logs

# 查看历史日志
crabclaw logs --since 1h

# 按模块过滤
crabclaw logs --filter gateway
crabclaw logs --filter channels

日志文件位置: ~/.crabclaw/logs/

健康检查

bash
# 全面诊断
crabclaw doctor

# 查看系统状态
crabclaw status
# 全面诊断
crabclaw doctor

# 查看系统状态
crabclaw status

crabclaw doctor 会检查:

  • Gateway 进程状态
  • 模型提供商连通性
  • 频道连接状态
  • 磁盘空间和端口占用
  • 浏览器可用性

备份与恢复

关键数据目录:

路径内容
~/.crabclaw/crabclaw.json主配置文件
~/.crabclaw/agents/智能体工作区
~/.crabclaw/state/运行时状态
~/.crabclaw/memory/UHMS 记忆数据

建议定期备份整个 ~/.crabclaw/ 目录。