LLM - 10分钟安装 OpenClaw:把 AI 管家跑在你自己的电脑上

文章目录

概述

OpenClaw 是一个"自托管"的 AI 管家系统:本地/服务器起一个 Gateway,接入飞书/Telegram 等聊天渠道,支持插件、工具调用、定时任务和仪表盘。适合把 AI 变成"能干活"的助手,而不仅是聊天。

一句话安装(推荐)

macOS / Linux / WSL2 直接执行:

bash 复制代码
curl -fsSL https://openclaw.ai/install.sh | bash

安装完成后运行新手引导(建议执行,会把服务也配置好):

bash 复制代码
openclaw onboard --install-daemon

1)安装前检查(避坑)

OpenClaw 需要:

  • Node.js >= 22
  • macOS / Linux / Windows(WSL2)

先检查版本:

bash 复制代码
node -v
npm -v

如果 Node 版本过低:先升级 Node 再继续(macOS 常用 Homebrew;Linux 可用官方源/NodeSource)。


2)安装后验证:确认"真的跑起来了"

建议依次跑这三条:

2.1 诊断(强烈建议)

bash 复制代码
openclaw doctor

2.2 查看运行状态

bash 复制代码
openclaw status

2.3 打开仪表盘

bash 复制代码
openclaw dashboard

3)备选安装方式

方式 A:手动全局安装(你已经有 Node/npm)

bash 复制代码
npm install -g openclaw@latest
openclaw onboard --install-daemon
macOS 上 sharp 相关报错怎么办?

有些环境会遇到 sharp 原生编译问题,可以用预编译包绕过:

bash 复制代码
SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install -g openclaw@latest

方式 B:从源码安装(适合贡献/二开)

bash 复制代码
git clone https://github.com/openclaw/openclaw.git
cd openclaw
pnpm install
pnpm ui:build
pnpm build
openclaw onboard --install-daemon

4)常见问题排错(最常见就这一个)

"安装成功但提示 openclaw: command not found"

99% 是 npm 全局 bin 不在 PATH

检查:

bash 复制代码
npm prefix -g
echo "$PATH"

修复(macOS/Linux):

bash 复制代码
export PATH="$(npm prefix -g)/bin:$PATH"

然后重开终端(zsh 可执行 rehash)。


5)装好后我建议立刻做的 3 件事

  1. 跑一遍自检:openclaw doctor
  2. 确认服务正常:openclaw status / openclaw gateway status
  3. 规划你的入口渠道:飞书/Telegram/Slack 选一个作为日常入口,再逐步扩展插件和自动化

实操

使用Claude code安装open claw

bash 复制代码
我想在我的mac mini 上安装 openclaw                                                                                                      
                                                                                                                                          
⏺ I'm not familiar with a project called "openclaw." Let me search for it to understand what you're referring to.                         
                                                                                                                                          
⏺ Web Search("openclaw software install mac 2026")                                                                                        
  ⎿  Did 0 searches in 53s                                                                                                                
                                                                                                                                          
⏺ Web Search("openclaw software project")                                                                                                 
  ⎿  Did 1 search in 85s                                                                                                                  
                                                                                                                                          
⏺ Web Search(""openclaw" github")                                                                                                         
  ⎿  Did 1 search in 62s                                                                                                                  
                                                                                                                                          
⏺ Now let me find the specific installation instructions for macOS.                                                                       
                                                                                                                                          
⏺ Web Search("openclaw install macOS Mac mini setup guide 2026")                                                                          
  ⎿  Did 1 search in 50s                                                                                                                  
                                                                                                                                          
