VPN07
Try Free

OpenClaw on AWS EC2 Free Tier: Run a 24/7 Personal AI Agent at Absolutely Zero Server Cost (2026)

March 3, 2026 18 min read AWS EC2 OpenClaw Free Tier

What This Guide Covers: How to deploy OpenClaw on Amazon AWS EC2's free tier — the t2.micro instance that AWS offers at zero cost for 12 months (new accounts) or at minimal ongoing cost for existing accounts. You will have a 24/7 AI personal agent running on Amazon's global infrastructure, accessible via Telegram or WhatsApp from anywhere in the world. Estimated total cost: $0/month for server (AI API usage fees may apply). Setup time: 25–35 minutes.

Why AWS EC2 Is Ideal for Running OpenClaw 24/7

Amazon Web Services (AWS) EC2 is the world's most widely used cloud computing platform. The EC2 Free Tier offers a t2.micro instance (1 vCPU, 1GB RAM) for 750 hours per month at no charge for the first 12 months after account creation. Since a month has approximately 720 hours, this effectively means one t2.micro instance running 24/7 for free — perfect for OpenClaw.

AWS's global infrastructure gives OpenClaw a significant advantage over running on a home PC or Raspberry Pi: guaranteed uptime, automatic hardware redundancy, elastic IP addresses, and proximity to Anthropic and OpenAI's API servers (which are hosted on major US cloud providers that have direct AWS peering). This proximity translates to significantly lower AI API latency compared to home setups.

$0
Monthly Server Cost
99.9%
AWS Uptime SLA
30+
AWS Regions
750h
Free Hours/Month

AWS Free Tier Details (2026): What's Actually Free?

  • EC2 t2.micro instance: 750 hours/month free for 12 months (new accounts)
  • EBS Storage: 30GB General Purpose SSD (gp2) free per month
  • Data Transfer: 100GB outbound data free per month
  • Elastic IP: One static IP free when attached to a running instance
  • ⚠️ Not free: AI API usage (Anthropic Claude, OpenAI GPT) — these are billed separately by the AI provider

Step 1: Create AWS Account and Launch EC2 Instance

If you do not yet have an AWS account, go to aws.amazon.com and sign up. You will need a credit or debit card (AWS validates it but does not charge unless you exceed free tier limits). The signup process takes about 10 minutes.

Once logged into the AWS Console, follow these steps to launch your free EC2 instance:

1

Choose Region

In the AWS Console top-right corner, select a region geographically close to you. For best performance with AI APIs: us-east-1 (N. Virginia) or us-west-2 (Oregon) for North America; eu-west-1 (Ireland) for Europe; ap-southeast-1 (Singapore) for Asia. Anthropic's API servers have good peering with all these regions.

2

Launch EC2 Instance

Go to EC2 → Instances → Launch instances. Set Name to "openclaw-agent". Under Application and OS Images, select Ubuntu Server 22.04 LTS (marked as "Free tier eligible"). Under Instance type, select t2.micro (marked "Free tier eligible"). This gives you 1 vCPU and 1GB RAM — sufficient for OpenClaw with light to moderate usage.

3

Create Key Pair for SSH

Under Key pair (login), click "Create new key pair". Name it "openclaw-key", select RSA format, and download the .pem file. Save this file safely — you need it to SSH into your instance. Set its permissions: chmod 400 openclaw-key.pem on macOS/Linux.

4

Configure Security Group

Under Network settings, click "Create security group". Enable Allow SSH traffic from Anywhere (or restrict to your IP for better security). OpenClaw itself does not need any inbound ports — it connects outbound to Telegram/WhatsApp and AI APIs. Click Launch Instance.

5

Assign Elastic IP (Recommended)

Go to EC2 → Elastic IPs → Allocate Elastic IP address → Allocate. Then select the new IP → Actions → Associate Elastic IP. Select your "openclaw-agent" instance. This gives you a permanent IP that does not change when the instance restarts — important if you configure firewall rules or use the IP in scripts.

Step 2: Connect to Your EC2 Instance via SSH

Wait 1–2 minutes after launching for your instance to enter the "running" state. Then find its Public IPv4 DNS in the instance details panel. Connect via SSH from your local computer:

