deploy

A set of deployment instructions for running OpenClaw agents on computers such as a Mac, Raspberry Pi, or virtual private server. OpenClaw is software for running agents and connecting them to messaging services such as Telegram.

In plain words
What is it for?
Installing OpenClaw, starting its gateway, copying agent files and secrets, registering agents, and configuring automatic startup on a Raspberry Pi or VPS.
Why use it?
It explains the installation, gateway startup, file transfer, and service setup needed to keep an agent running in different environments.

Cursor rule

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add rules/mergisi/openclaw-rules/deploy
Clone the repo
git clone --depth 1 https://github.com/mergisi/openclaw-rules
Per session 662 This file is loaded in full into every session.
When invoked 662 The same file — it is already loaded in full.
Security scan D 3 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00662 $0.00662
Opus 5 $0.00331 $0.00331
Sonnet 5 $0.00132 $0.00132
Haiku 4.5 $0.00066 $0.00066

Measured yesterday against content hash 15fe721f45c5, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade D, and why

deploy scanned grade D with 3 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured yesterday.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

curl -fsSL https://deb.nodesource.com/setup_20.x | sudo bash -

Downloads and executes remote codehighSupply chain

curl | sh runs whatever the server returns today, which is not necessarily what it returned when this was reviewed.

curl -fsSL https://deb.nodesource.com/setup_20.x | sudo bash -

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -fsSL https://deb.nodesource.com/setup_20.x | sudo bash -
project-rules/deploy.mdc · 121 lines

How it starts

The opening of the file, as written. The whole thing — 121 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Deployment Guide

When deploying OpenClaw agents to different environments.

Mac (Local Development)

# Install OpenClaw
npm install -g openclaw

# Start gateway
openclaw gateway run

# Register agent
openclaw agents add my-agent

# Agent is now live on Telegram

Raspberry Pi

Minimum: Raspberry Pi 4 (2GB RAM) or Pi 5.

# Install Node.js
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo bash -
sudo apt-get install -y nodejs

# Install OpenClaw
sudo npm install -g openclaw

# Copy agent files
scp -r agents/ [email protected]:~/mission-control/agents/
scp -r scripts/ [email protected]:~/mission-control/scripts/
scp -r secrets/ [email protected]:~/mission-control/secrets/

# Create systemd service
sudo tee /etc/systemd/system/openclaw-gateway.service > /dev/null << 'EOF'
[Unit]
Description=OpenClaw Gateway
After=network-online.target
Wants=network-online.target

[Service]
Type=simple
User=mypi
ExecStart=/usr/bin/openclaw gateway run
Restart=always
RestartSec=10
Environment=HOME=/home/mypi
Environment=NODE_OPTIONS=--max-old-space-size=512

[Install]
WantedBy=multi-user.target
EOF

sudo systemctl enable openclaw-gateway
sudo systemctl start openclaw-gateway

VPS (Ubuntu/Debian)

Same as Raspberry Pi but with more RAM. Recommended: 1GB+ RAM, Ubuntu 22.04+.

# Install and start
npm install -g openclaw
openclaw gateway run

# Use PM2 for process management (alternative to systemd)
npm install -g pm2
pm2 start "openclaw gateway run" --name openclaw
pm2 save
pm2 startup

Docker

FROM node:20-slim
RUN npm install -g openclaw
WORKDIR /app
COPY . .
CMD ["openclaw", "gateway", "run"]
# docker-compose.yml
services:
  openclaw:
    build: .
    restart: always
    volumes:
      - ./agents:/app/agents
      - ./secrets:/app/secrets
    environment:
      - NODE_OPTIONS=--max-old-space-size=512

Path Fixes After Deploy

Tool scripts may have hardcoded paths. Fix them after copying:

# Replace Mac paths with Raspi paths
sed -i 's|/Users/username/Documents/project|/home/mypi/mission-control|g' scripts/**/*.cjs

Read the full file on GitHub · 121 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. yesterday First seen · 121 lines · 662 tokens per session scan D 15fe721f45c5

Subscribe to this mod's changes

deploy is a cursor rule published in the GitHub repository mergisi/openclaw-rules (2 stars, last pushed 6mo ago), licensed MIT. It adds 662 tokens to every session, about $0.0033 per session on Opus 5. A static security scan graded it D with 3 findings (asks for root, downloads and executes remote code, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.