OpenClaw Remote Install Skill
This skill handles remote installation and configuration of OpenClaw on remote servers via SSH with intelligent method selection and async execution support.
Log Directory
All installation logs are automatically saved to:
CODEBLOCK0
Each installation creates:
- -
install.log - Main installation log with timestamps - INLINECODE1 - Raw command output
- INLINECODE2 - Background process PID (async mode)
- INLINECODE3 - Installation status: running/success/failed/timeout
A symlink latest points to the most recent log directory.
Supported Installation Methods
| Method | Description | Best For |
|---|
| INLINECODE5 (default) | Auto-detect best method based on OS | Most cases |
| INLINECODE6 |
Official install.sh script | Standard Linux/macOS |
|
cli | install-cli.sh (local prefix) | No system Node dependency |
|
npm | npm install -g openclaw | Node 22+ already installed |
|
pnpm | pnpm add -g openclaw | pnpm users |
|
docker | Docker container | Containerized deployments |
|
podman | Podman rootless container | Rootless environments |
Usage
Quick Start (Auto-detect)
CODEBLOCK1
Async Installation (Recommended for long-running installs)
CODEBLOCK2
With Password
CODEBLOCK3
Force Specific Method
CODEBLOCK4
Non-interactive (Automation)
CODEBLOCK5
Custom Log Directory
CODEBLOCK6
Auto-Detection Logic
The installer automatically selects the best method:
- 1. If
--docker or --podman flag: Use container method (if available) - If Node 22+ installed: Use
pnpm or npm method - Otherwise: Use official
install.sh script
Supported Operating Systems
- - Ubuntu/Debian (apt)
- Fedora/RHEL/CentOS (dnf/yum)
- Alpine (apk)
- Arch Linux (pacman)
- macOS (Homebrew)
- Windows (WSL2) - via installer script
Post-Installation
CODEBLOCK7
Configuration Options
Auth Providers (via Python script)
- -
openai-api-key - OpenAI API - INLINECODE18 - Anthropic API
- INLINECODE19 - Custom OpenAI-compatible endpoint
- INLINECODE20 - Azure OpenAI
- INLINECODE21 - Google AI (Gemini)
- INLINECODE22 - Mistral AI
- INLINECODE23 - Z.AI endpoints
Secret Modes
- -
plaintext - Store directly in config (not recommended) - INLINECODE25 - Environment variable reference (recommended)
Gateway Modes
CODEBLOCK8
Environment Variables
For secure non-interactive configuration:
CODEBLOCK9
Then use --secret-mode ref to reference them securely.
Troubleshooting
SSH Issues
CODEBLOCK10
Installation Issues
- - Ensure curl is installed
- Check Node.js 22+ requirement (for non-Docker methods)
- Review logs: INLINECODE27
Docker Issues
CODEBLOCK11
OpenClaw 远程安装技能
该技能通过SSH处理远程服务器上OpenClaw的远程安装和配置,支持智能方法选择和异步执行。
日志目录
所有安装日志自动保存至:
~/.openclaw/remote-install-logs/<主机>_<时间戳>/
每次安装会创建:
- - install.log - 带时间戳的主安装日志
- install_output.log - 原始命令输出
- install.pid - 后台进程PID(异步模式)
- install.status - 安装状态:running/success/failed/timeout
符号链接latest指向最近的日志目录。
支持的安装方法
| 方法 | 描述 | 适用场景 |
|---|
| auto(默认) | 基于操作系统自动检测最佳方法 | 大多数情况 |
| installer |
官方install.sh脚本 | 标准Linux/macOS |
| cli | install-cli.sh(本地前缀) | 无需系统Node依赖 |
| npm | npm install -g openclaw | 已安装Node 22+ |
| pnpm | pnpm add -g openclaw | pnpm用户 |
| docker | Docker容器 | 容器化部署 |
| podman | Podman无根容器 | 无根环境 |
使用方法
快速开始(自动检测)
bash
./scripts/installopenclawremote.sh <主机> <用户> <密钥路径>
异步安装(推荐用于长时间安装)
bash
在后台运行安装并监控进度
./scripts/install
openclawremote.sh <主机> <用户> <密钥路径> --async
实时监控
tail -f ~/.openclaw/remote-install-logs/latest/install_output.log
检查状态
cat ~/.openclaw/remote-install-logs/latest/install_status
使用密码
bash
./scripts/installopenclawremote.sh <主机> <用户> <密码> --password-based
强制指定方法
bash
Docker安装
./scripts/install
openclawremote.sh <主机> <用户> <密钥路径> --docker
Podman安装
./scripts/install
openclawremote.sh <主机> <用户> <密钥路径> --podman
npm方法(如果Node 22+可用)
./scripts/install
openclawremote.sh <主机> <用户> <密钥路径> --method npm
非交互式(自动化)
bash
./scripts/installopenclawremote.sh <主机> <用户> <密钥路径> \
--non-interactive \
--configure
自定义日志目录
bash
./scripts/installopenclawremote.sh <主机> <用户> <密钥路径> \
--log-dir /path/to/custom/logs
自动检测逻辑
安装程序自动选择最佳方法:
- 1. 如果使用--docker或--podman标志:使用容器方法(如果可用)
- 如果已安装Node 22+:使用pnpm或npm方法
- 否则:使用官方install.sh脚本
支持的操作系统
- - Ubuntu/Debian(apt)
- Fedora/RHEL/CentOS(dnf/yum)
- Alpine(apk)
- Arch Linux(pacman)
- macOS(Homebrew)
- Windows(WSL2)- 通过安装脚本
安装后操作
bash
SSH登录远程服务器
ssh user@host
检查状态
openclaw status
运行诊断
openclaw doctor
配置(模型、通道等)
openclaw configure
或使用Python脚本进行非交互式配置
python3 scripts/configure
openclawremote.py <主机> <用户> \
--auth <密钥> --key-based --configure \
--auth-choice openai-api-key --api-key your-key
配置选项
认证提供商(通过Python脚本)
- - openai-api-key - OpenAI API
- anthropic-api-key - Anthropic API
- custom-api-key - 自定义OpenAI兼容端点
- azure-openai - Azure OpenAI
- google-ai - Google AI(Gemini)
- mistral-api-key - Mistral AI
- zai-api-key - Z.AI端点
密钥模式
- - plaintext - 直接存储在配置中(不推荐)
- ref - 环境变量引用(推荐)
网关模式
bash
--gateway-mode local # 本地网关(默认)
--gateway-mode remote # 远程网关
--gateway-port 18789
环境变量
用于安全的非交互式配置:
bash
export OPENAIAPIKEY=sk-...
export ANTHROPICAPIKEY=sk-ant-...
export CUSTOMAPIKEY=your-key
然后使用--secret-mode ref安全引用它们。
故障排除
SSH问题
bash
检查密钥权限
chmod 600 ~/.ssh/id_rsa
添加到ssh-agent
ssh-add ~/.ssh/id_rsa
安装问题
- - 确保已安装curl
- 检查Node.js 22+要求(非Docker方法)
- 查看日志:~/.openclaw/logs/
Docker问题
bash
检查Docker状态
docker ps
查看日志
docker logs openclaw
重启容器
docker restart openclaw