第 6 步:创建你的 Agent
用一条命令把你的 Contabo VPS 变成一个运行中的 AI Agent。
这是最主要的一步。一条命令就能从零配置你的 VPS 并启动 Agent。
运行之前
- 你已登录并完成订阅(第 3 步)
- 你的 Contabo VPS 已交付并在运行(第 4 步)
- 你电脑上的 Tailscale 已 连接(第 5 步)
- 接下来的 5–40 分钟里,你的电脑需要保持唤醒。不要关闭终端,也不要让笔记本进入睡眠。
第 1 步:开始 onboarding
officeclaws onboard --name Mona你可以给 Agent 起任何名字;Mona 只是一个示例。如果省略 --name,CLI 会询问你。
第 2 步:输入 Contabo 凭据
第一次运行此命令时,CLI 会要求你输入 第 4 步 中的四个值:
Contabo client ID: ...
Contabo client secret: ...
Contabo API user (email): [email protected]
Contabo API password: ...
Validating Contabo credentials…
Contabo credentials saved.
第 3 步:输入 Tailscale 认证密钥
Tailscale auth key: tskey-auth-...
第 4 步:选择你的 VPS
CLI 会加载你 Contabo 账号中的服务器并列出来:
Syncing your Contabo VPSes…
Your VPSes:
1) 6f1c… 203.0.113.10 active
2) 9a2d… 203.0.113.24 active [agent: Bob (online)]
Pick a VPS number: 1
输入你想要的服务器编号并按 Enter。标有 [agent: …] 的服务器上已经有 Agent。不能直接在它上面再运行一次设置,因为第一次设置已经关闭了这台服务器的公网 SSH。要在上面部署新的 Agent,请先在 Contabo 控制面板中为这台 VPS 重装 Ubuntu 24.04(参见 管理 Agent),然后再在这里选择它。旧的 Agent 会因此被清除。
“No VPSes found on your account” 表示 Contabo 还没有交付服务器,或者这组 API 凭据属于另一个 Contabo 账号。
第 5 步:等待
CLI 会在运行时显示每个阶段:
Provisioning "Mona" on VPS 6f1c… — this can take several minutes…
▸ Ensuring local Tailscale is connected...
▸ Loading selected VPS...
▸ Installing OpenClaw's SSH key on your VPS...
▸ Waiting for VPS to finish rebooting and quiesce cloud-init...
▸ Bootstrapping VPS over SSH...
▸ Running onboard_agent.sh via Tailscale (100.x.y.z)...
▸ Waiting for gateway to come online...
▸ Approving operator device...
这些步骤之间还会出现缩进的详细信息行,这是正常的。
在这一步中,CLI 会:
- 把在你电脑上生成的专用 SSH 密钥添加到 VPS
- 加固服务器:创建一个独立用户,开启防火墙和暴力破解防护,启用自动安全更新,并禁用密码登录和 root 登录
- 把服务器接入你的 tailnet,并 关闭公网 SSH
- 安装 Docker 并启动 Agent
所需时间:
| 情况 | 用时 |
|---|---|
| 常规设置 | 约 5–10 分钟 |
| Contabo 重启服务器较慢时 | 最多 30–40 分钟 |
完成后:
✅ Agent "Mona" is ready. Next:
officeclaws connect-codex ← connect your ChatGPT/Codex subscription to power it
officeclaws chat
常用选项
| 选项 | 作用 |
|---|---|
--reinstall | 用于我们内部的预制服务器镜像。它 不会 清除你的 VPS:如果你的 Contabo 账号中没有这样的镜像(通常都没有),设置会照常继续。如果想从干净的服务器开始,请改为在 Contabo 控制面板中重装 Ubuntu 24.04。参见 管理 Agent。 |
--ssh-pubkey "ssh-ed25519 AAAA… you@laptop" | 同时把 你自己的 SSH 密钥添加到服务器,以便以后你可以通过 Tailscale 自行登录 |
--avatar 1…12 | 选择 Agent 在桌面应用中的头像 |
--comm-style friendly|business|creative | 设置 Agent 的语气风格。默认是 friendly。 |
--tailscale-hostname name | 设置服务器在你的 tailnet 中的名称。默认基于 Agent 的名字。 |
--vps <id> | 跳过服务器列表,直接使用这台 VPS |
如果出了问题
- 如果设置在完成之前就失败了,再运行一次同样的命令。
- 如果这样仍不行,或者这台服务器上已经完整设置过一次,请从干净的服务器开始:在 Contabo 控制面板中为这台 VPS 重装 Ubuntu 24.04,然后再次运行
officeclaws onboard。 - 设置日志保存在你电脑上的
~/.openclaw/logs中。 - 常见错误请参见 故障排查。