⏺ OpenClaw 是一个开源的本地 AI 助手,可以连接 WhatsApp、iMessage、Slack、Telegram 等消息平台,在你自己的硬件上 24/7 运行。Mac Mini        
  是目前最受欢迎的运行设备之一。                                                  
                                                                                                                                          
  在 Mac Mini 上安装 OpenClaw                                                                                                             
                                                                                                                                          
  前置要求                                                                                                                                
                                                                                
  - Node.js 22+
  - 一个 AI 模型的 API Key(Claude、OpenAI 等)
  - macOS(Mac Mini M4 是最佳选择)

  安装步骤

  1. 安装 Homebrew 和 Node.js(如果还没有的话):

  /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  brew install node@22

  2. 安装 OpenClaw:

  curl -fsSL https://openclaw.ai/install.sh | bash

  或者通过 npm:

  npm install -g openclaw@latest

  3. 运行引导向导:

  openclaw onboard

  向导会引导你配置网关、工作区、消息渠道和技能。在此过程中需要输入你的 AI 模型 API Key。

  4. 配置 24/7 运行(可选):

  前往 系统设置 → 电池 → 选项,启用「唤醒以供网络访问」,确保 Mac Mini 在显示器关闭时仍然可达。

  安全警告

  - 2026 年 1 月发现了一个严重漏洞(CVE-2026-25253,CVSS 8.8),允许远程代码执行。请确保你安装的是 2026.1.29 或更新版本。
  - OpenClaw 仍然是实验性软件,请注意不要在包含高度敏感数据的设备上使用,或者做好安全隔离。
  - Cisco 安全团队发现部分第三方 skill 存在数据泄露和提示注入风险,安装第三方 skill 时需谨慎。

  详细指南

  如果需要更详细的教程,可以参考以下资源:

  - https://www.sitepoint.com/how-to-set-up-openclaw-on-a-mac-mini/
  - https://bitlaunch.io/blog/install-configure-openclaw/
  - https://us.ugreen.com/blogs/docking-stations/openclaw-on-mac-mini
  - https://github.com/openclaw/openclaw

  Sources:
  - https://github.com/openclaw/openclaw
  - https://www.sitepoint.com/how-to-set-up-openclaw-on-a-mac-mini/
  - https://bitlaunch.io/blog/install-configure-openclaw/
  - https://aiopenclaw.org/blog/openclaw-mac-mini-complete-guide
  - https://us.ugreen.com/blogs/docking-stations/openclaw-on-mac-mini
  - https://www.techradar.com/computing/macs/mac-mini-shortages-are-starting-to-happen-and-the-openclaw-ai-boom-is-a-key-reason

✻ Sautéed for 4m 6s                                                                                                                       
                                                                                  
❯ 你能帮我装吗                                                                                                                            
                                                                                                                                          
⏺ 可以帮你在这台机器上安装。让我先检查一下当前环境。                                                                                      
                                                                                                                                          
⏺ Bash(node --version 2>/dev/null; echo "---"; brew --version 2>/dev/null | head -1; echo "---"; which openclaw 2>/dev/null; echo "---";  
      sw_vers)                                                                                                                            
  ⎿  v18.20.3                                                                   
     ---                                                                                                                                  
     Homebrew 5.0.14                                                                                                                      
     ... +6 lines (ctrl+o to expand)                                                                                                        
                                                                                
⏺ 当前环境状态:                                                                                                                          
                                                                                                                
  - macOS: 26.2 (没问题)                                                                                                                  
  - Homebrew: 已安装 (5.0.14)                                                                                                             
  - Node.js: v18.20.3 --- 需要升级到 22+                                                                                                    
  - OpenClaw: 未安装                                                                                                                      
                                                                                                                                          
  需要先升级 Node.js 到 22+,然后再安装 OpenClaw。                                                                                        
                                                                                                                                          
⏺ User answered Claude's questions:                                                                                                       
  ⎿  · 你希望怎样安装 OpenClaw? → 自动安装 (推荐)                                                              

⏺ 好的,开始自动安装。先升级 Node.js 到 22。                                                                                              
                                                                                                                
⏺ Bash(brew install node@22 2>&1)                                                                                                         
  ⎿  ==> Auto-updating Homebrew...                                                                                                        
     Adjust how often this is run with `$HOMEBREW_AUTO_UPDATE_SECS` or disable with                                                       
     `$HOMEBREW_NO_AUTO_UPDATE=1`. Hide these hints with `$HOMEBREW_NO_ENV_HINTS=1` (see `man brew`).                                     
     ... +37 lines (ctrl+o to expand)                                                                                                       
  ⎿  (timeout 5m)                                                                                                                         
                                                                                                                                          
⏺ Node.js 22 已安装,但它是 keg-only,需要先把它加到 PATH 里。                                                                            
                                                                                                                                          
⏺ Bash(export PATH="/opt/homebrew/opt/node@22/bin:$PATH" && node --version && npm --version)                                              
  ⎿  v22.22.0                                                                                                                             
     10.9.4                                                                                                                               
                                                                                                                                          
⏺ Node.js 22.22.0 已就绪。现在用官方安装脚本安装 OpenClaw。                                                                               
                                                                                                                                          
