ClawSkills logoClawSkills

Openclaw Deploy

构建并将 OpenClaw 部署为 Docker 镜像或便携包。可以包含或不包含个人配置来打包 OpenClaw,以便轻松部署到其他服务器。

介绍

# SKILL.md 元数据格式示例

--- name: openclaw-deploy description: Build and deploy OpenClaw as Docker images or portable packages author: zfanmy-梦月儿 version: 1.0.1 homepage: license: MIT keywords: - openclaw - deploy - docker - portable - backup - migration requires: bins: - node - npm - tar ---

# OpenClaw Deploy

构建 OpenClaw 并将其部署为 Docker 镜像或便携式软件包。

## 功能特性

- 🐳 构建 Docker 镜像(纯净版/完整版) - 📦 创建用于部署的便携式软件包 - 🚀 一键部署到远程服务器 - 💾 备份和恢复配置

## 快速开始

### 构建便携式软件包

```bash # Build both clean and full versions ./scripts/build-portable.sh

# Export for deployment ./scripts/export-portable.sh ```

### 部署到远程服务器

```bash # Deploy clean version ./export/deploy.sh user@remote-server clean /opt/openclaw

# Deploy full version ./export/deploy.sh user@remote-server full /opt/openclaw ```

## 目录结构

``` openclaw-deploy/ ├── portable/clean/ # Clean version (no personal data) ├── portable/full/ # Full version (with config) ├── export/ # Deployment packages │ ├── openclaw-clean-portable.tar.gz │ ├── openclaw-full-portable.tar.gz │ └── deploy.sh └── scripts/ ├── build-portable.sh ├── export-portable.sh └── deploy.sh ```

## 在目标服务器上使用

```bash # Install Node.js ./install-node.sh

# Start OpenClaw cd clean && ./start.sh # or cd full && ./start.sh

# Access WebUI open http://localhost:18789 ```

## 环境要求

- Node.js 22.x - Docker(可选,用于 Docker 构建) - curl, rsync(用于部署)

## 配置

### 环境变量

您可以使用环境变量自定义路径:

```bash # OpenClaw installation directory (default: auto-detect) export OPENCLAW_INSTALL_DIR=/path/to/openclaw

# OpenClaw config directory (default: ~/.openclaw) export OPENCLAW_CONFIG_DIR=/path/to/.openclaw

# Output directory (default: ./openclaw-portable-output) export OUTPUT_DIR=/path/to/output ```

### 使用自定义路径的示例

```bash export OPENCLAW_INSTALL_DIR=/opt/openclaw export OPENCLAW_CONFIG_DIR=/opt/config/.openclaw export OUTPUT_DIR=/tmp/openclaw-packages

./scripts/build-portable.sh ```

## 更新日志

### v1.0.1 - 修复了硬编码路径 - 添加了环境变量支持 - 改进了错误处理和依赖检查 - 添加了路径验证

### v1.0.0 - 首次发布

## 作者

zfanmy-梦月儿

更多产品