1

先决条件

Before you invite a space lobster into your machine, ensure you have:

Hardware

  • Mac (M1 or newer recommended)
  • Windows (WSL2 recommended)
  • Linux (Ubuntu 22.04+)
  • 8GB RAM minimum (16GB preferred)

Software

  • Node.js v20+
  • Docker (optional but recommended)
  • Git
2

安装

安装 OpenClaw 最简单的方法是通过 CLI。

bash
npx openclaw@latest init

该命令将:

  • Check your system compatibility
  • 下载 OpenClaw 核心引擎
  • Create a ~/.openclaw configuration folder
  • Prompt you to select your preferred LLM provider (Anthropic, OpenAI, or Local)
ℹ️
Note for Windows Users: We strongly recommend running this inside WSL2 (Ubuntu) for the best experience with file system permissions.
3

配置

Once installed, you can talk to your agent via the terminal:

...
bash
openclaw chat

Connecting Chat Apps

To make your agent useful, connect it to where you hang out. Run:

...
bash
openclaw connect telegram

Follow the prompts to enter your Bot Token (get this from BotFather on Telegram). You can repeat this for Discord, Slack, or WhatsApp.

4

安全

⚠️
严重警告:OpenClaw 可实际访问你的系统。
阅读完整的 安全风险分析后再继续。
先验证
仅本地检查
By default, OpenClaw runs in "Ask Permission" mode. It will ask you before executing any shell command or modifying files. Do not disable this until you are comfortable with how it behaves.
Your API keys are stored in ~/.openclaw/config.yaml. Ensure this file is never shared or committed to public version control.

🛠️ 故障排除

无效的 API 密钥

Ensure your keys (Anthropic, OpenAI, etc.) are complete and include any required prefixes. Double-check your ~/.openclaw/config.yaml or your project's .env file.

权限被拒绝(macOS)

OpenClaw requires specific permissions for background tasks. If an agent fails to run a command, check System Settings > Privacy & Security and ensure your terminal has "Full Disk Access".

Node.js 版本冲突

该框架需要 Node.js 18+。 If you encounter "Module not found" or syntax errors, verify your version with node -v and update if necessary.

端口冲突(5173)

If the monitoring dashboard fails to start, ensure port 5173 is not being used by another Vite application. You can force a port in vite.config.js.