Situatie
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.
Solutie
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
- 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.
- Go to Lightsail in the AWS Console.
- Create a new Linux/Unix instance.
- Choose an instance size (4+ GB RAM recommended for AI workloads).
- Add your SSH key or use the default.
- Launch.
Once your instance is running, note its public IP.
- 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
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
Verify Node version:
node -v
From your server’s terminal:
curl -fsSL https://openclaw.ai/install.sh | bash
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
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
Add your API keys when prompted.
Step 6 — Start & Access Your OpenClaw
Start the daemon (if not already running):
openclaw gateway --port 18789
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.
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.
Leave A Comment?