Install overview

安裝

系統需求

  • Node 24(建議)或 Node 22.16+ - 安裝程式指令碼會自動處理這項需求
  • macOS、Linux 或 Windows - 支援原生 Windows 和 WSL2;WSL2 較穩定。請參閱 Windows
  • 只有從原始碼建置時才需要 pnpm

建議:安裝程式指令碼

這是最快的安裝方式。它會偵測你的作業系統、在需要時安裝 Node、安裝 OpenClaw,並啟動初始設定。

macOS / Linux / WSL2

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

Windows (PowerShell)

powershell
iwr -useb https://openclaw.ai/install.ps1 | iex

若要安裝但不執行初始設定:

macOS / Linux / WSL2

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

Windows (PowerShell)

powershell
& ([scriptblock]::Create((iwr -useb https://openclaw.ai/install.ps1))) -NoOnboard

如需所有旗標與 CI/自動化選項,請參閱安裝程式內部機制

替代安裝方法

本機前綴安裝程式(install-cli.sh

當你想將 OpenClaw 和 Node 保存在本機前綴路徑下,例如 ~/.openclaw,且不依賴系統層級的 Node 安裝時,請使用此方法:

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

它預設支援 npm 安裝,也支援在相同前綴流程下進行 git-checkout 安裝。完整參考:安裝程式內部機制

已經安裝了嗎?可使用 openclaw update --channel devopenclaw update --channel stable 在套件與 git 安裝之間切換。請參閱更新

npm、pnpm 或 bun

如果你已自行管理 Node:

npm

bash
npm install -g openclaw@latestopenclaw onboard --install-daemon

pnpm

bash
pnpm add -g openclaw@latestpnpm approve-builds -gopenclaw onboard --install-daemon

bun

bash
bun add -g openclaw@latestopenclaw onboard --install-daemon
疑難排解:sharp 建置錯誤(npm)

如果 sharp 因全域安裝的 libvips 而失敗:

bash
SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install -g openclaw@latest

從原始碼安裝

適合貢獻者或想從本機 checkout 執行的人:

bash
git clone https://github.com/openclaw/openclaw.gitcd openclawpnpm install && pnpm build && pnpm ui:buildpnpm link --globalopenclaw onboard --install-daemon

或略過 link,直接在 repo 內使用 pnpm openclaw ...。完整開發工作流程請參閱設定

從 GitHub main 安裝

bash
npm install -g github:openclaw/openclaw#main

容器與套件管理器

驗證安裝

bash
openclaw --version      # confirm the CLI is availableopenclaw doctor         # check for config issuesopenclaw gateway status # verify the Gateway is running

如果你想在安裝後使用受管理的啟動方式:

  • macOS:透過 openclaw onboard --install-daemonopenclaw gateway install 使用 LaunchAgent
  • Linux/WSL2:透過相同命令使用 systemd 使用者服務
  • 原生 Windows:優先使用 Scheduled Task;如果工作建立被拒,則 fallback 到每位使用者 Startup-folder 登入項目

託管與部署

將 OpenClaw 部署到雲端伺服器或 VPS:

VPS
Docker VM
Kubernetes
Fly.io
Hetzner
GCP
Azure
Railway
Render
Northflank

更新、遷移或解除安裝

疑難排解:找不到 openclaw

如果安裝成功,但終端機找不到 openclaw

bash
node -v           # Node installed?npm prefix -g     # Where are global packages?echo "$PATH"      # Is the global bin dir in PATH?

如果 $(npm prefix -g)/bin 不在你的 $PATH 中,請將它加入你的 shell 啟動檔(~/.zshrc~/.bashrc):

bash
export PATH="$(npm prefix -g)/bin:$PATH"

接著開啟新的終端機。更多詳細資訊請參閱 Node 設定

Was this useful?