# macOS / Linux: connect via SSH # Replace YOUR_EC2_IP with your instance's public IP ssh -i openclaw-key.pem ubuntu@YOUR_EC2_IP # Windows (PowerShell or Windows Terminal): ssh -i openclaw-key.pem ubuntu@YOUR_EC2_IP # If permission denied on the .pem file: chmod 400 openclaw-key.pem # macOS/Linux only # Verify you are logged in as ubuntu user on EC2 whoami # Should output: ubuntu uname -a # Should show Ubuntu Linux

Note on AWS Free Tier Bandwidth: The free tier includes 100GB of outbound data transfer per month. OpenClaw's API calls (sending questions to Claude/GPT, receiving answers) use very little data — typically 10–50KB per interaction. Even with 1,000 interactions per day, you would use less than 1.5GB monthly, well within the free allowance.

Step 3: Install Node.js 22 and OpenClaw on EC2

Once connected to your EC2 instance, run these commands to prepare the system and install OpenClaw. Ubuntu 22.04 LTS has excellent compatibility with Node.js's official installer.

# Update Ubuntu packages sudo apt update && sudo apt upgrade -y # Install essential tools sudo apt install -y curl wget git build-essential # Add NodeSource repository and install Node.js 22 LTS curl -fsSL https://deb.nodesource.com/setup_22.x | sudo -E bash - sudo apt install -y nodejs # Verify Node.js installation node --version # v22.x.x npm --version # 10.x.x+ # Install OpenClaw curl -fsSL https://openclaw.ai/install.sh | bash # OR: npm install -g openclaw # Verify OpenClaw installation openclaw --version

Optimize t2.micro for OpenClaw (1GB RAM)

The t2.micro has 1GB RAM. OpenClaw typically uses 100–300MB. To ensure stable operation, add a 1GB swap file — this prevents out-of-memory errors during occasional heavy operations:

sudo fallocate -l 1G /swapfile sudo chmod 600 /swapfile sudo mkswap /swapfile sudo swapon /swapfile echo '/swapfile none swap sw 0 0' | sudo tee -a /etc/fstab

Step 4: Configure OpenClaw on AWS EC2

Run the OpenClaw onboarding wizard over your SSH connection:

openclaw onboard

For AWS EC2 deployments specifically, here are the optimal configuration choices:

AI

AI Model: Claude or GPT-4o

Both work excellently on AWS EC2. If your EC2 is in us-east-1 (Virginia), Anthropic's API servers (also primarily US-based) will respond in under 1 second. This is the best latency you can get for Claude API calls anywhere in the world. Get your free API key at console.anthropic.com — new accounts receive $5 free credits.

📱

Messaging: Telegram Bot

Telegram is the standard choice for server deployments. On AWS EC2, Telegram webhook mode (rather than polling) is also possible for extremely low latency responses — OpenClaw supports both. For initial setup, polling mode is simpler and works perfectly on t2.micro without additional configuration.

🌐

Permissions: Server-Appropriate Scope

On an AWS EC2 instance, give OpenClaw permission to read/write files within your home directory, execute bash commands, and browse the web. Avoid granting permissions to system-level directories unless you specifically need them — the principle of least privilege applies even to AI agents on cloud servers.

Step 5: Configure PM2 for Auto-Restart on EC2

PM2 is the industry-standard process manager for Node.js applications on Linux servers. It ensures OpenClaw restarts automatically after crashes and survives EC2 reboots — critical for an always-on agent.

# Install PM2 globally npm install -g pm2 # Start OpenClaw with PM2 pm2 start openclaw --name "openclaw-agent" --log /home/ubuntu/.openclaw/pm2.log # Configure PM2 to start on system reboot pm2 startup # PM2 will print a command starting with "sudo env PATH=..." # Copy and run that exact command # Save the current PM2 process list pm2 save # Verify everything is running pm2 status pm2 logs openclaw-agent --lines 20

After running pm2 startup, copy and execute the exact sudo env PATH=... command that PM2 prints. This registers PM2 as a systemd service, ensuring OpenClaw starts automatically when your EC2 instance boots after a planned or unplanned restart.

Auto
Crash Recovery
Boot
Auto-Start
Logs
Centralized
24/7
Always On

Step 6: Secure Your EC2 OpenClaw Instance

Running a public cloud server requires basic security hardening. Since OpenClaw stores your AI API keys and potentially sensitive files, taking these steps protects you from unauthorized access.

