基于Docker安装OpenClaw 本地 AI 助手教程
一、 环境要求
组件 | 最低要求 | 推荐配置 |
|---|---|---|
操作系统 | Linux (Ubuntu 20.04+), macOS 12+, Windows 10+ (WSL2) | Ubuntu 22.04 LTS |
Docker | Docker Engine 20.10+ | Docker Compose v2.0+ |
内存 | 2 GB | 4 GB+ |
存储 | 5 GB | 10 GB+ |
二、 核心步骤:拉取国内镜像
由于镜像在国内网络环境下拉取困难,我们直接通过离线下载的方式。
1. 拉取镜像
镜像下载地址,下载完成后在终端执行以下命令,将镜像拉取到本地
我用夸克网盘给你分享了「openclaw」,点击链接或复制整段内容,打开「夸克网盘APP」即可获取。
/~48b93M1xLP~:/
链接:https://pan.quark.cn/s/0b9b526fa98d
docker load --input openclaw.tar2. 查看镜像是否下载成功
docker images -a

三、 启动 OpenClaw Gateway 服务
镜像拉取成功后,使用以下命令启动服务。注意:镜像标签较长,建议使用 docker images查看镜像 ID 后使用 ID 启动,或使用以下完整命令。
使用 Docker Run 启动
docker run -d \ --name openclaw \ -p 18789:18789 \ --user root \ -e OPENCLAW_GATEWAY_TOKEN=testtoken \ telecom-eci-huadong1-crs-registry.crs-huadong1.ctyun.cn/base_image/openclaw:2026-01-30 \ openclaw gateway run或者使用 Docker Compose (推荐)
创建 docker-compose.yml文件:
version: '3.8' services: openclaw: image: telecom-eci-huadong1-crs-registry.crs-huadong1.ctyun.cn/base_image/openclaw:2026-01-30 container_name: openclaw ports: - "18789:18789" environment: - OPENCLAW_GATEWAY_TOKEN=your_custom_token_here command: openclaw gateway run restart: unless-stopped启动服务:
docker-compose up -d四、 验证与访问
- 查看容器状态:
docker logs -f openclaw - 访问 Web UI:浏览器打开
http://你的服务器IP:18789?token=testtoken - 输入 Token:在登录界面输入
docker-compose.yml中设置的OPENCLAW_GATEWAY_TOKEN值(如未设置,查看启动日志获取随机生成的 Token)。

五、 修改配置
首次登录后,需在 Web UI 或通过命令行配置 AI 模型 API Key(如 OpenAI、Claude 或国内通义千问、DeepSeek 等),OpenClaw 才能正常进行推理和对话。
这里直接贴出修改的json文件
{ "meta": { "lastTouchedVersion": "2026.1.29", "lastTouchedAt": "2026-03-01T16:53:34.972Z" }, "wizard": { "lastRunAt": "2026-03-01T16:53:34.961Z", "lastRunVersion": "2026.1.29", "lastRunCommand": "onboard", "lastRunMode": "local" }, "browser": { "enabled": true, "executablePath": "/usr/bin/chromium", "headless": true, "noSandbox": true }, "models": { "providers": { "deepseek": { "baseUrl": "https://api.siliconflow.cn/v1", "apiKey": "sk-xxxxxx", "api": "openai-completions", "models": [ { "id": "deepseek-ai/DeepSeek-R1-Distill-Qwen-7B", "name": "deepseek-ai/DeepSeek-R1-Distill-Qwen-7B", "reasoning": false, "input": [ "text" ], "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 32768, "maxTokens": 32768 }, { "id": "Pro/MiniMaxAI/MiniMax-M2.5", "name": "Pro/MiniMaxAI/MiniMax-M2.5", "reasoning": false, "input": [ "text" ], "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 200000, "maxTokens": 8192 }, { "id": "deepseek-ai/DeepSeek-V3.2", "name": "deepseek-ai/DeepSeek-V3.2", "reasoning": false, "input": [ "text" ], "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 200000, "maxTokens": 8192 } ] }, "minimax": { "baseUrl": "https://api.minimaxi.com/v1", "apiKey": "sk-xxxxx", "api": "openai-completions", "models": [ { "id": "MiniMax-M2.5", "name": "MiniMax M2.5", "reasoning": false, "input": [ "text" ], "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 200000, "maxTokens": 8192 }, { "id": "MiniMax-M2.5-highspeed", "name": "MiniMax M2.5 Highspeed", "reasoning": false, "input": [ "text" ], "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 200000, "maxTokens": 8192 }, { "id": "MiniMax-M2.1", "name": "MiniMax M2.1", "reasoning": false, "input": [ "text" ], "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 200000, "maxTokens": 8192 }, { "id": "MiniMax-M2.1-highspeed", "name": "MiniMax M2.1 Highspeed", "reasoning": false, "input": [ "text" ], "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 200000, "maxTokens": 8192 }, { "id": "MiniMax-M2", "name": "MiniMax M2", "reasoning": false, "input": [ "text" ], "cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 }, "contextWindow": 200000, "maxTokens": 8192 } ] } } }, "agents": { "defaults": { "model": { "primary": "deepseek/deepseek-ai/DeepSeek-V3.2" }, "workspace": "/home/node/.openclaw/workspace", "compaction": { "mode": "default" }, "heartbeat": { "model": "minimax/MiniMax-M2.5" }, "maxConcurrent": 4, "subagents": { "maxConcurrent": 8 } } }, "messages": { "ackReactionScope": "group-mentions" }, "commands": { "native": "auto", "nativeSkills": "auto" }, "gateway": { "port": 28789, "mode": "local", "bind": "loopback", "controlUi": { "allowInsecureAuth": true }, "auth": { "mode": "token", "token": "xxxxx" }, "tailscale": { "mode": "off", "resetOnExit": false } }, "skills": { "install": { "nodeManager": "npm" } } } 
以上就是所有内容啦,关注下方微信公众号输入“openclaw”免费体验~token有限,先到先得~