Home Tutorials Categories Skills About
ZH EN JA KO
Installation

OpenClaw One-Click Deployment Script Guide

· 20 min read

Introduction

For users who want to get started quickly, OpenClaw provides a one-click deployment script that handles everything from environment detection to service startup with a single command. This article covers how to use the deployment script, customization options, and how to achieve fully automated deployment on a VPS using cloud-init.

One-Click Install Command

Run the following command in your terminal to begin installation:

curl -fsSL https://get.openclaw.com | bash

Or use wget:

wget -qO- https://get.openclaw.com | bash

The installation script automatically completes the following steps:

  1. Detects the operating system and architecture
  2. Checks for and installs Node.js 22 (if not present)
  3. Installs OpenClaw globally via npm
  4. Runs openclaw onboard for initial configuration
  5. Starts the OpenClaw service

Supported Operating Systems

Operating System Architecture Support Status
Ubuntu 20.04+ x86_64, arm64 Fully supported
Debian 11+ x86_64, arm64 Fully supported
CentOS 8+ / RHEL 8+ x86_64, arm64 Fully supported
Fedora 38+ x86_64, arm64 Fully supported
macOS 13+ x86_64, arm64 Fully supported
Alpine 3.18+ x86_64, arm64 Basic support
Arch Linux x86_64 Basic support

Custom Installation Options

The installation script supports customization through environment variables:

Specify a Version

curl -fsSL https://get.openclaw.com | OPENCLAW_VERSION=2.5.0 bash

Specify the Installation Directory

curl -fsSL https://get.openclaw.com | OPENCLAW_PREFIX=/opt/openclaw bash

Skip Node.js Installation

If you already have Node.js 22+ installed:

curl -fsSL https://get.openclaw.com | SKIP_NODE_INSTALL=1 bash

Skip the Setup Wizard

Install without running openclaw onboard:

curl -fsSL https://get.openclaw.com | SKIP_ONBOARD=1 bash

Install Using Docker

curl -fsSL https://get.openclaw.com | INSTALL_METHOD=docker bash

Combine Multiple Options

curl -fsSL https://get.openclaw.com | \
  OPENCLAW_VERSION=latest \
  SKIP_ONBOARD=1 \
  INSTALL_METHOD=npm \
  bash

Full Installation Options Reference

Environment Variable Default Description
OPENCLAW_VERSION latest Version to install
OPENCLAW_PREFIX System default Custom installation prefix path
INSTALL_METHOD npm Installation method: npm or docker
SKIP_NODE_INSTALL 0 Set to 1 to skip Node.js installation
SKIP_ONBOARD 0 Set to 1 to skip the setup wizard
GATEWAY_PORT 18789 Custom gateway port
AUTO_START 1 Set to 0 to not auto-start the service
SETUP_SYSTEMD 1 Set to 0 to skip systemd configuration
NPM_REGISTRY Official registry Custom npm mirror registry

Unattended Installation

Unattended installation is ideal for batch deployment scenarios, pre-setting all parameters to avoid interactive input.

Prepare the Configuration File

Write the openclaw.json5 configuration file locally in advance:

{
  gateway: {
    port: 18789,
    host: "0.0.0.0",
  },
  models: {
    default: "claude",
    providers: {
      claude: {
        apiKey: "sk-ant-your-api-key-here",
        model: "claude-sonnet-4-20250514",
      },
    },
  },
  channels: {
    telegram: {
      enabled: true,
      token: "your-telegram-bot-token",
    },
  },
  logging: {
    level: "info",
  },
}

Single-Command Unattended Installation

# Download and install OpenClaw, skip the wizard
curl -fsSL https://get.openclaw.com | SKIP_ONBOARD=1 bash

# Copy the pre-configured configuration file
mkdir -p ~/.config/openclaw
curl -fsSL https://your-server.com/openclaw.json5 > ~/.config/openclaw/openclaw.json5

# Start
openclaw up

Or combine everything into a single script:

curl -fsSL https://get.openclaw.com | SKIP_ONBOARD=1 AUTO_START=0 bash && \
mkdir -p ~/.config/openclaw && \
curl -fsSL https://your-server.com/openclaw.json5 > ~/.config/openclaw/openclaw.json5 && \
openclaw up

VPS Deployment with cloud-init

cloud-init is an automated initialization tool supported by all major cloud providers. You can use cloud-init to automatically deploy OpenClaw when creating a VPS.

Basic cloud-init Configuration

When creating a VPS instance, paste the following into the "User Data" or "cloud-init" field:

#cloud-config

package_update: true
package_upgrade: true

packages:
  - curl
  - git

runcmd:
  # Install OpenClaw
  - curl -fsSL https://get.openclaw.com | SKIP_ONBOARD=1 SETUP_SYSTEMD=1 bash

  # Deploy configuration file
  - mkdir -p /root/.config/openclaw
  - |
    cat > /root/.config/openclaw/openclaw.json5 << 'CONF'
    {
      gateway: {
        port: 18789,
        host: "0.0.0.0",
      },
      models: {
        default: "claude",
        providers: {
          claude: {
            apiKey: "sk-ant-your-api-key-here",
            model: "claude-sonnet-4-20250514",
          },
        },
      },
      logging: {
        level: "info",
      },
    }
    CONF

  # Start the service
  - systemctl start openclaw
  - systemctl enable openclaw

  # Configure the firewall
  - ufw allow 18789/tcp
  - ufw --force enable

