Clone Your Bot: Building a Bot Army on AWS

Once you have a working OpenClaw instance on EC2, you can easily clone it to create multiple bots — each with their own identity, personality, and channel connections.

Overview

The process:

  1. Create an AMI from your working EC2 instance (snapshot of everything)
  2. Launch new instances from that AMI
  3. Customize each clone with new identity and tokens

Your original instance keeps running. Clones boot up ready to configure.


Step 1: Create an AMI from Your Running Instance

An AMI (Amazon Machine Image) captures your entire disk — OS, OpenClaw installation, configs, everything.

Via AWS Console

  1. Go to EC2 → Instances
  2. Select your running OpenClaw instance
  3. Click Actions → Image and templates → Create image
  4. Fill in the details:
    • Image name: openclaw-base-YYYY-MM-DD
    • Image description: "OpenClaw with Node, gateway configured, ready for customization"
    • Reboot instance: Leave UNCHECKED (your bot keeps running, no downtime)
    • Storage: Keep defaults
  5. Click Create image

Via AWS CLI

aws ec2 create-image \
  --instance-id i-YOUR_INSTANCE_ID \
  --name "openclaw-base-$(date +%Y-%m-%d)" \
  --description "OpenClaw base image for bot army" \
  --no-reboot

Wait for AMI to Complete


Step 2: Launch a New Instance from Your AMI

Once the AMI is available:

  1. Go to EC2 → AMIs
  2. Select your AMI
  3. Click Launch instance from AMI
  4. Configure the new instance:
    • Name: Give it a unique name (e.g., openclaw-bot-2)
    • Instance type: Same as original or adjust (t3.small works for most bots)
    • Key pair: Use existing or create new
    • Security group: Use same security group as original (needs ports 22, 443)
    • Storage: Expand the volume details:
      • Click Advanced in the Storage section
      • Set EncryptedYes
      • KMS key: default aws/ebs is fine
      This encrypts your API keys at rest.
  5. Click Launch instance

Note the new instance's public IP — you'll need this to SSH in and configure.


Step 3: Configure the Clone

SSH into your new instance:

ssh -i your-key.pem ubuntu@NEW_INSTANCE_IP

3.1 Create a New Telegram Bot (or other channel)

  1. Message @BotFather on Telegram
  2. Send /newbot
  3. Give it a name and username
  4. Copy the bot token

3.2 Update OpenClaw Config

Run the configuration wizard:

openclaw configure

Or edit the config file directly:

nano ~/.openclaw/openclaw.json

3.3 Give the Bot a New Identity

Edit the soul file:

nano ~/.openclaw/workspace/SOUL.md

Give this bot its own personality, name, and purpose.

3.4 Clear the Memory (Fresh Start)

# Clear previous bot's memories
rm -rf ~/.openclaw/workspace/memory/*
echo "# MEMORY.md - Long-Term Memory" > ~/.openclaw/workspace/MEMORY.md

# Optionally update other identity files
nano ~/.openclaw/workspace/USER.md
nano ~/.openclaw/workspace/IDENTITY.md

3.5 Restart the Gateway

openclaw gateway restart

3.6 Test It

Message your new bot on Telegram. It should respond with its new identity!


Creating a Clean Base Image

For easier cloning, create a "clean" AMI with no channel connections:

  1. Launch an instance from your working AMI
  2. SSH in and strip the channel connection:
    # Remove Telegram connection
    rm -rf ~/.openclaw/telegram
    
    # Stop the gateway
    openclaw gateway stop
  3. Create a new AMI from this cleaned instance
  4. Name it something like openclaw-clean-base-YYYY-MM-DD

Now each clone starts fresh — just add your channel config and identity.


Checklist for Each New Bot


Tips for Managing Multiple Bots

Naming Convention

Use consistent naming for instances and bots:

Different Purposes

Each bot can specialize:

Cost Optimization

Shared Resources

Consider sharing:


Quick Reference

Task Command/Location
Create AMI EC2 → Instances → Actions → Create image
Launch from AMI EC2 → AMIs → Launch instance
Edit config ~/.openclaw/openclaw.json
Edit identity ~/.openclaw/workspace/SOUL.md
Clear memory rm -rf ~/.openclaw/workspace/memory/*
Restart gateway openclaw gateway restart
Check status openclaw gateway status

Now go build your army! 🤖🤖🤖