用途

部署指令


# 国内用户使用 Docker Hub 镜像
IMAGE=1186258278/openclaw-zh:latest
# 海外用户使用: IMAGE=ghcr.io/1186258278/openclaw-zh:latest

# 1. 初始化(首次运行)
# Docker 需要交互式运行来配置 AI 模型和 API 密钥
docker run --rm -it -v openclaw-data:/root/.openclaw $IMAGE openclaw onboard

# 按向导完成:选择模型 → 配置 API 密钥 → 设置聊天通道

# 2. 配置网关模式
docker run --rm -v openclaw-data:/root/.openclaw $IMAGE openclaw config set gateway.mode local

# 3. 启动(守护进程模式,容器会一直运行)
docker run -d --name openclaw -p 18789:18789 \
  -v openclaw-data:/root/.openclaw --restart unless-stopped \
  $IMAGE openclaw gateway run


# 1. 初始化配置(首次运行必须)
docker run --rm -v openclaw-data:/root/.openclaw ghcr.io/1186258278/openclaw-zh:nightly openclaw setup

# 2. 设置网关模式为本地
docker run --rm -v openclaw-data:/root/.openclaw ghcr.io/1186258278/openclaw-zh:nightly openclaw config set gateway.mode local

# 3. 启动容器
docker run -d --name openclaw -p 18789:18789 -v openclaw-data:/root/.openclaw --restart unless-stopped ghcr.io/1186258278/openclaw-zh:nightly openclaw gateway run

# 访问方式:http://localhost:18789

常用命令

openclaw                    # 启动 OpenClaw
openclaw onboard            # 初始化向导
openclaw dashboard          # 打开网页控制台
openclaw config             # 查看/修改配置
openclaw skills             # 管理技能
openclaw --help             # 查看帮助

# 网关管理
openclaw gateway run        # 前台运行(挂终端,用于调试)
openclaw gateway start      # 后台守护进程(不挂终端,推荐!)
openclaw gateway stop       # 停止网关
openclaw gateway restart    # 重启网关
openclaw gateway status     # 查看网关状态
openclaw gateway install    # 安装为系统服务(开机自启)

# 常用操作
openclaw update             # 检查并更新 CLI
openclaw doctor             # 诊断问题(自动修复)

# 方式 1:使用 gateway 子命令(推荐)
openclaw gateway restart

# 方式 2:先停止再启动
openclaw gateway stop
openclaw gateway start

# 方式 3:守护进程模式(后台运行,不挂终端)
openclaw daemon start       # 启动后台守护
openclaw daemon stop        # 停止守护
openclaw daemon restart    # 重启守护
openclaw daemon status     # 查看状态

# Docker 容器重启
docker restart openclaw

修改配置文件

docker run --rm -it -v openclaw-data:/data --name temp-access-container alpine sh

docker执行命令

# 在容器内执行 OpenClaw 命令
docker exec openclaw openclaw --help
docker exec openclaw openclaw status

模型评测

https://pinchbench.com/