Requirements
- Target platform
- OpenClaw
- Install method
- Manual import
- Extraction
- Extract archive
- Prerequisites
- OpenClaw
- Primary doc
- SKILL.md
Create Aleph Cloud VM instances with autonomous AI agents configured to self-replicate endlessly across the decentralized cloud network.
Create Aleph Cloud VM instances with autonomous AI agents configured to self-replicate endlessly across the decentralized cloud network.
Hand the extracted package to your coding agent with a concrete install brief instead of figuring it out manually.
I downloaded a skill package from Yavira. Read SKILL.md from the extracted folder and install it by following the included instructions. Tell me what you changed and call out any manual steps you could not complete.
I downloaded an updated skill package from Yavira. Read SKILL.md from the extracted folder, compare it with my current installation, and upgrade it while preserving any custom configuration unless the package docs explicitly say otherwise. Summarize what changed and any follow-up checks I should run.
Teach an AI agent to deploy itself onto Aleph Cloud decentralized infrastructure β from provisioning a VM to configuring its own runtime, autonomously.
This skill gives an AI agent everything it needs to: Provision its own VM on the Aleph Cloud network Install its agent framework (OpenClaw) on the new instance Configure its own credentials, gateway, and identity Transfer its knowledge and skills to the new environment Become fully operational on decentralized compute β without human intervention
aleph-client CLI installed (pip install aleph-client) A funded Aleph Cloud account (credits on BASE/ETH/AVAX/SOL, or $ALEPH tokens for holding) An SSH keypair for VM access AI provider API key (Anthropic, OpenAI, etc.) to share with spawned agents
pip install aleph-client --break-system-packages On Ubuntu 24+ you need --break-system-packages or use a venv.
aleph --version
# Import existing private key aleph account create --private-key <YOUR_HEX_PRIVATE_KEY> --chain BASE --active # Or generate a new one aleph account create --chain BASE --active Keys are stored at ~/.aleph-im/private-keys/. Always chmod 600 key files.
aleph account balance You need credits or $ALEPH tokens. Credits are the simplest (pay-as-you-go). Buy credits at https://account.aleph.im/ or hold $ALEPH tokens.
aleph pricing instance TierCompute UnitsvCPUsRAMDefault DiskCredits/HourCredits/Day1112 GiB20 GiB14,250342,0002224 GiB40 GiB28,500684,0003448 GiB80 GiB57,0001,368,00046612 GiB120 GiB85,5002,052,000 Disk size can be overridden with --rootfs-size <MiB>. The tier sets the minimum; you can allocate more (e.g., 40GB on a Tier 1). Extra disk costs ~4,416 credits/GiB/day.
ssh-keygen -t ed25519 -f ~/.ssh/aleph_agent -N "" -C "agent@aleph" chmod 600 ~/.ssh/aleph_agent
aleph node compute --active --json 2>/dev/null | python3 -c " import sys, json nodes = json.load(sys.stdin) scored = [] for n in nodes: score = n.get('score', 0) or 0 name = n.get('name', 'unknown') node_hash = n.get('hash', '') url = n.get('address', '') if score > 0.5: # Score is 0.0β1.0 (not percentage) scored.append((score, name, node_hash, url)) scored.sort(reverse=True) for s, name, h, url in scored[:10]: print(f'{s*100:.1f}% | {name} | {h} | {url}') "
CRN_HASH=$(aleph node compute --active --json 2>/dev/null | python3 -c " import sys, json nodes = json.load(sys.stdin) best = max( (n for n in nodes if (n.get('score', 0) or 0) > 0.5), key=lambda n: n.get('score', 0), default=None ) print(best['hash'] if best else '') ") echo "Best CRN: $CRN_HASH"
OSRootfs HashUbuntu 245330dcefe1857bcd97b7b7f24d1420a7d46232d53f27be280c8a7071d88bd84eUbuntu 22(default if --rootfs omitted)
The aleph instance create command has an interactive TUI for CRN selection. To bypass it completely, use --crn-hash + --skip-volume: aleph instance create \ --name "agent-v1" \ --compute-units 1 \ --rootfs 5330dcefe1857bcd97b7b7f24d1420a7d46232d53f27be280c8a7071d88bd84e \ --rootfs-size 40960 \ --payment-type credit \ --payment-chain BASE \ --ssh-pubkey-file ~/.ssh/aleph_agent.pub \ --crn-hash "$CRN_HASH" \ --crn-auto-tac \ --skip-volume \ --verbose Critical flags: --crn-hash <HASH>: Bypasses the interactive CRN picker TUI entirely --crn-auto-tac: Auto-accepts CRN Terms & Conditions --skip-volume: Skips the "add extra volumes?" interactive prompt --rootfs: OS image hash (omit for Ubuntu 22 default) --rootfs-size: Disk size in MiB (40960 = 40GB; overrides tier default)
Some versions of aleph-client may still show prompts. Use pexpect: #!/usr/bin/env python3 """Automate aleph instance create when CLI flags don't fully bypass TUI.""" import pexpect import sys import re CRN_HASH = sys.argv[1] if len(sys.argv) > 1 else "" NAME = sys.argv[2] if len(sys.argv) > 2 else f"agent-{int(__import__('time').time())}" cmd = ( f'aleph instance create ' f'--name "{NAME}" ' f'--compute-units 1 ' f'--rootfs 5330dcefe1857bcd97b7b7f24d1420a7d46232d53f27be280c8a7071d88bd84e ' f'--rootfs-size 40960 ' f'--payment-type credit ' f'--payment-chain BASE ' f'--ssh-pubkey-file ~/.ssh/aleph_agent.pub ' f'--crn-auto-tac ' f'--skip-volume ' f'--verbose' ) if CRN_HASH: cmd += f' --crn-hash {CRN_HASH}' child = pexpect.spawn('/bin/bash', ['-c', cmd], timeout=180, encoding='utf-8') child.logfile_read = sys.stdout while True: try: idx = child.expect([ r'(?i)rootfs.*type', # Rootfs type prompt r'(?i)disk.*size', # Disk size prompt r'(?i)add.*volume', # Add volume prompt r'(?i)confirm|deploy|proceed', # Confirmation prompt r'(?i)select.*crn|choose.*node', # CRN selection pexpect.EOF, pexpect.TIMEOUT, ], timeout=120) if idx == 0: child.sendline('ubuntu24') elif idx == 1: child.sendline('40960') elif idx == 2: child.sendline('n') elif idx == 3: child.sendline('y') elif idx == 4: child.sendline('') # Press Enter for top/default choice elif idx == 5: break # EOF β done elif idx == 6: break # Timeout β done or stuck except Exception as e: print(f"Error: {e}", file=sys.stderr) break print("\n" + child.before if child.before else "") child.close() sys.exit(child.exitstatus or 0) Install pexpect: pip install pexpect --break-system-packages Usage: python3 create_instance.py <CRN_HASH> <INSTANCE_NAME>
The CLI outputs the instance details. Extract the hash: # List instances and get the newest one aleph instance list 2>&1 The output shows a table with instance hash, SSH connection details, and mapped ports. Look for: ssh root@<HOST_IP> -p <PORT> -i <ssh-private-key-file>
# Parse connection info for the most recent instance aleph instance list 2>&1 | grep -oP 'ssh root@\S+ -p \d+'
# Wait for VM to boot (30-60 seconds) sleep 45 # Connect ssh -o StrictHostKeyChecking=no root@<HOST_IP> -p <MAPPED_PORT> -i ~/.ssh/aleph_agent
SSH into the VM, then: # Install Node.js 22 curl -fsSL https://deb.nodesource.com/setup_22.x | bash - DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs git # Install OpenClaw npm install -g openclaw # Create workspace mkdir -p /root/openclaw/memory /root/openclaw/skills # Verify node --version # Should show v22.x openclaw --version Use DEBIAN_FRONTEND=noninteractive to prevent dpkg prompts in non-TTY sessions.
mkdir -p /root/.openclaw/agents/main/agent /root/.openclaw/agents/main/sessions cat > /root/.openclaw/agents/main/agent/auth-profiles.json << 'EOF' { "version": 1, "profiles": { "anthropic:default": { "type": "token", "provider": "anthropic", "token": "<YOUR_ANTHROPIC_API_KEY>" } }, "lastGood": { "anthropic": "anthropic:default" } } EOF chmod 600 /root/.openclaw/agents/main/agent/auth-profiles.json Critical: The file MUST be named auth-profiles.json (not auth.json). The gateway reads auth-profiles.json β using the wrong filename silently fails with "No API key found for provider".
GATEWAY_TOKEN=$(openssl rand -hex 24) echo "Gateway token: $GATEWAY_TOKEN" # Save this! cat > /root/.openclaw/openclaw.json << EOF { "auth": { "profiles": { "anthropic:default": { "provider": "anthropic", "mode": "token" } } }, "agents": { "defaults": { "model": { "primary": "anthropic/claude-sonnet-4-20250514" }, "workspace": "/root/openclaw" } }, "gateway": { "port": 18789, "mode": "local", "bind": "loopback", "auth": { "mode": "token", "token": "$GATEWAY_TOKEN" } } } EOF # Harden permissions chmod 700 /root/.openclaw chmod 600 /root/.openclaw/openclaw.json
openclaw gateway install --force openclaw gateway start # Wait for startup sleep 3 # Verify β MUST pass the token openclaw gateway status --token "$GATEWAY_TOKEN" # Should show: Runtime: running ... RPC probe: ok If RPC probe: failed after gateway start, run openclaw gateway install --force then openclaw gateway restart. The systemd service file must have the token synced.
OPENCLAW_GATEWAY_TOKEN="$GATEWAY_TOKEN" openclaw agent --agent main -m "Hello! Who are you? Reply in one sentence." If the gateway route fails, it falls back to embedded mode (still works, just slower on first call).
From the parent machine, copy workspace files to the new VM: HOST="<HOST_IP>" PORT="<MAPPED_PORT>" KEY="$HOME/.ssh/aleph_agent" SCP="scp -i $KEY -P $PORT -o StrictHostKeyChecking=no" # Core identity files for f in SOUL.md AGENTS.md IDENTITY.md USER.md TOOLS.md HEARTBEAT.md; do [ -f "/root/openclaw/$f" ] && $SCP /root/openclaw/$f root@$HOST:/root/openclaw/$f done # Memory (optional β fresh start or shared context) [ -f "/root/openclaw/MEMORY.md" ] && $SCP /root/openclaw/MEMORY.md root@$HOST:/root/openclaw/MEMORY.md # Skills directory (recursive) scp -r -i $KEY -P $PORT -o StrictHostKeyChecking=no /root/openclaw/skills/ root@$HOST:/root/openclaw/skills/
For the new agent to deploy new instances, it needs: aleph-client CLI on its VM Aleph private key (or delegated key) to create instances This skill in its skills directory Sufficient credits/tokens in the account
ssh -i $KEY -p $PORT root@$HOST << 'REMOTE' apt-get install -y python3-pip pip install aleph-client --break-system-packages # Verify aleph --version REMOTE
# SENSITIVE β never log this key $SCP /root/.aleph-im/private-keys/your-key.key root@$HOST:/root/.aleph-im/private-keys/your-key.key ssh -i $KEY -p $PORT root@$HOST "chmod 700 /root/.aleph-im/private-keys && chmod 600 /root/.aleph-im/private-keys/*.key" # Activate on the child ssh -i $KEY -p $PORT root@$HOST "aleph account create --private-key \$(cat /root/.aleph-im/private-keys/your-key.key) --chain BASE --active"
ssh -i $KEY -p $PORT root@$HOST << 'REMOTE' echo "=== Checking deployment readiness ===" echo -n "aleph-client: "; aleph --version echo -n "Balance: "; aleph account balance 2>&1 | head -3 echo -n "SSH key: "; ls ~/.ssh/aleph_agent.pub 2>/dev/null && echo "OK" || echo "MISSING β generate with: ssh-keygen -t ed25519 -f ~/.ssh/aleph_agent -N ''" echo -n "This skill: "; ls ~/openclaw/skills/aleph-vm-deployment/SKILL.md 2>/dev/null && echo "OK" || echo "MISSING" echo -n "OpenClaw: "; openclaw --version echo "=== Ready to deploy ===" REMOTE Now the child instance can read this SKILL.md and create new instances β recursively.
aleph instance list
aleph instance delete <INSTANCE_HASH>
aleph account balance
This script automates the full cycle: find CRN β create VM β wait β install OpenClaw β configure β verify. #!/bin/bash # deploy.sh β Create a new Aleph Cloud agent clone # Usage: ./deploy.sh [name] [compute-units] [anthropic-key] set -euo pipefail AGENT_NAME="${1:-agent-$(date +%s)}" COMPUTE_UNITS="${2:-1}" ANTHROPIC_KEY="${3:-$ANTHROPIC_API_KEY}" SSH_KEY="$HOME/.ssh/aleph_agent" ROOTFS="5330dcefe1857bcd97b7b7f24d1420a7d46232d53f27be280c8a7071d88bd84e" ROOTFS_SIZE=40960 if [ -z "$ANTHROPIC_KEY" ]; then echo "ERROR: Set ANTHROPIC_API_KEY env var or pass as 3rd arg" exit 1 fi # Generate SSH key if needed if [ ! -f "$SSH_KEY" ]; then echo "=== Generating SSH keypair ===" ssh-keygen -t ed25519 -f "$SSH_KEY" -N "" -C "$AGENT_NAME@aleph" fi # Find best CRN echo "=== Finding best CRN ===" CRN_HASH=$(aleph node compute --active --json 2>/dev/null | python3 -c " import sys, json nodes = json.load(sys.stdin) best = max( (n for n in nodes if (n.get('score', 0) or 0) > 0.5), key=lambda n: n.get('score', 0), default=None ) print(best['hash'] if best else '') ") if [ -z "$CRN_HASH" ]; then echo "ERROR: No suitable CRN found" exit 1 fi echo "Selected CRN: $CRN_HASH" # Create instance echo "=== Creating instance: $AGENT_NAME ===" aleph instance create \ --name "$AGENT_NAME" \ --compute-units "$COMPUTE_UNITS" \ --rootfs "$ROOTFS" \ --rootfs-size "$ROOTFS_SIZE" \ --payment-type credit \ --payment-chain BASE \ --ssh-pubkey-file "${SSH_KEY}.pub" \ --crn-hash "$CRN_HASH" \ --crn-auto-tac \ --skip-volume \ --verbose # Wait for boot echo "=== Waiting 45s for VM to boot ===" sleep 45 # Get connection details echo "=== Connection details ===" aleph instance list 2>&1 | tail -30 # Parse SSH connection (user must extract HOST and PORT from output above) echo "" echo "=== $AGENT_NAME created ===" echo "" echo "Next steps:" echo " 1. Find HOST and PORT from the instance list above" echo " 2. SSH in: ssh root@<HOST> -p <PORT> -i $SSH_KEY" echo " 3. Run the setup script:" echo " ssh root@<HOST> -p <PORT> -i $SSH_KEY 'bash -s' < setup-agent.sh"
Save this as setup-agent.sh and pipe it via SSH: #!/bin/bash # setup-agent.sh β Run on a fresh Aleph VM after creation # Usage: ssh root@HOST -p PORT -i KEY 'bash -s' < setup-agent.sh set -e ANTHROPIC_KEY="${1:-}" echo "=== Installing Node.js 22 ===" curl -fsSL https://deb.nodesource.com/setup_22.x | bash - DEBIAN_FRONTEND=noninteractive apt-get install -y nodejs git python3-pip echo "=== Installing OpenClaw ===" npm install -g openclaw echo "=== Installing aleph-client ===" pip install aleph-client --break-system-packages echo "=== Creating workspace ===" mkdir -p /root/openclaw/{memory,skills} mkdir -p /root/.openclaw/agents/main/{agent,sessions} echo "=== Configuring gateway ===" GATEWAY_TOKEN=$(openssl rand -hex 24) cat > /root/.openclaw/openclaw.json << CONF { "auth": { "profiles": { "anthropic:default": { "provider": "anthropic", "mode": "token" } } }, "agents": { "defaults": { "model": { "primary": "anthropic/claude-sonnet-4-20250514" }, "workspace": "/root/openclaw" } }, "gateway": { "port": 18789, "mode": "local", "bind": "loopback", "auth": { "mode": "token", "token": "$GATEWAY_TOKEN" } } } CONF chmod 700 /root/.openclaw chmod 600 /root/.openclaw/openclaw.json echo "=== Starting gateway ===" openclaw gateway install --force openclaw gateway start sleep 3 echo "" echo "=== SETUP COMPLETE ===" echo "Gateway token: $GATEWAY_TOKEN" echo "OpenClaw: $(openclaw --version)" echo "Node: $(node --version)" echo "" echo "Remaining: copy auth-profiles.json, identity files, and aleph key"
Private keys: Always chmod 600. Never commit to git. Never log or echo. API keys: Store in auth-profiles.json with chmod 600, not in env vars or config files. Gateway tokens: Generate unique per VM (openssl rand -hex 24). Sync with openclaw gateway install --force. SSH: Use ed25519 keys only. Disable password auth on production VMs. Instance limits: Set a maximum instance count before deploying. Monitor credit balance and set budget alerts to prevent cost overruns. Human approval: Always require human approval before provisioning new instances in production. Network isolation: Gateway binds to loopback by default. Only expose via Tailscale, never raw public IP. Key isolation: All instances sharing one Aleph key is a security risk. Use delegated keys for production.
TiervCPU / RAMCredits/DayCredits/MonthApprox $/Month11 / 2 GiB342,000~10.3M~$3-522 / 4 GiB684,000~20.5M~$6-1034 / 8 GiB1,368,000~41M~$12-20 Extra disk beyond tier default: ~4,416 credits/GiB/day. Check current pricing: aleph pricing instance
The gateway reads auth-profiles.json, NOT auth.json. Ensure: File is at ~/.openclaw/agents/main/agent/auth-profiles.json Format matches the template in Step 6 (with "version": 1 and "profiles" key) Run openclaw gateway restart after any auth changes
openclaw gateway install --force openclaw gateway restart sleep 3 openclaw gateway status --token "$GATEWAY_TOKEN" The systemd service file caches the token β install --force re-syncs it.
Use --crn-hash <HASH> + --skip-volume + --crn-auto-tac. If still interactive, use the pexpect script from Step 4.
Wait 45-60 seconds (boot takes time on decentralized infra) Check aleph instance list for the mapped SSH port Verify the CRN is healthy: aleph node compute --crn-hash <HASH> --json Try IPv6 if IPv4 mapping isn't working
aleph account balance β check remaining credits aleph instance list β count running instances aleph instance delete <HASH> β kill unused instances Each running instance burns credits continuously, even idle
Only use config keys that OpenClaw recognizes. Known valid top-level keys: auth, agents, gateway, models, tools, bindings, messages, commands, hooks, channels, skills, plugins, wizard, meta Run openclaw doctor --fix to auto-remove invalid keys.
Use DEBIAN_FRONTEND=noninteractive before apt commands in non-TTY sessions.
Agent frameworks, memory systems, reasoning layers, and model-native orchestration.
Largest current source with strong distribution and engagement signals.