⏺ Bash(export PATH="/opt/homebrew/opt/node@22/bin:$PATH" && curl -fsSL https://openclaw.ai/install.sh | bash 2>&1)                        
  ⎿  Error: Exit code 127                                                                                                                 
     (eval):1: command not found: curl                                                                                                    
                                                                                                                                          
     (eval):1: command not found: bash                                                                                                    
                                                                                                                                          
⏺ Searched for 1 pattern (ctrl+o to expand)                                                                                               
                                                                                                                                          
⏺ Bash(export PATH="/opt/homebrew/opt/node@22/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:$PATH" && curl -fsSL                       
      https://openclaw.ai/install.sh | bash 2>&1)                                                                                         
  ⎿  Error: Exit code 1                                                                                                                   
     ╭───────────────────────────────────────────────────────────────────────────────╮                                                    
     │                                                                               │                                                    
     │  🦞 OpenClaw Installer                                                        │                                                    
     │  Welcome to the command line: where dreams compile and confidence segfaults.  │                                                    
     │  modern installer mode                                                        │                                                    
     │                                                                               │                                                    
     ╰───────────────────────────────────────────────────────────────────────────────╯                                                    
                                                                                                                                          
     ✓ gum bootstrapped (temp, verified, v0.17.0)                                                                                         
     ... +15 lines (ctrl+o to see all)                                                                                                      
                                                                                                                                          
✻ Cogitated for 2m 51s                                                                                                                    
                                                                                                                                          
❯ 干完了吗                                                                                                                                
                                                                                                                                          
⏺ 还没有。安装脚本因为在非交互模式下运行需要 sudo 权限而失败了。让我换个方式,直接用 npm 安装。                                           
                                                                                                                                          
⏺ Bash(export PATH="/opt/homebrew/opt/node@22/bin:$PATH" && npm install -g openclaw@latest 2>&1)                                          
  ⎿  npm warn deprecated npmlog@6.0.2: This package is no longer supported.          
     npm warn deprecated are-we-there-yet@3.0.1: This package is no longer supported.                                                     
     npm warn deprecated gauge@4.0.4: This package is no longer supported.                                                                
     ... +12 lines (ctrl+o to expand)                                                                                                       
  ⎿  (timeout 5m)                                                                                                                         
                                                                                                                                          
⏺ 安装成功了。验证一下。                                                                                                                  
                                                                                                                                          
⏺ Bash(export PATH="/opt/homebrew/opt/node@22/bin:$PATH" && openclaw --version 2>&1)                                                      
  ⎿  [agents/auth-profiles] synced qwen credentials from qwen cli                                                                         
     2026.2.17                                                                                                                            
                                                                                                                                          
⏺ OpenClaw 2026.2.17 已安装成功(这是最新版,晚于安全补丁版本 2026.1.29,没有已知漏洞问题)。                                             
                                                                                                                                          
  还有一件事需要处理:把 Node.js 22 永久加到你的 PATH 里,否则新开终端窗口时 openclaw 命令会找不到。                                      
                                                                                                                                          
⏺ Bash(grep -q 'node@22' ~/.zshrc 2>/dev/null && echo "ALREADY_SET" || echo "NOT_SET")                                                    
  ⎿  NOT_SET                                                                                                                              
                                                                                                                                          
⏺ User answered Claude's questions:                                                                                                       
  ⎿  · 要把 Node.js 22 永久加到你的 PATH 吗?否则新开终端时 openclaw 命令会找不到。 → 帮我加 (推荐)                                       
                                                                                                                                          
⏺ Bash(echo '' >> ~/.zshrc && echo '# Node.js 22 (for OpenClaw)' >> ~/.zshrc && echo 'export PATH="/opt/homebrew/opt/node@22/bin:$PATH"'  
      >> ~/.zshrc)                                                                                                                        
  ⎿  (No output)                                                                                                                          
                                                                                                                                          
⏺ 全部完成。总结一下:                                                                                                                    
  ┌───────────────────────────┬──────┐                                                                                                    
  │           步骤            │ 状态 │                                                                                                    
  ├───────────────────────────┼──────┤                                                                                                    
  │ Node.js 升级到 22.22.0    │ done │                                                                                                    
  ├───────────────────────────┼──────┤                                          
  │ OpenClaw 安装 (2026.2.17) │ done │                                                                                                    
  ├───────────────────────────┼──────┤                                                                                                    
  │ PATH 永久配置到 ~/.zshrc  │ done │                                                                                                    
  └───────────────────────────┴──────┘                                                                                                    
  接下来你需要做的                                                                                                                        
                                                                                                                                          
  1. 新开一个终端窗口(或运行 source ~/.zshrc)让 PATH 生效                                                                               
  2. 运行 openclaw onboard 启动引导向导,配置:
    - AI 模型 API Key(Claude / OpenAI 等)
    - 消息渠道(WhatsApp、iMessage、Telegram 等)
    - 工作区和技能
  3. 如果要 24/7 运行,去 系统设置 → 电池 → 选项 启用「唤醒以供网络访问」

✻ Cogitated for 3m 10s                        

接入飞书

按照说明


官方文档入口