【搭建OpenClaw】

一、安装Node.js(必须≥22.x)

OpenClaw要求Node.js版本≥22.x,Ubuntu默认源版本较低,需手动安装:

方法

less 复制代码
# 验证版本
node -v  # 应显示v22.x.x[11](@ref)

二、安装OpenClaw的方式

方式一:npm/pnpm全局安装

less 复制代码
# npm安装
npm install -g openclaw@latest

# 或使用pnpm(性能更优)
npm install -g pnpm
pnpm add -g openclaw@latest[5,9,10](@ref)

方式二:Docker部署(适合服务器/生产环境)

bash 复制代码
# 安装Docker
curl -fsSL https://get.docker.com | bash
sudo systemctl start docker
sudo systemctl enable docker

# 一键Docker部署
curl -fsSL https://cdn.jsdelivr.net/gh/1186258278/OpenClawChineseTranslation@main/docker-deploy.sh | bash[5](@ref)

三、初始化配置

安装完成后,运行初始化向导完成基础配置:

less 复制代码
openclaw onboard --install-daemon[9,11](@ref)

配置向导会引导完成以下步骤:

  1. 安全确认:输入Y确认授权
  2. 选择模式:推荐QuickStart(快速启动)
  3. 配置AI模型:选择模型提供商并输入API Key
  4. 设置渠道:可先跳过(后续再配置)
  5. 技能配置:选择Yes启用基础技能

四、配置文件刷新

刷新配置文件,关键是主model别忘记刷新:

json 复制代码
"model": {
        "primary": "codez/gpt-5.3-codex"
      },

具体配置如下:

csharp 复制代码
[root@OS .openclaw]# more openclaw.json
{
  "meta": {
    "lastTouchedVersion": "2026.2.9",
    "lastTouchedAt": "2026-02-19T00:37:21.820Z"
  },
  "wizard": {
    "lastRunAt": "2026-02-19T00:34:13.156Z",
    "lastRunVersion": "2026.2.9",
    "lastRunCommand": "onboard",
    "lastRunMode": "local"
  },
  "models": {
    "mode": "merge",
    "providers": {
      "codez": {
        "baseUrl": "你的URL",
        "apiKey": "你的key",
        "api": "openai-completions",
        "models": [
          {
            "id": "gpt-5.3-codex",
            "name": "gpt-5.3-codex",
            "reasoning": false,
            "input": [
              "text"
            ],
            "cost": {
              "input": 0,
              "output": 0,
              "cacheRead": 0,
              "cacheWrite": 0
            },
            "contextWindow": 200000,
            "maxTokens": 8192,
            "compat": {
              "supportsStore": false
            }
          }
        ]
      }
    }
  },
  "agents": {
    "defaults": {
      "model": {
        "primary": "codez/gpt-5.3-codex"
      },
      "workspace": "/root/.openclaw/workspace",
      "compaction": {
        "mode": "safeguard"
      },
      "maxConcurrent": 4,
      "subagents": {
        "maxConcurrent": 8
      }
    }
  },
  "messages": {
    "ackReactionScope": "group-mentions"
  },
  "commands": {
    "native": "auto",
    "nativeSkills": "auto"
  },
  "channels": {
    "feishu": {
      "enabled": true,
      "appId": "cli_a9xxxxxxxx",
      "appSecret": "5fZvLoxxxxxxxxx",
      "domain": "feishu",
      "groupPolicy": "open"
    },
    "timbot": {
      "enabled": true,
      "webhookPath": "/timbot",
      "sdkAppId": "1600xxxxx",
      "botAccount": "@RBxxxxx",
      "token": "xiaxxxxxxx",
      "secretKey": "2b489exxxxxxxxxxxxxxxxxxxxxxxx",
      "dm": {
        "policy": "open"
      }
    }
  },
  "gateway": {
    "port": 18789,
    "mode": "local",
    "bind": "lan",
    "controlUi": {
      "allowInsecureAuth": false
    },
    "auth": {
      "mode": "token",
      "token": "61c689d8bda509xxxxxxxxxxxx5"
    },
    "tailscale": {
      "mode": "off",
      "resetOnExit": false
    }
  },
  "skills": {
    "install": {
      "nodeManager": "npm"
    }
  },
  "plugins": {
    "entries": {
      "feishu": {
        "enabled": true
      },
      "qqbot": {
        "enabled": true
      },
      "ddingtalk": {
        "enabled": true
      },
      "wecom": {
        "enabled": true
      },
      "adp-openclaw": {
        "enabled": true
      },
      "timbot": {
        "enabled": true
      }
    },
    "installs": {
      "qqbot": {
        "source": "npm",
        "spec": "@sliverp/qqbot@latest",
        "installPath": "/root/.openclaw/extensions/qqbot",
        "version": "1.4.4",
        "installedAt": "2026-02-11T09:48:41.090Z"
      },
      "ddingtalk": {
        "source": "npm",
        "spec": "git+https://cnb.cool/lighthouse/lighthousebackend/openclaw-dingtalk.git",
        "installPath": "/root/.openclaw/extensions/ddingtalk",
        "version": "1.2.0",
        "installedAt": "2026-02-11T09:49:01.618Z"
      },
      "wecom": {
        "source": "npm",
        "spec": "git+https://cnb.cool/lighthouse/lighthousebackend/openclaw-wecom.git",
        "installPath": "/root/.openclaw/extensions/wecom",
        "version": "2026.2.5",
        "installedAt": "2026-02-11T09:49:25.555Z"
      },
      "adp-openclaw": {
        "source": "npm",
        "spec": "adp-openclaw",
        "installPath": "/root/.openclaw/extensions/adp-openclaw",
        "version": "0.0.24",
        "installedAt": "2026-02-11T09:49:33.241Z"
      },
      "timbot": {
        "source": "npm",
        "spec": "timbot",
        "installPath": "/root/.openclaw/extensions/timbot",
        "version": "2026.2.11",
        "installedAt": "2026-02-19T00:13:48.063Z"
      }
    }
  }
}

