windows中docker配置openclaw并连接飞书
OpenClaw 完整安装教程(2026最新版,全平台通用)config选模型,复制连接注册,跟阿里文档走就行。添加port,修改bind。
配置docker
拉取docker镜像:docker pull ubuntu
创建docker容器并进入:docker run -it --name openclaw ubuntu:latest /bin/bash
更改下载源,地址:
cd etc/apt/sources.list
cat > /etc/apt/sources.list << EOF
deb http://mirrors.aliyun.com/ubuntu/ $(lsb_release -cs) main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ $(lsb_release -cs) main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ $(lsb_release -cs)-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ $(lsb_release -cs)-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ $(lsb_release -cs)-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ $(lsb_release -cs)-backports main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ $(lsb_release -cs)-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ $(lsb_release -cs)-security main restricted universe multiverse
EOF
安装curl:apt install curl
也可用如下dockerfile创建容器:
# 基础镜像(建议指定 ubuntu:20.04 匹配 focal 源,避免版本不一致)
FROM ubuntu:20.04
# 避免交互模式下的时区等问题(可选但推荐)
ENV DEBIAN_FRONTEND=noninteractive
# 更换为指定的阿里云 focal 源
RUN cp /etc/apt/sources.list /etc/apt/sources.list.bak && \
# 清空原有内容并写入新源
cat > /etc/apt/sources.list << EOF
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
EOF && \
# 更新源(添加 -y 避免交互提示)
apt update -y && \
# 安装常用工具
apt install -y vim wget curl && \
# 清理缓存(减小镜像体积)
apt clean && \
rm -rf /var/lib/apt/lists/*
# 恢复交互模式(可选)
ENV DEBIAN_FRONTEND=dialog
# 容器启动时进入bash
CMD ["/bin/bash"]
更换下载源:
deb http://mirrors.aliyun.com/ubuntu/ focal main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ focal-backports main restricted universe multiverse
用如下dockerfile:
FROM ubuntu:24.04 # 匹配 24.04 版本
ENV DEBIAN_FRONTEND=noninteractive
# 更换为 24.04(noble) 阿里云源
RUN cp /etc/apt/sources.list /etc/apt/sources.list.bak && \
cat > /etc/apt/sources.list << EOF
deb http://mirrors.aliyun.com/ubuntu/ noble main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ noble-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ noble-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ noble-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ noble-backports main restricted universe multiverse
EOF && \
apt update -y && \
apt install -y vim wget curl && \
apt clean && \
rm -rf /var/lib/apt/lists/*
ENV DEBIAN_FRONTEND=dialog
CMD ["/bin/bash"]
一键安装openclaw
curl -fsSL https://openclaw.ai/install.sh | bash1
选项选择
【OpenClaw保姆级教程】最新版小龙虾OpenClaw完整安装教学,一个视频搞懂OpenClaw本地部署/接入微信/飞书/钉钉(附完整操作文档)
更改配置文件
root/.openclaw/openclaw.json
添加port,修改bind
"gateway": {
"port": 18789,
"mode": "local",
"bind": "lan",
"controlUi": {
"enabled": true,
"allowInsecureAuth": true
},
"auth": {
"mode": "token",
"token": "1876cbd181533358223674dab4841f60c252f62c206a53f9"
},
"tailscale": {
"mode": "off",
"resetOnExit": false
}
}
gateway设置:
"gateway": {
"port": 18789,
"mode": "local",
"bind": "lan",
"controlUi": {
"allowedOrigins": [
"http://127.0.0.1:18789",
"http://宿主机地址:18789"
]
},
"auth": {
"mode": "token",
"token": ""
}
}
docker操作
创建容器(一定要端口映射):docker run -d -p 18789:18789 --name openclaw openclaw_image:v1 tail -f /dev/null
进入容器:docker exec -it openclaw bash
容器备份docker commit openclaw openclaw_image:v1
挂载启动openclaw gateway:openclaw gateway start或者openclaw gateway intall
报错解决
pairing required
控制 UI 令牌 + 配对(Docker)
如果你看到”unauthorized”或”disconnected (1008): pairing required”,获取新的仪表板链接并批准浏览器设备:
docker compose run --rm openclaw-cli dashboard --no-open
docker compose run --rm openclaw-cli devices list
docker compose run --rm openclaw-cli devices approve < requestId >
# 1. 先切换到项目根目录(替换为你实际的项目路径,比如 /root/openclaw,得用linux命令找一下)
cd /你的/openclaw/项目根目录
# 2. 执行设备列表命令(已替换你的 Token)
node /usr/lib/node_modules/openclaw/dist/index.js devices list --token 个人token --url ws://127.0.0.1:18789
# 3. 执行设备授权命令
node /usr/lib/node_modules/openclaw/dist/index.js devices approve 327dc0b1-c82d-4ebf-9448-9a0a2b9a31ef --token 个人token --url ws://127.0.0.1:18789
其他
查看日志:openclaw logs --follow
设备配对: openclaw pairing approve devices_code
模型配置
千问
config选模型,复制连接注册,跟阿里文档走就行
{
"models": {
"mode": "merge",
"providers": {
"bailian": {
"baseUrl": "https://coding.dashscope.aliyuncs.com/v1",
"apiKey": "YOUR_API_KEY",
"api": "openai-completions",
"models": [
{
"id": "qwen3.5-plus",
"name": "qwen3.5-plus",
"reasoning": false,
"input": ["text", "image"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 1000000,
"maxTokens": 65536,
"compat": {
"thinkingFormat": "qwen"
}
},
{
"id": "qwen3-max-2026-01-23",
"name": "qwen3-max-2026-01-23",
"reasoning": false,
"input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 262144,
"maxTokens": 65536,
"compat": {
"thinkingFormat": "qwen"
}
},
{
"id": "qwen3-coder-next",
"name": "qwen3-coder-next",
"reasoning": false,
"input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 262144,
"maxTokens": 65536
},
{
"id": "qwen3-coder-plus",
"name": "qwen3-coder-plus",
"reasoning": false,
"input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 1000000,
"maxTokens": 65536
},
{
"id": "MiniMax-M2.5",
"name": "MiniMax-M2.5",
"reasoning": false,
"input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 196608,
"maxTokens": 32768
},
{
"id": "glm-5",
"name": "glm-5",
"reasoning": false,
"input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 202752,
"maxTokens": 16384,
"compat": {
"thinkingFormat": "qwen"
}
},
{
"id": "glm-4.7",
"name": "glm-4.7",
"reasoning": false,
"input": ["text"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 202752,
"maxTokens": 16384,
"compat": {
"thinkingFormat": "qwen"
}
},
{
"id": "kimi-k2.5",
"name": "kimi-k2.5",
"reasoning": false,
"input": ["text", "image"],
"cost": { "input": 0, "output": 0, "cacheRead": 0, "cacheWrite": 0 },
"contextWindow": 262144,
"maxTokens": 32768,
"compat": {
"thinkingFormat": "qwen"
}
}
]
}
}
},
"agents": {
"defaults": {
"model": {
"primary": "bailian/qwen3.5-plus"
},
"models": {
"bailian/qwen3.5-plus": {},
"bailian/qwen3-max-2026-01-23": {},
"bailian/qwen3-coder-next": {},
"bailian/qwen3-coder-plus": {},
"bailian/MiniMax-M2.5": {},
"bailian/glm-5": {},
"bailian/glm-4.7": {},
"bailian/kimi-k2.5": {}
}
}
},
"gateway": {
"mode": "local"
}
}
deepseek
{
"meta": {
"lastTouchedVersion": "2026.3.13",
"lastTouchedAt": "2026-03-17T17:28:54.070Z"
},
"models": {
"mode": "merge",
"providers": {
"deepseek": {
"baseUrl": "https://api.deepseek.com/v1",
"apiKey": "个人秘钥",
"api": "openai-completions",
"models": [
{
"id": "deepseek-chat",
"name": "DeepSeek Chat (V3)"
},
{
"id": "deepseek-reasoner",
"name": "DeepSeek Reasoner (R1)"
}
]
}
}
},
"commands": {
"native": "auto",
"nativeSkills": "auto",
"restart": true,
"ownerDisplay": "raw"
},
"gateway": {
"port": 18789,
"mode": "local",
"bind": "lan",
"controlUi": {
"allowedOrigins": [
"http://127.0.0.1:18789",
"http://宿主机ip:18789"
]
},
"auth": {
"mode": "token",
"token": "系统token"
}
}
}
飞书配置
OpenClaw: access not configured. Your Feishu user id: ou_6fec4ca0cdfecb5baaff4a6a78aa7ac0 Pairing code: XZLfgB9 Ask the bot owner to approve with: openclaw pairing approve feishu XXZLfgB9 OpenClaw: access not configured. Your Feishu user id: ou_6fec4ca0cdfecb5baaff4a6a78aa7ac0 Pairing code: XZLfgB9 Ask the bot owner to approve with: openclaw pairing approve feishu XZLfgB9
openclaw pairing approve feishu 身份码openclaw pairing list
看到你的 Feishu 用户变成 approved,然后你再在飞书里发消息,就能正常用了。
Reference
OpenClaw 完整安装教程(2026最新版,全平台通用)
OpenClaw保姆级教程】最新版小龙虾OpenClaw完整安装教学,一个视频搞懂OpenClaw本地部署/接入微信/飞书/钉钉(附完整操作文档)
用Docker部署OpenClaw,一分钟搞定
openclaw官方docker配置文档
-
OpenClaw 完整安装教程(2026最新版,全平台通用) ↩︎
更多推荐



所有评论(0)