前置准备
1.1 硬件要求
- CPU:≥2 核(Intel i3/i5、AMD Ryzen 3/5 及以上)
- 内存:≥4G(推荐 8G,避免多任务卡顿)
- 存储:SSD 剩余≥10G(仅存储镜像/配置,无大文件)
- 网络:可正常联网(国内网络即可,已适配国内镜像源)
1.2 软件要求
- 操作系统:Windows10+/macOS12+/Linux(Ubuntu22.04 最佳,Windows 推荐 WSL2)
- 核心工具:Docker≥24.0 + Docker Compose≥2.20、Git≥2.40
- 可选凭证:大模型 API-Key(阿里云百炼/Kimi K2.5,用于增强自然语言能力,本地部署可省略)
- 浏览器:Chrome/Edge 最新版(用于访问控制台)
1.3 国内镜像源配置
mkdir -p /etc/docker
cat > /etc/docker/daemon.json << EOF
{
"registry-mirrors": ["https://docker.mirrors.ustc.edu.cn", "https://hub-mirror.c.163.com"]
}
EOF
systemctl daemon-reload && systemctl restart docker
git config --global url."https://ghproxy.com/https://github.com/".insteadOf "https://github.com/"
核心部署方案
方案 1:Docker 一键部署
步骤 1:安装 Docker 和 Git
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
sudo apt install git -y
步骤 2:拉取源码 + 构建镜像
git clone https://ghproxy.com/https://github.com/OpenClawChinese/OpenClaw.git
cd OpenClaw
docker build -t openclaw:latest .
docker volume create openclaw-data
步骤 3:初始化配置 + 启动服务
docker run --rm -v openclaw-data:/root/.openclaw openclaw:latest openclaw setup
docker run -- -v openclaw-data:/root/.openclaw openclaw:latest openclaw config gateway.bind lan
docker run -- -v openclaw-data:/root/.openclaw openclaw:latest openclaw config gateway.auth.token OpenClaw@2026
> docker-compose.yml <<
docker compose up -d