← All guides

OpenClaw on EC2 With No SSH and No Open Ports

I made a video walking through the most secure way to run OpenClaw on AWS, and here are the exact steps written out so you can follow along without pausing. The goal: OpenClaw on Amazon EC2 with no open port and no SSH key, in six CLI commands, nothing exposed to the internet, fo

I made a video walking through the most secure way to run OpenClaw on AWS, and here are the exact steps written out so you can follow along without pausing. The goal: OpenClaw on Amazon EC2 with no open port and no SSH key, in six CLI commands, nothing exposed to the internet, for about $15 a month.

OpenClaw is an open-source autonomous AI agent that browses the web, works with files, and connects to messaging channels. Once it lives on a server it keeps running without your laptop.

Six commands, no console

The secure deploy uses an AWS Samples CloudFormation template and SSM Session Manager. Normally you SSH in over port 22 with a key file you have to guard. SSM works the other way: the instance has an SSM agent that talks out to AWS over HTTPS only, no inbound port, and your IAM credentials are the login.

You install the AWS CLI and the Session Manager plugin, clone the template repo, and deploy the stack. The template stands up a VPC, the EC2 instance, IAM roles, and security groups, and installs OpenClaw for you. Then you grab the instance ID from the stack outputs, start an SSM tunnel, and pull the OpenClaw URL and token. Open it in the browser and the agent is ready to chat. No AWS Console. No SSH keys. No open ports. The port forward exposes OpenClaw only on localhost.

The instance is a T4g.small, the smallest Graviton box, 2GB of RAM, about $12 a month. It runs Claude Haiku through Amazon Bedrock, so the IAM role handles auth and you never manage a separate API key. Setting create VPC endpoints to false saves about $20 a month, fine for personal use.

Cost and cleanup

EC2 is roughly $12 a month, storage about $2.40, and Haiku is pay per use at around a dollar per million input tokens. Light use is a couple of dollars, heavy use can pass $100, so watch it. Switch to Nova 2 Lite at 30 cents per million if you want it cheaper, which is one stack update. When you are done, one delete-stack command tears down every resource at once. A running instance bills whether you use it or not.

The beginner alternative

If six commands sound like a lot, AWS now ships an OpenClaw blueprint on Lightsail.

You launch it from the Lightsail console, pick the 4GB plan (recommended, and it comes with a free trial window), name the instance, and pair your browser. The instance is pre-configured with Bedrock as the default provider, but you still run one script in CloudShell to grant Bedrock access. The default model is Claude Sonnet, so switch it to Haiku to keep costs down. One thing worth knowing: the Lightsail build sandboxes OpenClaw to its own folder and blocks browser access by default, so it is more locked down than a from-scratch install.

Where to start

Comfortable in a terminal, take the EC2 path for the tightest setup. Newer to AWS, watch the Lightsail walkthrough first to see what each piece does, then come back to secure it. Both videos run through every command.

If you want to size the running cost before you deploy, openclawdc.com has a calculator. I specialize in secure, low-cost AWS deploys like this. Book a call at cloudyeti.io/meet.

Need OpenClaw fixed live?

Remote rescue sessions for gateway, auth, tunnel, VPS, and model access problems.

See Rescue Session

Read next

OpenClaw Enterprise Security: Private Bedrock Access with VPC PrivateLink
How to connect OpenClaw on AWS LightSail to Bedrock without exposing traffic to the internet. VPC PrivateLink, security groups, and private subnet architecture for enterprise AI.
Claude Code and Codex, Running on a Local Model for Nothing
I made two videos on this: a live demo and a full crash course. Most people assume Claude Code and Codex only work with a paid plan behind them. They do not. You can wire either one to a model running on your own machine and pay zero per run. Here is the gist of both, enough to s
Open Weights Aren't Local Anymore: The Honest Math on Frontier Open Releases (July 2026)
Kimi K3 is 2.8T params and ~1.4TB of weights. GLM-5.2 needs ~256GB at 2-bit. Laguna S 2.1 fits a 128GB Mac. Open weights split into three tiers in 2026 — only one of them is local.
Qwen 3.7 Flash Spotted: What We Know About the Next Open-Weights Qwen (July 2026)
qwen3.7-flash is live on OpenRouter — 1M native context, $0.03/M input, $0.13/M output. Here's the confirmed evidence, the community's small-MoE read, and what is still unknown about open weights.