安裝
- 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/自動化選項,請參閱 Installer internals。
其他安裝方式
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 安裝。完整參考:Installer internals。
已經安裝了嗎?您可以使用
openclaw update --channel dev 和 openclaw update --channel stable 在套件和 git 安裝之間切換。請參閱
Updating。
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從原始碼安裝
Section titled “從原始碼安裝”適用於貢獻者或任何想要從本地副本執行的人:
git clone https://github.com/openclaw/openclaw.gitcd openclawpnpm install && pnpm build && pnpm ui:buildpnpm link --globalopenclaw onboard --install-daemon或跳過連結並直接在程式庫內部使用 pnpm openclaw ...。請參閱 Setup 以了解完整的開發工作流程。
從 GitHub main 分支安裝
Section titled “從 GitHub main 分支安裝”curl -fsSL --proto '=https' --tlsv1.2 https://openclaw.ai/install.sh | bash -s -- --install-method git --version 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 設定。