Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

README.md

🦞 OpenClaw AWS Starter

Create your own OpenClaw AI Agent on Amazon Web Services (AWS) in minutes4. This Terraform template provisions a Free Tier compatible EC2 Instance and automatically installs:

  1. OpenClaw: The AI agent platform
  2. Node.js & PM2: Process management and runtime environment

Important

AWS Free Tier update (July 2025):

  • Recommended (New Accounts): Use t3.small (2GB RAM). It is often free for 6 months via credits.
  • Old Accounts: Use t3.micro (1GB RAM) for 12 months free.
  • Detailed eligibility: Official AWS Free Tier Page

🚀 Quick Start (Two-Phase Setup)

CloudShell sessions are temporary. To avoid losing your files, we use a Two-Phase approach: Build in the cloud, then Control from your local machine.


🟢 Phase 1: In AWS CloudShell (Infrastructure)

  1. Open AWS CloudShell in your preferred region.
  2. Install Terraform (Required once per session):
    wget https://releases.hashicorp.com/terraform/1.9.0/terraform_1.9.0_linux_amd64.zip
    unzip terraform_1.9.0_linux_amd64.zip
    sudo mv terraform /usr/bin/
  3. Clone this repository:
    git clone https://github.com/soohyunme/openclaw-cloud-quickstarter.git
    cd openclaw-cloud-quickstarter/aws
  4. Deploy! 🏗️
    terraform init
    export TF_VAR_aws_region=$AWS_REGION
    terraform apply
    Type yes when prompted.

Tip

To skip the confirmation prompt, you can use terraform apply -auto-approve.

  1. 📥 DOWNLOAD CRITICAL FILES NOW! Use the CloudShell "Actions" > "Download File" menu (top right) to save these to your local PC:
    • .ssh/id_rsa (Your private key)
    • openclaw-cloud-quickstarter/aws/terraform.tfstate (Required to manage/delete later)

Caution

Do not skip Step 7. If your CloudShell session expires, these files are deleted from the cloud, and you will lose control of your instance.


🔵 Phase 2: On Your Local PC (Access & Monitoring)

Now that the instance is running, you can move to your local computer's terminal (Mac, Linux, or WSL).

  1. Find your Downloads folder (or where you saved the files).

  2. Set Key Permissions:

    • Linux/Mac:
      chmod 400 id_rsa
    • Windows (PowerShell):
      icacls .\id_rsa /inheritance:r
      icacls .\id_rsa /grant:r "$($env:username):R"
  3. Create SSH Tunnel & Connect: Run this command and keep it running:

    ssh -i ./id_rsa -L 18789:localhost:18789 ubuntu@<YOUR_INSTANCE_IP>

    (The IP address is shown in the Terraform output in Phase 1.)

  4. Monitor Installation (In the SSH window above): OpenClaw takes ~15 mins to install. Run this inside the SSH session to watch:

    ./check-progress.sh

    While the installation runs, notice that your Dynamic MOTD is already being prepared. Once complete, you can access the dashboard using the full link (with token) shown in the terminal.


📊 Management & Onboarding

🪄 The Onboarding Wizard

Want to connect Discord, Telegram, or change your agent's Persona? Run the interactive wizard inside your SSH session:

openclaw onboard

Tip

Lost your token? Simply log in again! The Dynamic MOTD will show your live dashboard link and token on every login.


🛠️ Advanced Options

🧹 Clean Up (Destroy)

To remove all resources and stop billing (if any):

export TF_VAR_aws_region=$AWS_REGION
terraform destroy

Tip

To skip the confirmation prompt during cleanup, use: terraform destroy -auto-approve

⚠️ Troubleshooting

  • "Control UI requires device identity", "pairing required", or "device token mismatch":
    • This is the most common issue. OpenClaw uses secure tokens for identification.
    • Solution: Always access the dashboard using the Full URL with Token (e.g., http://localhost:18789/#token=...).
    • If you lost your token, run this on your server:
      cat ~/.openclaw/gateway_token
    • Or generate a fresh login URL:
      openclaw dashboard --no-open
    • Step-by-Step Recovery:
      1. Ensure your SSH Tunnel is active.
      2. Clear your browser cookies/local storage for localhost:18789.
      3. Copy/Paste the FULL URL from the command above into your browser.

📝 Notes on Free Tier

  • Instance Type: This template defaults to t3.micro for maximum compatibility with the AWS 12-month Free Tier.
    • Tip: You can override this by running export TF_VAR_instance_type="t3.small" before terraform apply.
  • Public IP (EIP): Includes one Elastic IP. AWS provides 750 hours of public IPv4 for free per month during the first 12 months.
  • Region: Free Tier rules can vary by region. Always check the "Free Tier eligible" tag in your AWS Console before launching.

Enjoy your personal AI Agent! 🦞