安裝
- Node 24(建議)或 Node 22.19+ - 安裝程式會自動處理此項
- macOS、Linux 或 Windows - 支援原生 Windows 和 WSL2;WSL2 更穩定。請參閱 Windows。
pnpm僅在您從原始碼建置時才需要
推薦:安裝程式腳本
Section titled “推薦:安裝程式腳本”最快的安裝方式。它會偵測您的作業系統,在需要時安裝 Node,安裝 OpenClaw,並啟動入門導覽。
bash curl -fsSL https://openclaw.ai/install.sh | bash
powershell iwr -useb https://openclaw.ai/install.ps1 | iex
若要安裝但不執行入門導覽:
bash curl -fsSL https://openclaw.ai/install.sh | bash -s -- --no-onboard
powershell & ([scriptblock]::Create((iwr -useb https://openclaw.ai/install.ps1))) -NoOnboard
如需所有旗標和 CI/自動化選項,請參閱 安裝程式內部機制。
其他安裝方式
Section titled “其他安裝方式”本地前綴安裝程式 (install-cli.sh)
Section titled “本地前綴安裝程式 (install-cli.sh)”當您希望 OpenClaw 和 Node 保留在本地前綴路徑(例如
~/.openclaw)下,而不依賴系統全域的 Node 安裝時,請使用此方法:
curl -fsSL https://openclaw.ai/install-cli.sh | bash它預設支援 npm 安裝,加上在同一個前置流程下的 git-checkout 安裝。完整參考:安裝程式內部機制。
已經安裝了嗎?使用
openclaw update --channel dev 和 openclaw update --channel stable 在套件和 git 安裝之間切換。請參閱
更新。
npm、pnpm 或 bun
Section titled “npm、pnpm 或 bun”如果您已自行管理 Node:
npm install -g openclaw@latestopenclaw onboard --install-daemonpnpm add -g openclaw@latestpnpm approve-builds -gopenclaw onboard --install-daemonbun add -g openclaw@latestopenclaw onboard --install-daemon疑難排解:sharp 建置錯誤 (npm)
如果 sharp 因全域安裝的 libvips 而失敗:
SHARP_IGNORE_GLOBAL_LIBVIPS=1 npm install -g openclaw@latest從原始碼安裝
Section titled “從原始碼安裝”適用於貢獻者或任何想要從本地端副本執行的人:
git clone https://github.com/openclaw/openclaw.gitcd openclawpnpm install && pnpm build && pnpm ui:buildpnpm link --globalopenclaw onboard --install-daemon或者跳過連結並直接從 repo 內部使用 pnpm openclaw ...。如需完整的開發工作流程,請參閱 設定。
從 GitHub main 安裝
Section titled “從 GitHub main 安裝”npm install -g github:openclaw/openclaw#main容器與套件管理器
Section titled “容器與套件管理器”容器化或無頭式部署。
Docker 的無根容器替代方案。
透過 Nix flake 進行宣告式安裝。
自動化佈建伺服器群組。
透過 Bun 執行時僅使用 CLI。
openclaw --version # confirm the CLI is availableopenclaw doctor # check for config issuesopenclaw gateway status # verify the Gateway is running如果您希望在安裝後進行受管理的啟動:
- macOS:透過
openclaw onboard --install-daemon或openclaw gateway install使用 LaunchAgent - Linux/WSL2:透過相同的指令使用 systemd 使用者服務
- 原生 Windows:優先使用排程任務,如果建立任務被拒絕,則改用每個使用者的啟動資料夾登入項目作為後備方案
在雲端伺服器或 VPS 上部署 OpenClaw:
任何 Linux VPS
共用 Docker 步驟
K8s
Fly.io
Hetzner
Google Cloud
Azure
Railway
Render
Northflank
更新、遷移或解除安裝
Section titled “更新、遷移或解除安裝”保持 OpenClaw 為最新狀態。
移動到新機器。
完全移除 OpenClaw。
疑難排解:找不到 openclaw
Section titled “疑難排解:找不到 openclaw”如果安裝成功但在您的終端機中找不到 openclaw:
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):
export PATH="$(npm prefix -g)/bin:$PATH"然後開啟一個新的終端機。欲了解更多詳情,請參閱 Node 設定。