2026年最新版OpenClaw一键安装教程,5分钟完成部署。本文提供Windows、macOS、Linux三种环境的一键安装方案。
这是最简单的方式,无需任何配置:
优势:
配置建议:
方式1:使用安装包
下载Windows安装包
# 访问 https://github.com/openclaw/openclaw/releases
# 下载 openclaw-installer-windows.exe
双击运行安装包
按照向导完成安装:
完成后自动启动
访问 http://localhost:8080
方式2:使用PowerShell脚本
# 以管理员身份打开PowerShell
# 下载安装脚本
Invoke-WebRequest -Uri "https://get.openclaw.sh/windows" -OutFile "install.ps1"
# 执行安装
.\install.ps1
# 或使用一键命令
iwr https://get.openclaw.sh/windows -useb | iex
方式3:使用Chocolatey
# 安装Chocolatey(如果没有)
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
# 安装OpenClaw
choco install openclaw -y
# 启动服务
openclaw start
方式1:使用Homebrew
# 安装Homebrew(如果没有)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# 安装OpenClaw
brew install openclaw
# 启动服务
openclaw start
方式2:使用安装脚本
# 下载并执行安装脚本
curl -fsSL https://get.openclaw.sh/macos | sh
# 或使用wget
wget -qO- https://get.openclaw.sh/macos | sh
方式3:使用Docker
# 安装Docker Desktop
brew install --cask docker
# 拉取镜像
docker pull openclaw/openclaw:latest
# 运行容器
docker run -d \
--name openclaw \
-p 8080:8080 \
-e ANTHROPIC_API_KEY=your_key \
openclaw/openclaw:latest
Ubuntu/Debian:
# 使用安装脚本
curl -fsSL https://get.openclaw.sh/linux | sh
# 或使用wget
wget -qO- https://get.openclaw.sh/linux | sh
# 安装后启动
sudo systemctl start openclaw
sudo systemctl enable openclaw
CentOS/RHEL:
# 使用安装脚本
curl -fsSL https://get.openclaw.sh/linux-centos | sh
# 启动服务
sudo systemctl start openclaw
sudo systemctl enable openclaw
使用Docker(所有Linux发行版):
# 安装Docker
curl -fsSL https://get.docker.com | sh
# 拉取镜像
docker pull openclaw/openclaw:latest
# 运行容器
docker run -d \
--name openclaw \
-p 8080:8080 \
-e ANTHROPIC_API_KEY=your_key \
-v /opt/openclaw/data:/app/data \
--restart unless-stopped \
openclaw/openclaw:latest
安装完成后,访问 http://localhost:8080 或 http://your_server_ip:8080
首次访问会进入初始化向导:
推荐使用Claude:
# 1. 访问 https://console.anthropic.com/
# 2. 注册/登录
# 3. 创建API Key
# 4. 复制Key
# 在WebUI配置
# 设置 -> 模型配置 -> Anthropic API Key
或使用OpenAI:
# 1. 访问 https://platform.openai.com/api-keys
# 2. 创建新的API Key
# 3. 复制Key
# 在WebUI配置
# 设置 -> 模型配置 -> OpenAI API Key
# 安装闲鱼自动回复
openclaw skill install xianyu-auto-reply
# 安装电商客服
openclaw skill install ecommerce-customer-service
# 安装Telegram Bot
openclaw skill install telegram-bot
# 安装微信Bot
openclaw skill install wechat-bot
# 查看已安装技能
openclaw skill list
Linux/macOS:
# 检查服务状态
systemctl status openclaw
# 查看日志
journalctl -u openclaw -f
# 检查端口
netstat -tlnp | grep 8080
Windows:
# 检查服务
Get-Service openclaw
# 查看日志
Get-Content "C:\Program Files\OpenClaw\logs\openclaw.log" -Tail 50 -Wait
# 测试对话
curl -X POST http://localhost:8080/api/chat \
-H "Content-Type: application/json" \
-d '{
"message": "你好",
"session_id": "test"
}'
# 测试健康检查
curl http://localhost:8080/health
在浏览器打开:
http://localhost:8080
应该能看到OpenClaw的欢迎界面。
# 使用控制面板卸载
# 或者使用命令
choco uninstall openclaw -y
# 手动删除配置
Remove-Item -Recurse -Force C:\Program Files\OpenClaw
# 使用Homebrew卸载
brew uninstall openclaw
# 删除配置文件
rm -rf ~/.openclaw
rm -rf /usr/local/lib/python*/site-packages/openclaw
# 停止服务
sudo systemctl stop openclaw
sudo systemctl disable openclaw
# 卸载
sudo apt remove openclaw # Ubuntu/Debian
sudo yum remove openclaw # CentOS/RHEL
# 删除配置
sudo rm -rf /opt/openclaw
sudo rm -rf /etc/openclaw
# 停止并删除容器
docker stop openclaw
docker rm openclaw
# 删除镜像
docker rmi openclaw/openclaw:latest
# 删除数据卷
docker volume rm openclaw-data
# 使用Chocolatey
choco upgrade openclaw -y
# 或下载最新安装包覆盖安装
# 使用Homebrew
brew upgrade openclaw
# 重启服务
openclaw restart
# Ubuntu/Debian
sudo apt update && sudo apt upgrade openclaw
# CentOS/RHEL
sudo yum update openclaw
# 重启服务
sudo systemctl restart openclaw
# 拉取最新镜像
docker pull openclaw/openclaw:latest
# 停止旧容器
docker stop openclaw
docker rm openclaw
# 运行新容器
docker run -d \
--name openclaw \
-p 8080:8080 \
-e ANTHROPIC_API_KEY=your_key \
-v /opt/openclaw/data:/app/data \
--restart unless-stopped \
openclaw/openclaw:latest
问题:权限不足
# Linux/macOS使用sudo
sudo ./install.sh
# Windows以管理员身份运行PowerShell
问题:依赖包缺失
# 自动安装依赖
openclaw doctor
问题:端口被占用
# 修改端口
nano ~/.openclaw/config.yaml
# 设置 port: 8081
# 或停止占用端口的进程
lsof -ti:8080 | xargs kill -9
问题:API Key未配置
# 检查配置
openclaw config show
# 设置API Key
openclaw config set anthropic_api_key your_key
问题:防火墙阻止
# 开放端口
sudo ufw allow 8080/tcp # Ubuntu
sudo firewall-cmd --add-port=8080/tcp --permanent # CentOS
问题:浏览器缓存
# 清除浏览器缓存
# 或使用无痕模式访问
安装完成后,你可以:
配置知识库
安装技能
接入平台
自定义开发
详细教程请参考官方文档。
OpenClaw一键安装非常简单:
最简单的方式:
使用腾讯云Lighthouse
本地安装方式:
5分钟完成安装,10分钟完成配置,立刻开始使用!
现在就开始安装OpenClaw吧!