全平台保姆级 OpenClaw 安装教程,按你的系统直接抄命令即可,新手零失败。
1. 安装 Node.js 22+:https://nodejs.org/(选LTS 22.x)把之前给你的安全配置保存为~/.openclaw/config.yaml ,启动时自动加载。2. 安装 Git:https://git-scm.com/(一路下一步)四、Linux(Ubuntu/Debian/CentOS)1. 选择模型(GPT/豆包/DeepSeek/本地模型)- Node.js ≥
全平台openclaw安装教程:
一、先看必备条件(必须满足)
- Node.js ≥ 22(官方要求,不是18)
- Git(Windows需手动装)
- 内存 ≥ 4GB(本地模型建议8GB+)
- 网络:能访问 GitHub / npm
二、Windows 安装(最常用)
1. 准备(必做)
1. 安装 Node.js 22+:https://nodejs.org/(选LTS 22.x)
2. 安装 Git:https://git-scm.com/(一路下一步)
3. 以管理员打开 PowerShell(Win+X → 终端(管理员))
2. 一键安装(推荐)
powershell
# 允许脚本执行(首次必跑)
Set-ExecutionPolicy RemoteSigned -Scope CurrentUser -Force
# 官方脚本(推荐)
iwr -useb https://openclaw.ai/install.ps1 | iex
# 国内镜像(速度慢时用)
# iwr -useb https://open-claw.org.cn/install-cn.ps1 | iex
3. 验证安装
powershell
openclaw --version
openclaw doctor
三、macOS 安装
1. 准备
bash
# 安装 Homebrew(没有的话)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# 安装 Node.js 22+
brew install node@22
2. 一键安装
bash
# 官方脚本
curl -fsSL https://openclaw.ai/install.sh | bash
# 国内镜像
# curl -fsSL https://open-claw.org.cn/install-cn.sh | bash
3. 验证
bash
openclaw --version
openclaw doctor
四、Linux(Ubuntu/Debian/CentOS)
1. 准备
bash
# Ubuntu/Debian
sudo apt update && sudo apt install -y nodejs npm git
# CentOS/RHEL
sudo dnf install -y nodejs npm git
2. 一键安装
bash
curl -fsSL https://openclaw.ai/install.sh | bash
# 国内镜像
# curl -fsSL https://open-claw.org.cn/install-cn.sh | bash
3. 验证
bash
openclaw --version
openclaw doctor
五、Docker 安装(隔离/服务器首选)
bash
# 拉取镜像
docker pull openclaw/openclaw:latest
# 运行(持久化+端口映射)
docker run -d \
--name openclaw \
-p 3000:3000 \
-v ~/.openclaw:/root/.openclaw \
--restart always \
openclaw/openclaw:latest
# 进入容器初始化
docker exec -it openclaw openclaw onboard
六、初始化配置(安装后必做)
bash
# 启动配置向导(全程交互)
openclaw onboard
向导会引导你:
1. 选择模型(GPT/豆包/DeepSeek/本地模型)
2. 输入 API Key(务必加密存储)
3. 设置工作目录(只给一个文件夹权限)
4. 开启沙箱/安全模式
七、安全启动(必用)
bash
# 沙箱+无管理员权限(最安全)
openclaw start --sandbox --no-admin
# 后台运行(服务器)
openclaw start --daemon --sandbox
八、常见问题
- Node 版本太低:卸载重装 Node 22+
- 权限不足:Windows用管理员终端,Linux/macOS加sudo
- 网络失败:换国内镜像脚本
- openclaw命令找不到:重启终端,或手动添加PATH
九、安全配置(直接用)
把之前给你的安全配置保存为 ~/.openclaw/config.yaml ,启动时自动加载。
更多推荐



所有评论(0)