Home
Categories
WIKI
Topic
User
LANGUAGE:
中文
English
[ Content contribution]
Debian 13容器方式安装OpenClaw的详细步骤
Technology Exchange
573
views ·
2
replies ·
To
floor
Go
remyxo
deepin
11 hours ago
Author
自己安装时记录的笔记,安装环境为Debian 13.3,docker版本29.3.0,openclaw版本2026.3.8(当前最新)。
1、创建存放docker compose配置文件的目录,我放在~/docker-compose下面:
mkdir -p ~/docker-compose/openclaw
cd ~/docker-compose/openclaw # 后续所有docker compose命令都要在docker-compose.yml所在目录执行。
2、下载配置文件
wget https://raw.githubusercontent.com/openclaw/openclaw/main/docker-compose.yml
wget https://raw.githubusercontent.com/openclaw/openclaw/main/.env.example
3、复制.env.example为.env
cp .env.example.yml .env
4、修改配置.env文件:
OPENCLAW_IMAGE=ghcr.io/openclaw/openclaw:latest
OPENCLAW_CONFIG_DIR=~/.openclaw
OPENCLAW_WORKSPACE_DIR=~/.openclaw/workspace
OPENCLAW_GATEWAY_BIND=lan # 坑,如果是loopback,gateway起不来,可能还有其他需要设置,未研究透。
OPENCLAW_GATEWAY_PORT=127.0.0.1:18789
# 安全考虑,只允许本机访问18789端口!
OPENCLAW_GATEWAY_TOKEN=very-long-hex-string # 运行openssl rand -hex 32 来获得随机串
5、修改docker-compose.yml文件,增加dns配置【遇到的坑!避免安装插件时失败】
# 与volume, ports对齐
dns:
- 114.114.114.114 # 国内通用DNS
- 223.5.5.5 # 阿里DNS
6、创建好映射的目录,workspace也要提前创建好,否则属主默认是root,openclaw无法写入!
mkdir -p ~/.openclaw/workspace # 确保owner是$USER
7、进入 OpenClaw 的交互式安装向导。我们通过附加 --env-file .env 来确保容器能读到刚才配置的变量
docker compose --env-file .env run --rm openclaw-cli onboard
# 配置模型和API KEY:(以DeepSeek为例)
Provider选择Custom (OpenAI Compatible)。
API Key:【填入你在 DeepSeek 开放平台 创建的 API Key。】
Base URL:填入 https://api.deepseek.com/v1
Model ID:deepseek-chat,或者 deepseek-reasoner
其他配置:skip now。
如果出现模型verification failed,大概率是网管的bind模式不对(可能是bind=lan变量没有传进容器):
修改~/.openclaw/openclaw.json,找到"bind": "loopback", 修改为:"bind": "lan"
docker-compose down # 删除容器
docker compose --env-file .env run --rm openclaw-cli onboard
# 再次启动安装向导。
8、启动 Gateway 网关服务
docker compose --env-file .env up -d openclaw-gateway
此时http://127.0.0.1:18789应该可以访问了。如果http://127.0.0.1:18789无法访问,可能是bind变量没有传进容器:
修改~/.openclaw/openclaw.json,找到"bind": "loopback", 修改为:"bind": "lan"
重启网关服务:
docker-compose exec openclaw-gateway /bin/bash
# 进入容器,后面openclaw开头的命令均在容器里执行。
openclaw gateway restart
9、访问控制面板:打开浏览器,访问 http://127.0.0.1:18789/
概览那里输入Token;
提示设备需要Pair(配对):
docker-compose exec openclaw-gateway /bin/bash # 进入容器
openclaw devices list
# 有一个Pending的device,记住左侧RequestID:xxxx-xxxx
openclaw devices approve xxxx-xxxx
openclaw devices list
# 设备已经是Paired状态了。
10、修改配置
docker-compose exec openclaw-gateway /bin/bash
openclaw configure
openclaw gateway restart
11、添加聊天渠道:
docker compose run --rm openclaw-cli channels xxx 来给应用增加 Slack,Discord 或 Telegram 的聊天渠道接入。
也可通过openclaw configure向导来设置。
12、添加QQ渠道(官方提供):
OpenClaw原生接入流程:
1.安装OpenClaw开源社区QQBot插件
openclaw plugins install @sliverp/qqbot@latest # 坑!如果没有配置dns,无法解析域名,会失败
2.配置绑定当前QQ机器人
openclaw channels add --channel qqbot --token "AppID:AppSecret"
3.重启本地OpenClaw服务
openclaw gateway restart
Reply
Like 0
Favorite
View the author
All Replies
raspbian
deepin
9 hours ago
#1
你确定这不是AI通过幻觉写出来的教程?
Reply
Like 0
View the author
remyxo
deepin
9 hours ago
#2
raspbian
:
你确定这不是AI通过幻觉写出来的教程?
一字一句自己码出来的,如假包换。
Reply
Like 0
View the author
Please
sign
in first
Featured Collection
Change
UOS AI 2.8 Released! Three New Intelligent Agents & Major Evolution
Solid Q&A | deepin 25 Common Questions – The Immutable System Edition
New Thread
Popular Ranking
Change
What is "Switch between desktops" keyboard shortcut?
Dive into the Addictive World of Drift Hunters!
Popular Events
More