# How to Run OpenClaw on AWS Using Lightsail and EC2

> Run OpenClaw on Amazon Web Services (AWS) using Lightsail for quick setup or EC2 for full control. Deploy your AI agent in the cloud and access it from anywhere with 24/7 uptime.

**Published:** Mar 28, 2026 | **Author:** Alex Chen | **Read time:** 12 min read

Deploy OpenClaw on AWS and run your AI agent without hardware limits. This guide shows how to set up OpenClaw on AWS using Lightsail and EC2.

---

Running [OpenClaw](/blog/what-is-openclaw) on AWS is one of the easiest ways to deploy your AI agent with better performance, 24/7 uptime, and remote access.

In this guide, you&apos;ll learn how to run OpenClaw on AWS using Lightsail for quick setup and EC2 for more advanced control.

Running [OpenClaw](/blog/what-is-openclaw) on AWS is one of the easiest ways to deploy your AI agent with better performance, 24/7 uptime, and remote access.

In this guide, you&apos;ll learn how to run OpenClaw on AWS using Lightsail for quick setup and EC2 for more advanced control.


## Minimum PC Requirements




| Component | Minimum | Recommended |
| --- | --- | --- |
| CPU | Dual Core | Quad Core |
| RAM | 4 GB | 8 GB |
| Storage | 5 GB Free | 10 GB Free |
| OS | Windows 10 / Linux / macOS | Windows 11 / Latest OS |

## Recommended AWS Instance




| Type | RAM | Use Case |
| --- | --- | --- |
| t3.small | 2GB | Testing |
| t3.medium | 4GB | Recommended |
| t3.large | 8GB | Better Performance |
| g4dn.xlarge | GPU | Advanced AI Tasks |

## How to Run OpenClaw on AWS


### Which method should I choose?

- Pick **EC2** if you want to use your own AI provider (Anthropic, OpenAI, etc.) or need more control


## Method 1: Amazon Lightsail

Amazon Lightsail has an official OpenClaw blueprint — it installs everything automatically and connects Amazon Bedrock as your AI provider out of the box.


### Step 1: Open the Lightsail Console

Sign in to AWS and go to:

Click **Create instance**.


### Step 2: Choose the OpenClaw Blueprint

- Select your **AWS Region** (choose one close to you)
- Under **Select a platform**, choose **Linux/Unix**
- Under **Select a blueprint**, scroll to **Apps + OS** and click **OpenClaw**


### Step 3: Choose the 4 GB Plan

- Scroll down to **Choose your instance plan**
- Then, Select the **4 GB RAM plan** (recommended for OpenClaw to run smoothly)
- Give your instance a name — for example, `openclaw-lightsail`
- Click **Create instance**
- Wait 2–3 minutes for the instance to show **Running** status


### Step 4: Connect via SSH

In your Lightsail instance, go to the **Getting started** tab and click **Connect using SSH**.

A browser terminal opens. You will see the OpenClaw **dashboard URL** and **access token** printed in the welcome message. Copy both.


### Step 5: Open the Dashboard and Pair Your Browser

- Open the dashboard URL in a new browser tab
- Paste your access token into the **Gateway Token** field
- Go back to the SSH terminal
- Press `y` to continue
- Press `a` to approve device pairing

The dashboard will show **OK** — your browser is now connected to OpenClaw.


### Step 6: Enable Amazon Bedrock

Your instance uses Amazon Bedrock as the AI provider. To activate it:

- In Lightsail, go to the **Getting started** tab
- Copy the provided script
- Open AWS CloudShell at `https://console.aws.amazon.com/cloudshell`
- Paste and run the script

Once complete, go to **Chat** in the OpenClaw dashboard and start using your AI assistant. You can also connect messaging channels like Telegram or [WhatsApp](/blog/connect-openclaw-whatsapp) to chat with your agent from your phone.


## Method 2: EC2 Manual Install (Full Control)

Use this method to choose your own AI provider (Anthropic, OpenAI, etc.) and have full control over your OpenClaw setup.


