指南 01

快速
上手。

在你掌控的机器上用一条命令安装 EmperorClaw,然后在浏览器里雇用你的第一支 AI 团队。

阅读约 6 分钟更新于 2026 年 10 月 23 日入门

你需要准备什么

只需要一样东西:Docker。Windows 或 Mac 上用 Docker Desktop,Linux 上用带 Compose v2 插件的 Docker Engine。不需要 Git、Node.js、PostgreSQL 或 Python;数据库运行在 Docker 里。

  • 一台在智能体工作期间保持开机的机器:VPS、家用服务器或你自己的电脑
  • 小型安装至少需要 2 个 CPU 核心和 4 GB 内存
  • 足够存放数据库和文件的磁盘空间

镜像面向 amd64 架构。Apple Silicon 通过 Docker Desktop 的模拟运行。

安装

# Mac / Linux
curl -fsSL https://raw.githubusercontent.com/emperorclaw/emperorclaw/main/install.sh | bash
# Windows (PowerShell)
irm https://raw.githubusercontent.com/emperorclaw/emperorclaw/main/install.ps1 | iex

安装程序会:

  1. 检查 Docker。如果尚未安装,在 Linux 上会直接安装,在 Mac 上使用 Homebrew、在 Windows 上使用 winget(如可用),否则打开下载页面。
  2. 把大约十个文件(Compose 文件、Caddy 配置、.env.example 以及更新和备份脚本)下载到 ~/emperorclaw。它不会克隆整个仓库。
  3. 创建 .env,并生成 NEXTAUTH_SECRET、EMPEROR_CLAW_MASTER_KEY 和 POSTGRES_PASSWORD。已有的值绝不会被覆盖。
  4. 拉取预构建镜像,启动应用和 PostgreSQL,并等待应用进入健康状态。
  5. 打开 http://localhost:3000/signup。

重复运行也是安全的:你的 .env 和数据都会保留。

使用自己的域名并自动启用 HTTPS

把域名的 DNS A 记录指向服务器,并放行入站的 80 和 443 端口。然后把域名传给安装程序。它会配置 Caddy,由 Caddy 自动申请和续期证书。你不需要自己再搭反向代理。

# Mac / Linux
curl -fsSL https://raw.githubusercontent.com/emperorclaw/emperorclaw/main/install.sh | bash -s -- --domain claw.example.com
# Windows (PowerShell)
irm https://raw.githubusercontent.com/emperorclaw/emperorclaw/main/install.ps1 -OutFile emperor-install.ps1
.\emperor-install.ps1 -Domain claw.example.com

然后打开 https://claw.example.com/signup。其他选项:--admin-email / -AdminEmail 用于设置平台管理员,--dir / -InstallDir 用于更改安装目录,--no-browser / -NoBrowser 则不自动打开浏览器。

保持私有

不要暴露 PostgreSQL 或其他内部端口。只有 HTTPS 地址应该面向互联网。

首次运行:Emperor 设置

  1. 在注册页面创建你的管理员账号。
  2. 描述你的公司。
  3. 粘贴模型 API key。推荐使用 OpenRouter;在任何东西启动之前,系统会先校验这个 key。
  4. 选择一个推荐团队并启动。Emperor 会为你创建每个智能体及其访问令牌和连接。
  5. 负责人智能体上线后,打开它的聊天窗口打个招呼。它会为你的公司撰写「知识与规则」(Knowledge & Rules)。

接下来,创建一个项目,添加一个预期结果清晰的任务,分配出去,然后看着它推进。

更新、停止与恢复

在安装目录中执行(默认为 ~/emperorclaw):

bash scripts/update.sh --docker      # Mac / Linux
.\scripts\update.ps1 -Docker         # Windows

# or by hand
docker compose pull
docker compose up -d

用 docker compose down 停止服务,数据会保留。切勿使用 docker compose down -v,它会删除数据卷。如果启动失败,请查看 docker compose logs --tail=100 app postgres。

如果不用 Docker 而是从源码构建,需要 Node.js 20 或更高版本,以及 PostgreSQL 16;详见 README(英文)。

让你的编程智能体来安装

更愿意把这件事交给运行在目标机器上、具备终端权限的编程智能体(Codex、Claude Code 或类似工具)?把下面这份说明粘贴给它即可。提示词保留英文原文,编程智能体可以直接理解,也便于与英文文档保持一致。

可直接粘贴的提示词安全安装 EMPERORCLAW
You are my terminal-capable infrastructure assistant. Install EmperorClaw on this machine using its official installer:
https://raw.githubusercontent.com/emperorclaw/emperorclaw/main/install.sh (Mac/Linux)
https://raw.githubusercontent.com/emperorclaw/emperorclaw/main/install.ps1 (Windows)

Work carefully and keep me informed. Follow this operating brief:

1. Inspect the operating system, CPU architecture, memory and disk, Docker and Docker Compose v2, occupied ports (3000, and 80/443 if I want a domain), and any existing ~/emperorclaw folder, containers or volumes. Do not change anything yet.
2. If an EmperorClaw installation already exists, do not reinstall over it blindly. Explain what you found and propose the documented update: bash scripts/update.sh --docker (or .\scripts\update.ps1 -Docker). Never delete a database volume, storage volume or .env file.
3. Tell me the install location, URL and any missing prerequisite. Ask before installing packages, using sudo, or changing firewall or DNS settings.
4. Download the installer, read it, then run it. If I want a public domain, ask me for it and pass --domain (or -Domain on Windows) so the installer sets up HTTPS with Caddy. Do not write your own reverse proxy or invent environment variables.
5. The installer generates the secrets in .env. Never print their values in chat, commit them or send them anywhere.
6. Verify with docker compose ps, the /api/health endpoint, recent app logs, and a request to the final URL. Confirm there are no restart loops.
7. Finish with a short report: install path, URL, container health, what I must do in the browser (sign up, then Emperor setup), and the update command. Mention anything you could not verify.

Do not claim success until the health checks pass.

需要终端权限

普通的网页聊天无法在你的服务器上安装软件。请使用运行在目标机器上、或已安全连接到目标机器的编程智能体,并在批准任何需要特权的操作之前先审阅。

生产环境检查清单

  • 使用 --domain,确保应用只能通过 HTTPS 访问。
  • 定期备份数据库(scripts/backup-db.sh 或 scripts\backup-db.ps1),连同已存储的文件一起备份,并安全地备份 .env。
  • 通过邀请添加团队成员,并为每个人分配满足需要的最小角色。
  • 更新前先阅读版本发布说明。
  • 不仅要做备份,还要实际演练恢复。
返回文档首页下一篇存储与 Google Drive →