OpenClaw Setup
Deploy OpenClaw on Linux, enable DingTalk, Feishu, Discord, or other documented channels, and verify gateway health.
Use This Workflow
Run this sequence in order:
- 1. Prepare Linux runtime and install OpenClaw.
- Discover channels from official docs (required for new channel requests).
- Install and verify channel integrations.
- Create/merge
~/.openclaw/openclaw.json. - Configure and start gateway service.
- Run health checks and collect logs.
Prerequisites
- - SSH access to target Linux host (Debian/Ubuntu preferred).
- DingTalk enterprise app credentials (
AppKey, AppSecret) for the official connector, or Feishu app credentials (App ID, App Secret), or Discord bot token. - DashScope API key.
Step 1: Prepare Runtime
CODEBLOCK0
Step 2: Install OpenClaw and Channel Integrations
CODEBLOCK1
If upgrading from old DingTalk plugins, uninstall legacy plugin IDs first and keep only the official connector in plugins.allow.
Step 3: Auto-Discover Additional Channels from Official Docs
When user asks for any extra channel beyond current setup, do this first:
- 1. Open
https://docs.openclaw.ai/channels/index. - Identify requested channel pages from the "Supported channels" list.
- Open each channel page and extract:
- Whether it is built-in or plugin-based.
- Exact install command (do not guess package names).
- Required credentials/tokens and config keys.
- 4. Apply installation/configuration on host.
- Record channel-specific notes into
~/.openclaw/openclaw.json.
Use the exact workflow in references/channel-discovery.md.
Step 4: Configure openclaw.json
Create or update ~/.openclaw/openclaw.json with:
- -
models.providers.bailian for DashScope endpoint and models. - INLINECODE11 in
provider/model format, default to bailian/glm-5. - INLINECODE14 ordered as:
1)
qwen3-plus
2)
glm-5
3)
minimax-m2.5
4)
kimi-k2.5
- -
agents.defaults.model.fallbacks ordered as:
1)
bailian/qwen3-plus
2)
bailian/minimax-m2.5
3)
bailian/kimi-k2.5
- -
channels.dingtalk-connector, channels.feishu, or channels.discord credentials and policy. - INLINECODE26 including installed channel plugins.
Important:
- - Agent-level model config at
~/.openclaw/agents/main/agent/models.json can override ~/.openclaw/openclaw.json. - Keep provider definitions aligned in both files when defaults appear not to take effect.
- Protocol must match endpoint:
-
api: openai-completions -> use
https://dashscope.aliyuncs.com/compatible-mode/v1
-
api: openai-responses -> use INLINECODE32
Use the full template in references/config.md.
Use DingTalk field mapping in references/dingtalk-setup.md.
Use Feishu setup and field mapping in references/feishu-setup.md.
Use Discord setup and field mapping in references/discord-setup.md.
Use channel discovery workflow in references/channel-discovery.md.
Step 5: Install and Start Gateway
CODEBLOCK2
If running with user-level systemd, reload after config changes:
CODEBLOCK3
Step 6: Verify and Troubleshoot
CODEBLOCK4
Common failures:
- - Plugin not loaded: re-run plugin install and check
plugins.allow. - Unknown model: check
agents.defaults.model.primary format (provider/model-id). - API key error: verify
models.providers.bailian.apiKey and DASHSCOPE_API_KEY imported in systemd. - Config changed but runtime model unchanged: check and update
~/.openclaw/agents/main/agent/models.json. - Empty payload / unexpected fallback: verify protocol-endpoint pair (
openai-completions vs openai-responses) and clear stale session if needed. - DingTalk no response: use
openclaw logs --follow and check gateway/channels/dingtalk-connector lines for stream reconnect or credential issues. - Official connector installed but old probes inconsistent: rely on runtime logs and real message send/receive as source of truth.
- Feishu no response: check event subscription mode is WebSocket and gateway is running.
- Discord no response: verify bot intents, token, and first-DM pairing approval.
Security Notes
- - Do not hardcode real secrets in repository files.
- Keep production keys in server-local configs or secret managers.
- Redact logs before sharing in tickets or chat.
Validation
CODEBLOCK5
Pass criteria: command exits 0 and output/aliyun-openclaw-setup/validate.txt is generated.
Output And Evidence
- - Save artifacts, command outputs, and API response summaries under
output/aliyun-openclaw-setup/. - Include key parameters (region/resource id/time range) in evidence files for reproducibility.
Workflow
1) Confirm user intent, region, identifiers, and whether the operation is read-only or mutating.
2) Run one minimal read-only query first to verify connectivity and permissions.
3) Execute the target operation with explicit parameters and bounded scope.
4) Verify results and save output/evidence files.
OpenClaw 设置
在 Linux 上部署 OpenClaw,启用钉钉、飞书、Discord 或其他已记录的渠道,并验证网关健康状态。
使用此工作流程
按顺序执行以下步骤:
- 1. 准备 Linux 运行环境并安装 OpenClaw。
- 从官方文档中发现渠道(新渠道请求必需)。
- 安装并验证渠道集成。
- 创建/合并 ~/.openclaw/openclaw.json。
- 配置并启动网关服务。
- 运行健康检查并收集日志。
前提条件
- - 能够通过 SSH 访问目标 Linux 主机(推荐 Debian/Ubuntu)。
- 钉钉企业应用凭证(AppKey、AppSecret)用于官方连接器,或飞书应用凭证(App ID、App Secret),或 Discord 机器人令牌。
- DashScope API 密钥。
步骤 1:准备运行环境
bash
ssh root@<服务器>
curl -fsSL https://deb.nodesource.com/setup_20.x | bash -
apt-get install -y nodejs
node --version
npm --version
步骤 2:安装 OpenClaw 和渠道集成
bash
npm install -g openclaw@latest
openclaw --version
钉钉官方连接器
openclaw plugins install @dingtalk-real-ai/dingtalk-connector --pin
或从官方 GitHub 仓库安装
openclaw plugins install https://github.com/DingTalk-Real-AI/dingtalk-openclaw-connector.git
openclaw plugins list | grep dingtalk
飞书渠道
openclaw plugins install @openclaw/feishu
openclaw plugins list | grep feishu
Discord 渠道(内置,无需额外插件)
在步骤 3 中配置令牌,在步骤 4 中启动网关
如果从旧的钉钉插件升级,请先卸载旧版插件 ID,并仅在 plugins.allow 中保留官方连接器。
步骤 3:从官方文档自动发现其他渠道
当用户请求当前设置之外的任何额外渠道时,请先执行以下操作:
- 1. 打开 https://docs.openclaw.ai/channels/index。
- 从“支持的渠道”列表中识别请求的渠道页面。
- 打开每个渠道页面并提取:
- 该渠道是内置的还是基于插件的。
- 确切的安装命令(不要猜测包名)。
- 所需的凭证/令牌和配置键。
- 4. 在主机上应用安装/配置。
- 将渠道特定的注释记录到 ~/.openclaw/openclaw.json 中。
使用 references/channel-discovery.md 中的确切工作流程。
步骤 4:配置 openclaw.json
创建或更新 ~/.openclaw/openclaw.json,包含:
- - models.providers.bailian 用于 DashScope 端点和模型。
- agents.defaults.model.primary 采用 provider/model 格式,默认为 bailian/glm-5。
- models.providers.bailian.models 按以下顺序排列:
1) qwen3-plus
2) glm-5
3) minimax-m2.5
4) kimi-k2.5
- - agents.defaults.model.fallbacks 按以下顺序排列:
1) bailian/qwen3-plus
2) bailian/minimax-m2.5
3) bailian/kimi-k2.5
- - channels.dingtalk-connector、channels.feishu 或 channels.discord 的凭证和策略。
- plugins.allow 包含已安装的渠道插件。
重要提示:
- - ~/.openclaw/agents/main/agent/models.json 中的代理级模型配置可以覆盖 ~/.openclaw/openclaw.json。
- 当默认值似乎未生效时,请确保两个文件中的提供商定义保持一致。
- 协议必须与端点匹配:
- api: openai-completions -> 使用 https://dashscope.aliyuncs.com/compatible-mode/v1
- api: openai-responses -> 使用 https://dashscope.aliyuncs.com/api/v2/apps/protocols/compatible-mode/v1
使用 references/config.md 中的完整模板。
使用 references/dingtalk-setup.md 中的钉钉字段映射。
使用 references/feishu-setup.md 中的飞书设置和字段映射。
使用 references/discord-setup.md 中的 Discord 设置和字段映射。
使用 references/channel-discovery.md 中的渠道发现工作流程。
步骤 5:安装并启动网关
bash
openclaw gateway install
openclaw gateway start
openclaw gateway status
如果使用用户级 systemd 运行,则在配置更改后重新加载:
bash
systemctl --user import-environment DASHSCOPEAPIKEY
systemctl --user daemon-reload
systemctl --user restart openclaw-gateway
步骤 6:验证和故障排除
bash
openclaw doctor
openclaw gateway status
openclaw gateway logs -f
常见故障:
- - 插件未加载:重新运行插件安装并检查 plugins.allow。
- 未知模型:检查 agents.defaults.model.primary 的格式(provider/model-id)。
- API 密钥错误:验证 models.providers.bailian.apiKey 和已在 systemd 中导入的 DASHSCOPEAPIKEY。
- 配置已更改但运行时模型未更新:检查并更新 ~/.openclaw/agents/main/agent/models.json。
- 空负载/意外回退:验证协议-端点对(openai-completions 与 openai-responses),并在必要时清除过期会话。
- 钉钉无响应:使用 openclaw logs --follow 并检查 gateway/channels/dingtalk-connector 行,查找流重连或凭证问题。
- 官方连接器已安装但旧探针不一致:以运行时日志和实际消息发送/接收为准。
- 飞书无响应:检查事件订阅模式是否为 WebSocket 且网关正在运行。
- Discord 无响应:验证机器人意图、令牌以及首次私信配对批准。
安全说明
- - 不要在仓库文件中硬编码真实机密信息。
- 将生产密钥保存在服务器本地配置或机密管理器中。
- 在工单或聊天中分享之前,请对日志进行脱敏处理。
验证
bash
mkdir -p output/aliyun-openclaw-setup
echo validation_placeholder > output/aliyun-openclaw-setup/validate.txt
通过标准:命令退出码为 0 且 output/aliyun-openclaw-setup/validate.txt 已生成。
输出和证据
- - 将工件、命令输出和 API 响应摘要保存在 output/aliyun-openclaw-setup/ 下。
- 在证据文件中包含关键参数(区域/资源 ID/时间范围),以确保可重现性。
工作流程
1) 确认用户意图、区域、标识符以及操作是只读还是变更操作。
2) 首先运行一个最小的只读查询,以验证连接性和权限。
3) 使用显式参数和限定范围执行目标操作。
4) 验证结果并保存输出/证据文件。