final_message: "OpenClaw deployment complete! Visit http://$_IP:18789/dashboard"

Using cloud-init on Various Cloud Platforms

Alibaba Cloud ECS:

  1. When creating an instance, find "Instance Custom Data" under "Advanced Options"
  2. Paste the cloud-init configuration above

Tencent Cloud CVM:

  1. When creating an instance, find "Custom Data" under "Advanced Settings"
  2. Paste the cloud-init configuration

AWS EC2:

  1. When creating an instance, expand "Advanced details"
  2. Paste the configuration in "User data"

DigitalOcean:

  1. When creating a Droplet, expand "Advanced Options"
  2. Check "Add user data"
  3. Paste the configuration

Enhanced cloud-init (with Security Hardening)

Here is a complete cloud-init configuration recommended for production environments:

#cloud-config

package_update: true
package_upgrade: true

# Create a dedicated user
users:
  - name: openclaw
    shell: /bin/bash
    groups: [sudo]
    sudo: ['ALL=(ALL) NOPASSWD:ALL']
    ssh_authorized_keys:
      - ssh-rsa YOUR_PUBLIC_KEY_HERE

packages:
  - curl
  - git
  - fail2ban
  - ufw

write_files:
  - path: /home/openclaw/.config/openclaw/openclaw.json5
    owner: openclaw:openclaw
    permissions: '0600'
    content: |
      {
        gateway: {
          port: 18789,
          host: "0.0.0.0",
        },
        models: {
          default: "claude",
          providers: {
            claude: {
              apiKey: "sk-ant-your-api-key-here",
              model: "claude-sonnet-4-20250514",
            },
          },
        },
        logging: {
          level: "warn",
        },
      }

runcmd:
  # Install as the openclaw user
  - su - openclaw -c 'curl -fsSL https://get.openclaw.com | SKIP_ONBOARD=1 AUTO_START=0 bash'

  # Configure the systemd service
  - |
    cat > /etc/systemd/system/openclaw.service << 'SVC'
    [Unit]
    Description=OpenClaw AI Assistant
    After=network-online.target
    [Service]
    Type=simple
    User=openclaw
    ExecStart=/home/openclaw/.npm-global/bin/openclaw up
    Restart=always
    RestartSec=10
    [Install]
    WantedBy=multi-user.target
    SVC

  - systemctl daemon-reload
  - systemctl enable openclaw
  - systemctl start openclaw

  # Firewall configuration
  - ufw default deny incoming
  - ufw default allow outgoing
  - ufw allow ssh
  - ufw allow 18789/tcp
  - ufw --force enable

  # Start fail2ban
  - systemctl enable fail2ban
  - systemctl start fail2ban

How the Installation Script Works

The one-click deployment script follows this workflow:

Start
  ├─ Detect operating system and architecture
  ├─ Detect package manager (apt/yum/brew)
  ├─ Check Node.js version
  │   ├─ Not installed → Install Node.js 22
  │   ├─ Version too low → Upgrade Node.js
  │   └─ Version sufficient → Skip
  ├─ Select installation method
  │   ├─ npm → npm install -g openclaw
  │   └─ docker → docker pull openclaw/openclaw
  ├─ Run openclaw onboard (can be skipped)
  ├─ Configure systemd/launchd auto-start (can be skipped)
  └─ Start OpenClaw

Offline Installation

In environments without internet access, you can pre-package the installation:

Package on a Machine with Internet Access

# Download OpenClaw and its dependencies
mkdir openclaw-offline
cd openclaw-offline
npm pack openclaw@latest
npm cache ls openclaw 2>/dev/null

# Package the Node.js binary
curl -O https://nodejs.org/dist/v22.x.x/node-v22.x.x-linux-x64.tar.xz

Install on the Target Machine

# Extract Node.js
tar -xJf node-v22.x.x-linux-x64.tar.xz -C /usr/local --strip-components=1

# Install OpenClaw
npm install -g openclaw-*.tgz

Troubleshooting

Issue Solution
curl command not available apt install curl or yum install curl
Insufficient permissions Use sudo or run as root
Node.js installation failed Install Node.js 22 manually, then use SKIP_NODE_INSTALL=1
Network timeout Set NPM_REGISTRY to use a local mirror
cloud-init didn't execute Check /var/log/cloud-init-output.log

Summary

The one-click deployment script significantly lowers the barrier to installing OpenClaw, whether for personal quick trials or enterprise batch deployments. For production environments, we recommend using cloud-init with security hardening for fully automated deployment from scratch. After installation, don't forget to run openclaw doctor to confirm all components are working properly.

OpenClaw is a free, open-source personal AI assistant that supports WhatsApp, Telegram, Discord, and many more platforms