五、验证安装与启动

验证安装

less 复制代码
# 查看版本
openclaw --version

# 环境自检
openclaw doctor[9](@ref)

启动服务

less 复制代码
# 后台启动网关(推荐)
openclaw gateway start

# 前台运行(调试用)
openclaw gateway run --verbose[9,11](@ref)

访问控制台

启动后可通过浏览器访问管理控制台:

相关推荐
LoserChaser几秒前
OpenClaw 指令大全:分类详解与使用指南
人工智能·ai·语言模型
TDengine (老段)1 分钟前
TDengine IDMP 可视化 —— 面板
大数据·数据库·人工智能·物联网·ai·时序数据库·tdengine
大模型任我行14 分钟前
英伟达:解耦训练与推演的服务架构
人工智能·语言模型·自然语言处理·论文笔记
newsxun15 分钟前
中创汇联双城峰会圆满举办 多维赋能实体高质量发展
大数据·人工智能
人工智能AI技术15 分钟前
Karpathy开源第二大脑方案,有望替代向量数据库,让AI永不失忆
人工智能
之歆29 分钟前
打造你的 AI 浏览器助手:从零到一的完整实践
人工智能
小陈工32 分钟前
Python Web开发入门(十一):RESTful API设计原则与最佳实践——让你的API既优雅又好用
开发语言·前端·人工智能·后端·python·安全·restful
humors22137 分钟前
AI工具合集,不定期更新
人工智能·windows·ai·工具·powershell·deepseek
做个文艺程序员40 分钟前
2026 年开源大模型选型指南:Qwen3.5 / DeepSeek V3.2 / Llama 4 横向对比
人工智能·开源·llama
LabVIEW开发43 分钟前
LabVIEW控制阀性能测试评估系统
人工智能·labview·labview知识·labview功能·labview程序