The installer script is the recommended way to install OpenClaw. It handles Node detection, installation, and onboarding in one step.
Installer script
Tải CLI, cài đặt toàn cục qua npm và khởi chạy trình hướng dẫn onboarding.
```<Tabs> <Tab title="macOS / Linux / WSL2"> ```bash curl -fsSL https://openclaw.ai/install.sh | bash ```</Tab> <Tab title="Windows (PowerShell)"> ```powershell iwr -useb https://openclaw.ai/install.ps1 | iex ```</Tab></Tabs>Vậy là xong — script sẽ xử lý việc phát hiện Node, cài đặt và onboarding.Để bỏ qua onboarding và chỉ cài binary:<Tabs> <Tab title="macOS / Linux / WSL2"> ```bash curl -fsSL https://openclaw.ai/install.sh | bash -s -- --no-onboard ```</Tab> <Tab title="Windows (PowerShell)"> ```powershell & ([scriptblock]::Create((iwr -useb https://openclaw.ai/install.ps1))) -NoOnboard ```</Tab></Tabs>Để xem tất cả cờ, biến môi trường và tùy chọn CI/tự động hóa, xem [Installer internals](/install/installer).```
npm / pnpm
Nếu bạn đã có Node 22+ và muốn tự quản lý việc cài đặt:
```<Tabs> <Tab title="npm"> ```bash npm install -g openclaw@latest openclaw onboard --install-daemon ``` <Accordion title="lỗi build sharp?"> Nếu bạn đã cài libvips toàn cục (thường gặp trên macOS qua Homebrew) và `sharp` thất bại, hãy buộc dùng binary dựng sẵn: ```bash SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install -g openclaw@latest ``` Nếu bạn thấy `sharp: Please add node-gyp to your dependencies`, hãy cài công cụ build (macOS: Xcode CLT + `npm install -g node-gyp`) hoặc dùng biến môi trường ở trên.</Accordion></Tab> <Tab title="pnpm"> ```bash pnpm add -g openclaw@latest pnpm approve-builds -g # approve openclaw, node-llama-cpp, sharp, etc. openclaw onboard --install-daemon ``` <Note> pnpm yêu cầu phê duyệt rõ ràng cho các gói có script build. Sau khi lần cài đầu tiên hiển thị cảnh báo "Ignored build scripts", hãy chạy `pnpm approve-builds -g` và chọn các gói được liệt kê.</Note></Tab></Tabs>```
From source
Dành cho người đóng góp hoặc bất kỳ ai muốn chạy từ bản checkout cục bộ.
```<Steps> <Step title="Clone và build"> Clone [repo OpenClaw](https://github.com/openclaw/openclaw) và build: ```bash git clone https://github.com/openclaw/openclaw.git cd openclaw pnpm install pnpm ui:build pnpm build ```</Step> <Step title="Liên kết CLI"> Làm cho lệnh `openclaw` khả dụng toàn cục: ```bash pnpm link --global ``` Hoặc bỏ qua bước liên kết và chạy lệnh qua `pnpm openclaw ...` từ bên trong repo.</Step> <Step title="Chạy onboarding"> ```bash openclaw onboard --install-daemon ```</Step></Steps>Để xem các quy trình phát triển chuyên sâu hơn, xem [Thiết lập](/start/setup).```
Nếu $(npm prefix -g)/bin (macOS/Linux) hoặc $(npm prefix -g) (Windows) không nằm trong $PATH của bạn, shell của bạn không thể tìm thấy các binary npm toàn cục (bao gồm openclaw).Cách khắc phục — thêm nó vào file khởi động shell của bạn (~/.zshrc hoặc ~/.bashrc):
export PATH="$(npm prefix -g)/bin:$PATH"
Trên Windows, thêm đầu ra của npm prefix -g vào PATH của bạn.Then open a new terminal (or rehash in zsh / hash -r in bash).