快速开始:10 分钟完成 OpenClaw 安装与配置
本教程是《OpenClaw 从新手到精通》系列第 2 篇
准备好了吗?让我们用 10 分钟时间,把 OpenClaw 运行起来!
一、安装前的检查清单
✅ 系统要求
# 检查 Node.js 版本(需要 22+)node -v# 检查 npmnpm -v# 检查可用内存(建议 2GB+)free -h# 检查磁盘空间(建议 10GB+)df -h📋 预期输出
v22.0.0 或更高 ✅10.0.0 或更高 ✅2Gi 或更多 ✅10GB 可用空间 ✅二、安装 OpenClaw
方式 1:使用 npm(推荐)
npm install -g openclaw方式 2:使用 pnpm
pnpm add -g openclaw✅ 验证安装
openclaw --version预期输出类似:2026.2.9
三、初始配置向导
openclaw onboard📝 配置步骤
选择 AI 模型提供商 - 推荐阿里云 Qwen 系列 输入 API Key - 从 dashscope.console.aliyun.com 获取 配置默认模型 - 推荐 alibaba-cloud/qwen3.5-plus选择启动选项 - 建议全选
四、启动 Gateway
# 启动服务openclaw gateway start# 查看状态openclaw gateway status# 查看日志openclaw logs -f✅ 预期输出
Gateway Status: RUNNINGPID: 12345Port: 3000Uptime: 0h 0m 15s五、验证安装
openclaw doctor✅ 预期输出
OpenClaw Doctor━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━✓ Node.js version: v22.0.0✓ OpenClaw version: 2026.2.9✓ Gateway status: RUNNING✓ Config file: ~/.openclaw/config.json✓ Model provider: alibaba-cloud✓ API key: configured━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━All checks passed! 🎉六、打开 Web 控制台
openclaw web然后在浏览器打开:http://localhost:3000[1]
七、快速命令参考
openclaw gateway start | |
openclaw gateway stop | |
openclaw gateway restart | |
openclaw gateway status | |
openclaw logs -f | |
openclaw doctor | |
openclaw web | |
openclaw onboard |
八、常见问题
Q: Gateway 启动失败?
# 检查端口占用lsof -i :3000# 更换端口openclaw config set gateway.port 3001openclaw gateway restartQ: API Key 无效?
# 重新配置openclaw configure --section models九、本章小结
✅ 你已完成:
Node.js 环境检查 OpenClaw 安装 API Key 配置 Gateway 启动 安装验证
⏭️ 下一步: 连接聊天渠道,开始与 AI 对话!
本文是《OpenClaw 从新手到精通》系列教程第 2 篇,共 25 篇。第 3 篇预告:连接你的第一个聊天渠道
夜雨聆风