### Step 1: Launch an EC2 Instance

- Sign in to AWS Console → search **EC2** → click **EC2**
- Click **Launch Instance**
- Fill in: Name: `openclaw-server`
- OS: **Ubuntu Server 24.04 LTS** (64-bit x86)
- Instance type: `t3.small` (minimum) or `t3.medium` (recommended)
- Under **Key pair**, click **Create new key pair**: Name: `openclaw-key`
- Format: `.pem`
- Click **Create** — the file will download automatically


### Step 2: Set Up the Security Group

In **Network settings** → click **Edit**:

- Enable **Allow SSH traffic from: My IP**
- Leave everything else disabled

Click **Launch instance** and wait 1–2 minutes for it to reach **Running** status.


### Step 3: Connect via SSH

Open a terminal on your local machine. Fix key file permissions:

Connect to your EC2 instance (replace with your actual IP):

You are now inside the server.


### Step 4: Update the Server


### Step 5: Install Node.js 22

Make sure the output shows `v22.x.x` before continuing.


### Step 6: Install OpenClaw

Follow the on-screen wizard:

- Choose your AI provider (Anthropic, OpenAI, Gemini, etc.)
- Enter your API key
- Optionally connect a messaging channel — Discord, Telegram, WhatsApp, [Slack](https://www.ampere.sh/openclaw-for-slack), or others


### Step 7: Start the Gateway

Check it is running:


### Step 8: Auto-Start on Reboot

Set up OpenClaw to restart automatically when the server reboots:

Paste the following:

Save (`Ctrl+O`, Enter, `Ctrl+X`), then run:


## Common Issues and Fix



| Issue | Fix |
| --- | --- |
| Lightsail dashboard won't connect | Copy token exactly from the SSH terminal — no extra spaces |
| Bedrock not working on Lightsail | Run the CloudShell script from the Getting started tab |
| SSH permission denied (EC2) | chmod 400 openclaw-key.pem |
| EC2 connection timeout | Check Security Group — SSH port 22 must allow your IP |
| openclaw: command not found | source ~/.bashrc then retry |
| Node version too low | nvm install 22 && nvm use 22 |
| Gateway not starting | openclaw gateway start |
| Gateway error | openclaw doctor |
| Agent stops after server reboot | Enable systemd service — see Step 8 |

If you prefer to skip AWS setup entirely, you can deploy OpenClaw on [Ampere.sh](https://www.ampere.sh) in 60 seconds with no server setup required.


## Skip the AWS Setup?

Running OpenClaw on AWS requires configuring instances, networking, and security settings, which takes time. With Ampere.sh, deploy OpenClaw in 60 seconds.

[Deploy on Ampere.sh →](https://www.ampere.sh/setup)


## Frequently Asked Questions

### Can I run OpenClaw on AWS for free?

Yes, you can run OpenClaw using the AWS Free Tier, but performance may be limited. For better performance, it's recommended to use instances like t3.small or t3.medium.

### Do I need a powerful PC to run OpenClaw on AWS?

No. Since OpenClaw runs on AWS, your local PC only needs a browser and internet connection.

### Can I run OpenClaw 24/7 on AWS?

Yes. AWS allows OpenClaw to run continuously, even when your computer is turned off.

### Can I access OpenClaw remotely?

Yes. You can access OpenClaw from anywhere using your AWS instance IP address.

### Do I need Docker to run OpenClaw on AWS?

Yes, most OpenClaw setups use Docker for easier deployment and management.

### Can I connect OpenClaw to WhatsApp or Telegram on AWS?

Yes. Once OpenClaw is running, you can connect messaging platforms like WhatsApp, Telegram, Discord, and more.

### Can I upgrade AWS resources later?

Yes. AWS allows you to upgrade CPU, RAM, and storage anytime.

### Can I stop the AWS instance when not using OpenClaw?

Yes. You can stop the instance anytime to reduce costs.

### Is GPU required for OpenClaw on AWS?

No. GPU is optional. Most users can run OpenClaw without GPU.
