DEV Community

Cover image for How to Set Up OpenClaw AI on AWS
Brayan Arrieta
Brayan Arrieta

Posted on

How to Set Up OpenClaw AI on AWS

OpenClaw AI is an open-source, self-hosted AI assistant designed to execute real tasks, integrate with tools, and give you full control over your data and workflows. Running OpenClaw on AWS allows you to keep ownership of your infrastructure while benefiting from scalability, security, and reliability.

In this guide, weโ€™ll walk step by step through deploying OpenClaw AI on AWS, from choosing the right service to securing your setup.


๐Ÿง  What Is OpenClaw AI?

OpenClaw is a modular AI agent framework that can:

  • Interact with LLMs (OpenAI, Anthropic, etc.)
  • Execute tools and workflows
  • Integrate with messaging platforms
  • Run locally or in your own cloud

Unlike managed AI platforms, OpenClaw runs entirely under your control.

๐Ÿ‘‰ Project website: https://openclaw.ai


๐Ÿ“Œ Prerequisites

Before we begin:

  • An AWS account (sign up at aws.amazon.com)
  • Basic AWS comfort (creating instances, SSH keys)
  • A Linux server (Ubuntu or Amazon Linux recommended)
  • Familiarity with Node.js (OpenClaw requires Node v22+)
  • (Optional) API keys for models (Anthropic, OpenAI, etc.) โ€” depending on which models you plan to use
  • (Optional) A domain name for HTTPS access

๐Ÿง  Step 1 โ€” Choose Your AWS Deployment Option

You have several good ways to host a long-running service like OpenClaw on AWS:

Option A โ€” Amazon Lightsail (Recommended for Beginners)

Lightsail gives you a simple VPS with a predictable monthly price โ€” ideal for one server with minimal AWS configuration. It supports VPS instances ready for Node.js deployments without complicated networking.

Pros:

  • Easy to launch and manage
  • Fixed pricing with predictable cost
  • Great for a single server with Node apps
  • Minimal AWS complexity

Cons:

  • Less scalable than EC2 or container services

Option B โ€” Amazon EC2 (Advanced / Scalable)

EC2 gives you full control over servers: choose instance type, configure network/security, and scale later. Youโ€™ll manually set up Node.js and OpenClaw on the instance.

Pros:

  • Full compute control
  • Flexible networking and scaling
  • Integrates well with other AWS services

Cons:

  • Requires more AWS knowledge

๐Ÿ› ๏ธ Step 2 โ€” Launch Your AWS Server

Recommended Configuration

  • OS: Linux
  • Instance size: 4 GB RAM or higher
  • Open ports:
    • 22 (SSH)
    • 18789 (OpenClaw Gateway โ€“ restrict later)

After launching, note the public IP address.

For Lightsail:

  1. Go to Lightsail in the AWS Console.
  2. Create a new Linux/Unix instance.
  3. Choose an instance size (4+ GB RAM recommended for AI workloads).
  4. Add your SSH key or use the default.
  5. Launch.

Once your instance is running, note its public IP.

For EC2:

  • Open EC2 Console > โ€œLaunch Instanceโ€.
  • Choose Ubuntu 24.04 LTS or Amazon Linux.
  • Allow ports 22 (SSH) and any app port youโ€™ll access (e.g., 18789 for OpenClaw UI).
  • Assign or create an SSH key pair.
  • Launch and note the IP.

๐Ÿ”Œ Step 3 โ€” Install Dependencies on Your Server

SSH into your instance:

ssh -i ~/.ssh/yourkey.pem ubuntu@YOUR_INSTANCE_IP
Enter fullscreen mode Exit fullscreen mode

Note: As an alternative, we can use EC2 Connect

Install Node.js (v22+ required):

curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash -
sudo apt-get install -y nodejs
Enter fullscreen mode Exit fullscreen mode

Verify Node version:

node -v
Enter fullscreen mode Exit fullscreen mode

๐Ÿ“ฅ Step 4 โ€” Install OpenClaw

From your serverโ€™s terminal:

curl -fsSL https://openclaw.ai/install.sh | bash
Enter fullscreen mode Exit fullscreen mode

This installer detects your OS and automatically installs Node.js + OpenClaw CLI. Once ready, you can start the interactive onboarding wizard:

openclaw onboard --install-daemon
Enter fullscreen mode Exit fullscreen mode

This will:

  • Configure the OpenClaw Gateway
  • Create your workspace and default agent
  • Help you choose which messaging channels to connect (Telegram, WhatsApp, etc.)

โš™๏ธ Step 5 โ€” Configure Your AI Model

During the wizard or after via the CLI, link your OpenAI/Anthropic (or other) API keys. This lets OpenClaw use real LLM models for generation and reasoning.

openclaw configure
Enter fullscreen mode Exit fullscreen mode

Add your API keys when prompted.


๐Ÿšช Step 6 โ€” Start & Access Your OpenClaw

Start the daemon (if not already running):

openclaw gateway --port 18789
Enter fullscreen mode Exit fullscreen mode

Now OpenClawโ€™s control UI is usually available at:

http://YOUR_INSTANCE_IP:18789/

From here, you can interact with your AI setup, see logs, and configure workflows.


๐Ÿ” Step 7 โ€” Secure Your Setup (Important!)

Because OpenClaw can execute high-level commands and interact with external services:

  • Do not expose the Gateway port to the public internet without protection. Instead:
    • Use a reverse proxy (e.g., Nginx) with HTTPS
    • Set up a VPN or SSH tunnel
    • Use firewall rules to restrict access
    • Review security group rules
  • Run OpenClaw as a non-root user
  • Rotate API keys periodically

Security is especially crucial for powerful tools like OpenClaw, which can execute system tasks.


๐Ÿ’พ Step 9: Backups & Reliability

Best practices:

  • Store configs and workspaces in S3
  • Use snapshots or AMIs
  • Assign an Elastic IP
  • Enable CloudWatch logs for monitoring

๐Ÿ’ก Cost Considerations

Typical monthly cost (small setup):

Service Approx Cost
EC2 / Lightsail $10โ€“40
Data transfer Low
LLM usage Variable

๐Ÿ’ก Lightsail is usually the cheapest option for personal use.


๐ŸŽ‰ Conclusion

By deploying OpenClaw AI on AWS, you gain:

  • โœ… Full ownership of your AI
  • โœ… Scalable and reliable infrastructure
  • โœ… Secure, customizable deployments
  • โœ… Freedom from vendor lock-in

This setup is perfect for personal assistants, internal automation, or AI-driven workflows.

Top comments (0)