For many, AWS is synonymous with “cloud.” If you are building a serious business around your AI agents, or if you simply want to integrate OpenClaw with other AWS services like S3 (for storage) or Lambda (for serverless functions), running on EC2 is the logical step.

Here is how to deploy OpenClaw on an Amazon EC2 instance.

1. Launching the Instance

  1. Log in to the AWS Console.
  2. Navigate to EC2 -> Launch Instance.
  3. Name: OpenClaw-Agent-01.
  4. AMI: Ubuntu Server 24.04 LTS (HVM), SSD Volume Type.
  5. Instance Type: t3.small.
    • Why? The t3.micro only has 1GB RAM, which can be tight. t3.small gives you 2GB RAM and 2 vCPUs, which is much safer for production.
  6. Key Pair: Create a new key pair (openclaw-key) and download the .pem file.

2. Security Groups (The Firewall)

AWS blocks everything by default. You need to open ports.

  1. Create a security group.
  2. Allow SSH (Port 22) from My IP.
  3. If OpenClaw has a web interface you want to access, allow HTTP (80) or the specific port (e.g., 3000) from your IP.

3. Connecting

Move your key to a secure folder and change permissions:

chmod 400 openclaw-key.pem
ssh -i "openclaw-key.pem" ubuntu@<your-ec2-public-dns>

4. Installation

The standard installation applies here.

sudo apt update
sudo apt install git -y

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

# Clone OpenClaw
git clone https://github.com/openclaw/openclaw.git
cd openclaw
npm install

5. Integration with AWS Services

The real power of using AWS is integration. You can configure OpenClaw to save its logs or “memories” directly to an S3 bucket instead of the local disk.

To do this:

  1. Create an IAM Role with AmazonS3FullAccess (or a more scoped policy).
  2. Attach this IAM Role to your EC2 instance.
  3. Install the AWS SDK in your OpenClaw project (npm install @aws-sdk/client-s3) if you are writing custom plugins.

By running on AWS, you’re ready to scale from one agent to a thousand.