# openclaw-linux-installer **Repository Path**: jockerzo/openclaw-linux-installer ## Basic Information - **Project Name**: openclaw-linux-installer - **Description**: openclaw一键安装脚本 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: https://www.skyclaw.top - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-03-25 - **Last Updated**: 2026-03-27 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # OpenClaw Linux Installer OpenClaw 多通道 AI 网关 Linux/macOS 一键安装脚本 ## 📋 项目介绍 本项目提供 OpenClaw 多通道 AI 网关在 Linux/macOS 系统上的一键安装和配置脚本,支持: - ✅ 自动检测系统环境 - ✅ 自动安装 Node.js 22.x LTS - ✅ 自动安装 pnpm - ✅ 自动配置 OpenClaw 服务 - ✅ 支持飞书、钉钉等多通道集成 - ✅ 支持阿里云百炼、UCloud、Ollama 等模型提供商 ## 🚀 快速开始 ### 方式 1:使用官方安装器(推荐) ```bash # 一键安装(适合首次安装) curl -fsSL https://gitee.com/jockerzo/openclaw-linux-installer/raw/master/install-openclaw.sh | bash # 或者使用 wget wget -qO- https://gitee.com/jockerzo/openclaw-linux-installer/raw/master/install-openclaw.sh | bash ``` ### 方式 2:克隆仓库安装 ```bash # 克隆仓库 git clone https://gitee.com/jockerzo/openclaw-linux-installer.git cd openclaw-linux-installer # 执行安装脚本 chmod +x install-openclaw.sh ./install-openclaw.sh ``` ### 方式 3:使用运维脚本 ```bash # 启动服务 ./ops/start-openclaw.sh # 停止服务 ./ops/stop-openclaw.sh # 重启服务 ./ops/restart-openclaw.sh # 安装飞书插件 ./ops/install-lark-fixed.sh ``` ## 📖 分平台安装步骤 ### 1. macOS 安装 #### 步骤 1:安装 Node.js 从 [Node.js 官网](https://nodejs.org/) 下载 22.x LTS 版本安装包,按引导完成安装。 终端验证安装: ```bash node --version # 输出 v22.x.x 即为成功 npm --version # 输出对应版本号 ``` #### 步骤 2:安装 OpenClaw ```bash npm install -g openclaw@latest --registry=https://registry.npmmirror.com ``` 验证安装: ```bash openclaw --version # 输出版本号即为成功 ``` ### 2. Linux 安装 #### 步骤 1:服务器基础配置 ```bash # Ubuntu apt update && apt upgrade -y # CentOS yum update -y ``` 防火墙开放端口: ```bash # Ubuntu/Debian ufw allow 18789/tcp # CentOS/RHEL firewall-cmd --permanent --add-port=18789/tcp firewall-cmd --reload ``` #### 步骤 2:安装 Node.js 22 ```bash # 方法 1:使用官方二进制包 cd /tmp wget https://nodejs.org/dist/v22.x/node-v22.x-linux-x64.tar.xz tar -xJf node-v22.x-linux-x64.tar.xz sudo mv node-v22.x-linux-x64 /usr/local/node22 sudo ln -sf /usr/local/node22/bin/node /usr/local/bin/node sudo ln -sf /usr/local/node22/bin/npm /usr/local/bin/npm # 方法 2:使用 nvm(推荐) curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash source ~/.bashrc nvm install 22 nvm use 22 ``` #### 步骤 3:安装 OpenClaw ```bash npm install -g openclaw@latest --registry=https://registry.npmmirror.com openclaw --version # 验证 ``` ## 🔧 交互式配置向导(关键) 执行以下命令启动配置向导: ```bash openclaw onboard --install-daemon ``` ### 配置步骤 1. **安全警告确认** - 界面显示 OpenClaw 安全提示(beta 版、权限风险等) - 选择 `Yes` 继续(本地使用风险极低) 2. **初始化模式** - 选 `QuickStart`(快速开始) - 后续可通过 `openclaw configure` 修改配置 3. **现有配置处理** - 若提示「Existing config detected」 - 选 `Use existing values` 保留现有配置 4. **模型/授权服务商选择** - 对接云端模型(如阿里云百炼/Kimi/OpenAI):选对应服务商,填写真实 API Key - 对接本地模型(如 Ollama):先选任意云端模型占位,后续改配置文件 5. **API Key 提供方式** - 选 `Paste API key now` - 本地 Ollama 无需真实 Key,仅用于过验证 6. **聊天渠道配置** - 选 `Skip for now`(暂时跳过 Telegram/WhatsApp 等渠道) 7. **技能配置** - 选 `No`(跳过技能安装,后续需要再装) 8. **钩子功能配置** - 选 `Skip for now`(跳过扩展钩子,新手无需配置) ## 📁 目录结构 ``` openclaw-linux-installer/ ├── README.md # 项目说明文档 ├── README.en.md # English documentation ├── LICENSE # MIT License ├── install-openclaw.sh # 官方一键安装脚本 └── ops/ # 运维脚本目录 ├── start-openclaw.sh # 启动脚本 ├── stop-openclaw.sh # 停止脚本 ├── restart-openclaw.sh # 重启脚本 └── install-lark-fixed.sh # 飞书插件安装 ``` ## 🔑 Token 配置说明 ### 网关令牌 (Gateway Token) 网关令牌用于访问 Web Dashboard 和 API 认证。 **查看方式 1:查看 .env 文件** ```bash grep OPENCLAW_GATEWAY_TOKEN ~/.openclaw/.env ``` **查看方式 2:查看 openclaw.json** ```bash cat ~/.openclaw/openclaw.json | grep -A 2 '"token"' ``` **查看方式 3:使用命令** ```bash openclaw config show ``` ### API Key 配置 **阿里云百炼 API Key:** ```bash grep OPENCLAW_MODELSTUDIO_API_KEY ~/.openclaw/.env ``` **配置文件位置:** - `/root/.openclaw/.env` - 环境变量配置 - `/root/.openclaw/openclaw.json` - 主配置文件 - `/root/.openclaw/agents/main/agent/auth-profiles.json` - Agent 认证配置 ## 🛠️ 运维命令 ### 服务管理 ```bash # 启动服务 ./ops/start-openclaw.sh # 停止服务 ./ops/stop-openclaw.sh # 重启服务 ./ops/restart-openclaw.sh --skip-build # 查看服务状态 openclaw status # 查看健康状态 curl http://127.0.0.1:18789/health ``` ### Agent 管理 ```bash # 查看 Agent 列表 openclaw agents list # 查看配对请求 openclaw pairing list # 批准配对 openclaw pairing approve feishu ``` ### 飞书插件 ```bash # 安装飞书插件 ./ops/install-lark-fixed.sh ``` ## 📚 常见问题 ### 1. Node.js 版本过低 安装器会自动安装 Node.js v22.x LTS,无需手动操作。 手动检查: ```bash node -v # 应该 >= v22.0.0 ``` ### 2. Gateway 服务启动失败 **现象:** ```bash openclaw status # Gateway: unreachable (connect failed: ECONNREFUSED 127.0.0.1:18789) ``` **解决:** ```bash # 手动启动网关 openclaw gateway run # 新开终端,启动仪表盘 openclaw dashboard ``` ### 3. Dashboard 自动打开失败 **现象:** 执行 `openclaw dashboard` 提示「Copied to clipboard」但浏览器无反应。 **解决:** 手动复制提示中的 URL 到浏览器地址栏: ``` http://127.0.0.1:18789/#token=xxx ``` ### 4. 飞书配对失败 **查看配对请求:** ```bash openclaw pairing list ``` **批准配对:** ```bash openclaw pairing approve feishu ``` ### 5. API 密钥错误 确保 `~/.openclaw/agents/main/agent/auth-profiles.json` 文件存在: ```json { "modelstudio": { "type": "bearer", "apiKey": "OPENCLAW_MODELSTUDIO_API_KEY" } } ``` ## 🤝 参与贡献 1. Fork 本仓库 2. 新建 Feat_xxx 分支 3. 提交代码 4. 新建 Pull Request ## 📄 License 本项目采用 [MIT](LICENSE) 开源协议 ## 🔗 相关链接 - [OpenClaw 官方文档](https://github.com/openclaw-ai/openclaw) - [阿里云百炼](https://help.aliyun.com/zh/model-studio/) - [飞书开放平台](https://open.feishu.cn/) - [UCloud 模型 verse](https://www.ucloud.cn/) - [Ollama](https://ollama.ai/) ## 👥 作者 - **jockerzoo** - [Gitee](https://gitee.com/jockerzo) --- **最后更新**: 2026-03-25