# 1. Disable password authentication for SSH (key-only) sudo sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/' /etc/ssh/sshd_config sudo systemctl restart ssh # 2. Install and configure UFW firewall sudo apt install -y ufw sudo ufw allow OpenSSH sudo ufw enable sudo ufw status # Should show: OpenSSH ALLOW # 3. Enable automatic security updates sudo apt install -y unattended-upgrades sudo dpkg-reconfigure --priority=low unattended-upgrades # 4. Check OpenClaw config file permissions chmod 600 ~/.openclaw/config.json # API keys file should be private

These four steps cover the essential security baseline for a public-facing EC2 instance running OpenClaw. Additionally, in the AWS Console, review your Security Group to ensure no unnecessary inbound ports are open — OpenClaw only needs outbound access (SSH inbound for your management only).

Step 7: Test Your AWS EC2 OpenClaw Agent

With PM2 running OpenClaw and your Telegram bot connected, send these test messages from your phone or computer:

You: What AWS region are you running in? Check my server's public IP.

Your agent should fetch its own EC2 metadata and report the region and IP.

You: How much memory is available on my EC2 instance right now?

Tests bash command execution — runs "free -h" and reports results.

You: Search the web for today's top tech news and give me 3 bullet points.

Tests web browsing through your EC2's internet connection.

You: Remind me every day at 9am to check my emails.

Tests scheduled task (cron) creation — requires the EC2 to be running 24/7.

Real Cost Breakdown: AWS EC2 + OpenClaw in 2026

Let us be transparent about costs. The server itself is free, but you will have AI API usage fees depending on how much you chat with your agent. Here is a realistic monthly estimate for a casual user:

AWS EC2 t2.micro (Free Tier, 12 months) $0.00
AWS EBS 8GB storage (Free Tier) $0.00
Elastic IP (free when attached to running instance) $0.00
Claude API usage (50 messages/day × Claude Haiku pricing) ~$0.50–$2.00
Total monthly estimate $0.50–$2.00

Using Claude Haiku (Anthropic's most efficient model) keeps API costs extremely low for most personal use cases. For heavier use or Claude 3.5 Sonnet, budget $3–$10/month in API fees. After the 12-month free tier expires, EC2 t2.micro costs approximately $8.50/month on-demand in us-east-1 — or under $4/month with a 1-year Reserved Instance purchase.

Why VPN07 Makes Your AWS OpenClaw Even Better

Even though AWS EC2 already provides fast connectivity, VPN07 adds two additional layers of value for OpenClaw users. First, it routes your API calls through VPN07's optimized network, which in some regions (especially Asia-Pacific and Eastern Europe) provides measurably lower latency to AI API endpoints than AWS's default routing. Second, VPN07 provides residential-grade IP addresses that AI API providers treat more favorably — reducing the risk of unexpected rate limiting that sometimes affects datacenter IPs.

Beyond the AWS EC2 instance itself, VPN07 protects all your OpenClaw access points. When you connect to your EC2 via SSH from public Wi-Fi, VPN07 ensures that connection is encrypted and private. When your agent browses the web on your behalf, VPN07's 70+ country network gives it access to geo-specific content and lower-latency browsing in any region. At just $1.5/month with 1000Mbps bandwidth, VPN07 is a small price for significantly enhanced agent capability.

OpenClaw EC2 Performance: Direct vs VPN07 Routing

0.8s
Claude API (us-east-1, direct)
0.7s
Claude API (us-east-1, VPN07)
6.2s
Claude API (AP, direct)
1.4s
Claude API (AP, VPN07)

Complete Your AWS Setup with VPN07

1000Mbps dedicated bandwidth — maximum AI agent performance from any location

VPN07 is the premium network layer that serious OpenClaw users add to their AWS EC2 setups. With 1000Mbps bandwidth, 70+ global server locations, and 10 years of unbroken reliability, VPN07 ensures your AI agent delivers world-class performance regardless of where your EC2 instance is hosted. At just $1.5/month — significantly less than AWS's cheapest instance after free tier — VPN07 is the most cost-effective performance upgrade available for your OpenClaw AWS deployment. Try it free for 30 days.

$1.5
Per Month
1000Mbps
Bandwidth
70+
Countries
30-Day
Money-Back

Related Articles

$1.5/mo · 10 Years Trusted
Try VPN07 Free