AWS Builder Center
My Always-On Agent: Running Kiro Crew 24/7 on Cheap EC2 

My Always-On Agent: Running Kiro Crew 24/7 on Cheap EC2 

My agent that never sleeps. Kiro Crew on a self-healing EC2 Spot setup that comes back on its own, with all its memory, in minutes.

Kiro Ambassador


The problem: my agents went to sleep when my desktop was off

 Kiro Crew  is an open-source agent workspace from the Kiro team. You talk to it from a web dashboard, the desktop app, the CLI, or chat apps like Slack and Discord. It runs scheduled jobs, heartbeats and long checkpointed tasks. The default agent runs on the  Kiro CLI  (kiro-cli), so model usage counts against your Kiro plan. Kiro Crew itself has no separate fee.
But every "keeps working while you're away" feature assumes the Gateway is running. On my desktop it often wasn't. When I shut it down or went offline:
  • the 9 a.m. scheduled summary didn't run,
  • a long task stopped halfway,
  • and a Discord message I sent from my phone got no answer.
I wanted an agent that keeps working without me: running jobs on schedule, answering in Discord or Telegram wherever I am, and picking up long tasks where it left off. That means a cloud server that never needs babysitting.

Ec2 instance on aws console

This article shows how I run Kiro Crew as an always-on AI agent in the cloud, using my setup  4regab/kirocrew-ec2 . By the end, you'll have an agent that:
  • stays on 24/7 on a single EC2 Spot instance, whether your computer is on or not,
  • heals itself after a Spot interruption, usually within 3 to 8 minutes, with nobody touching it,
  • remembers everything, because sessions, memory, lessons and bot tokens live on one encrypted EBS volume,
  • is reachable from anywhere through Discord/Telegram and Systems Manager, with no inbound ports open, and
  • costs about $50–$75 a month instead of $154–$233 (us-east-1).

Running 24/7 doesn't have to cost a lot

An always-on VPS costs money every hour, so I put it on Spot. Spot uses spare AWS capacity, so it's cheap, but AWS can take the instance back with two minutes' notice. A Kiro Crew gateway is stateful. Its home directory holds the virtualenv, ~/.kiro/crew, sessions, memory and channel tokens. My first version (a lone Spot instance running a tmux while true loop) stayed dead after every reclaim until I noticed.
The repo makes "always on" survive Spot with one idea: keep the compute disposable and the agent's memory persistent.
  • Every bit of state lives on one encrypted EBS data volume, mounted at /home/ec2-user. Instances come and go; the agent's memory stays.
  • A custom AMI has the OS packages and five systemd units baked in, so every new instance boots straight into "agent on".
  • An Auto Scaling group with min 1 and max 1 makes sure an agent is always running. When AWS takes one instance, the ASG launches the next, which attaches the same volume and starts the gateway.

Architecture of an always-on agent

AWS architecture diagram. In one Availability Zone and public subnet, an Auto Scaling group (min 1,


Design choice
What keeps the agent on
Spot ASG, min 1 / max 1, 12 instance types
Reclaimed instances are replaced automatically; more pools, faster recovery; max 1 means one agent per bot token.
Persistent EBS volume at /home/ec2-user
Sessions, memory, schedules and task checkpoints survive replacement. Same agent, new instance.
kirocrew-storage.service
Attaches and verifies the volume before the agent starts, so it never wakes up with amnesia.
kirocrew.service (Restart=always, StartLimitIntervalSec=0)
The gateway starts at boot without anyone logging in, and restarts after any crash, forever.
kirocrew-spot-watch.service
Polls metadata every 5 s; on an interruption signal, stops the agent and hands the volume over cleanly.
kirocrew-selfheal.service
If storage fails, marks the instance Unhealthy so the ASG replaces it instead of idling silently.
Outbound-only Discord/Telegram
The agent reaches me wherever I am, with nothing listening on the internet.
SSM Session Manager
I can reach the box from anywhere, even though every replacement has a new IP.
CloudWatch alarm → SNS
If "always on" ever fails (no Spot capacity), I get an email.



Building the always-on agent

Every command and check lives in the setup guide,  docs/02-setup-guide.md , in my repo  4regab/kirocrew-ec2 , so I won't repeat them here. The $AWS_REGION, $ASG_NAME and other variables later in this post come from the repo's config.env, the same file the guide and the prompt use. Paste this prompt from the README into Kiro and it works through the guide with you:
Help me deploy https://github.com/4regab/kirocrew-ec2 on my AWS account.
1. Clone the repo. Read README.md, then docs/02-setup-guide.md in full.
2. Copy config.env.example to config.env and ask me for each value you can't
look up yourself. Never commit config.env.
3. Do the setup guide's steps in order, one step at a time. Run that step's
checks and show me the results before you start the next step.
4. Ask me before anything that deletes, formats, terminates or causes downtime:
mkfs, delete-*, terminate-*, detach-volume, and all of step 8 (the cutover).
5. Don't change the design: one AZ, ASG max size 1, and the data volume stays
out of the launch template.
6. If something fails, check docs/04-troubleshooting.md before you try a fix.

Living with an always-on agent

From the desktop, I find the current instance (its ID and IP change with every replacement) and connect:
aws autoscaling describe-auto-scaling-groups --region $AWS_REGION \
  --auto-scaling-group-names $ASG_NAME \
  --query 'AutoScalingGroups[0].Instances[].[InstanceId,InstanceType,LifecycleState,HealthStatus]' \
  --output table
aws ssm start-session --region $AWS_REGION --target <instance-id>
tmux attach -t kiro          # read-only live log tail; Ctrl-B then D to leave
The gateway runs under systemd, not tmux; the kiro session only tails journalctl -u kirocrew -f, so detaching never stops the agent. Code and state live on the volume, so deploying is git pull plus sudo systemctl restart kirocrew, with no AMI rebuild.
The dashboard binds to localhost:5476 by default, and Kiro Crew's docs suggest a tunnel for remote hosts. With no SSH ingress, an SSM port-forward fits:
aws ssm start-session --region $AWS_REGION --target <instance-id> \
  --document-name AWS-StartPortForwardingSession \
  --parameters '{"portNumber":["5476"],"localPortNumber":["5476"]}'
This is how I reach the dashboard from my desktop. On my phone I normally use Tailscale. Tailscale isn't baked into the custom AMI yet, so a Spot replacement drops it and I reconnect it by hand. That's a known gap in this self-heal setup.

What always-on unlocks

These are Kiro Crew features (from the official README, docs and changelog) that only really pay off when the Gateway never sleeps:
  • Scheduled jobs that actually fire. The README's example, "Every weekday at 9, summarize the open work I should review", becomes a timezone-aware recurring job delivered to the surface you choose, like Slack. Script jobs run without a model call, so they use no Kiro credits.
  • Long tasks that outlive your session. Hand it a task spec, like "Implement this migration plan and stop if the tests fail", and it plans, validates, retries and resumes from checkpoints. Sessions, memory, schedules and task checkpoints survive Gateway restarts, and on this setup they also survive a Spot replacement, because they sit on the EBS volume.
  • Watching things for you. Monitoring watches pull requests, and Monitor Loops keep a session checking a PR, CI run or deployment until an exit condition fires.
  • Talking to it from your phone. Slack and Discord threads become the agent's front door. Every supported channel lets the agent message you first, so results come to you.
  • Parallel work. Subagents fan out ("research these three options in parallel and recommend one").
  • Bots that keep their own context. A Bot is a named assistant with its own workspace, memory, agent template and model. Each one has a standing thread on the Bots page that reopens with its history, even after a gateway restart. On this setup that history sits on the EBS volume, so it also survives a Spot replacement.
  • Several sessions at once. Each dashboard tab runs its own agent session in parallel, so I can keep a long task going in one tab and ask something quick in another. Because the gateway never sleeps, none of them stops when I shut down my desktop.
  • Conductor mode for bigger goals. It is still labelled a preview (Ultra Mode in the app), but it no longer needs a Feature Previews switch. A conductor session splits a goal into items in a shared work ledger and starts one worker session per item. It checks each finished item against a condition set before the work began, instead of taking the worker's word for it. The items are meant to be long-running work, so this suits a gateway that never sleeps.

What 24/7 costs

These are the repo's numbers for us-east-1, Linux, 730 hours a month. On-Demand prices come from the AWS Pricing API, and Spot comes from describe-spot-price-history in us-east-1d, checked 2026-11-15. Spot prices change every hour, so check yours before you start:

Size
Main type
On-Demand
Spot (us-east-1d)
4 vCPU / 16 GiB
m5.xlarge
$0.192/hr = $140.16 /mo
$0.0497/hr = $36.28 /mo
8 vCPU / 32 GiB (default)
t3a.2xlarge
$0.3008/hr = $219.58 /mo
$0.0839/hr = $61.25 /mo

I run the 32 GiB default (t3a.2xlarge) since this agent handles several courses and tasks at once. If you only need it for one course or lighter work, the 16 GiB option (m5.xlarge) is enough, at about $36 a month for the Spot instance instead of $61. The default instance list has only 32 GiB types, so to switch, copy the 16 GiB list from docs/05-cost-and-tradeoffs.md into config.env and templates/asg.json.
Fixed extras come to about $13.75/month: public IPv4 $3.65, 100 GiB gp3 data volume $8.00, 20 GiB boot volume $1.60, AMI snapshot ~$0.50. SSM, the ASG, IAM, EBS encryption, SNS (first 1,000 emails) and the first 10 alarms are free. That's ~$50 (16 GiB) or ~$75 (32 GiB) a month for a 24/7 agent on Spot, vs ~$154 or ~$233 On-Demand.


Kiro Crew's own security features

An agent with real tool access that runs all day and night needs limits I don't have to watch. These are the ones Kiro Crew documents for itself. They lower the risk of a mistake or a prompt injection doing damage, but none of them is a promise that misuse can't happen.
  • An OS-level sandbox around the agent. Kiro Crew runs the agent process inside its own sandbox, a user namespace on Linux. The default auto setting uses the standard tier, which hides ~/.gnupg, ~/.docker, ~/.azure, ~/.config/gcloud and the secrets vault from the agent's commands. It leaves ~/.aws, ~/.ssh and ~/.kube visible so the aws CLI and git-over-SSH still work. The strict tier hides those too, but then those tools stop working inside the agent. My box runs the default auto setting.
  • Blocked commands, checked before they run. A deny list refuses things like reading credential files, rm -rf /, aws … delete-* and commands that post a local file to the network. Refusals are audit-logged, and every config change is written to the security event log. Kiro Crew's docs call this layer friction against a direct command, not a security boundary. The sandbox is what fences a process in.
  • Credential redaction. Kiro Crew redacts credentials across every path the model's output takes. It does not scrub everything you see: the dashboard terminal is your own shell and shows exactly what it printed. That output is scanned when it is handed to the agent.
  • A Secrets Vault. Each entry is encrypted with AES-256-GCM under a key file only your account can read. Kiro Crew refuses the agent any read of the vault folder, whether through a file tool, cat or a script. That rule comes from Kiro Crew, not the operating system, so another program running as you can still open the files.
  • A dashboard that needs a token. Every request needs token auth, even one from the same machine. A remote sign-in link is signed, pinned to one IP address, single-use and valid for 5 minutes.
  • Open source. Kiro Crew is open source, so you can read how each of these works instead of taking it on faith.
My EC2 VPS runs the regular Kiro Crew app, but there is also Kiro Crew LTS, an enterprise edition for organizations that manage Kiro with Kiro Enterprise Management. Kiro Enterprise Management is in preview for new Kiro profiles created in US East (N. Virginia), and Crew LTS needs such a profile. An admin writes one policy for models, shell commands, files and MCP tools, and adds Crew rules such as which chat channels the agent may use, whether scheduled jobs run and whether the dashboard may be opened over Tailscale. LTS installs beside the regular app, updates only from its own lts channel, and signs in through the organization's SSO, not a personal account.

Troubleshooting

  • The app isn't running, but the instance looks healthy. Usually the design working: storage failed and Requires= blocked the app. Read journalctl -u kirocrew-storage -n 40. FATAL: filesystem UUID mismatch (got '', …) means the data volume ended up in the launch template. Remove it.
  • The gateway stopped on a running instance. If the watcher logged action=404 rebalance=200, it drained on a rebalance recommendation and the instance keeps running without the agent. The ASG alarm won't catch this. Force a replacement with terminate-instance-in-auto-scaling-group … --no-should-decrement-desired-capacity.
  • A replacement loop every ~11 minutes. Self-heal is fighting a permanent fault (deleted volume, wrong AZ). Set min and desired to 0 first, then diagnose.
  • Stuck dead after quick repeated restarts. By default, systemd stops restarting a unit that starts 5 times within 10 seconds. You're not using the repo's unit file, which sets StartLimitIntervalSec=0 to turn that limit off.
  • Agents fail to spawn. Linger is missing. Check ls /run/user/1000.
  • Backups are on you. The design protects against losing an instance, not against bad writes. Add a DLM daily snapshot (see docs/03-operations.md).

Turning it off: cleanup

Snapshot the data volume first if you might want the agent's memory back.
aws autoscaling delete-auto-scaling-group --region $AWS_REGION \
  --auto-scaling-group-name $ASG_NAME --force-delete
aws ec2 wait volume-available --region $AWS_REGION --volume-ids $DATA_VOLUME_ID
aws ec2 delete-launch-template --region $AWS_REGION --launch-template-name $LAUNCH_TEMPLATE_NAME
aws cloudwatch delete-alarms --region $AWS_REGION --alarm-names kirocrew-gateway-down
aws ec2 deregister-image --region $AWS_REGION --image-id $BUILT_AMI
aws ec2 delete-volume --region $AWS_REGION --volume-id $DATA_VOLUME_ID
aws ec2 delete-security-group --region $AWS_REGION --group-id $SECURITY_GROUP_ID

Also delete the SNS topic, the AMI snapshot, any setup snapshots, and the IAM role, policy and instance profile. The README's Clean up section lists every command.

Wrapping up: shut down your PC, the crew keeps working

An agent is most useful when it doesn't need you there. Run Kiro Crew on a self-healing Spot ASG, keep its memory on a persistent EBS volume, let systemd keep it running and SSM keep it reachable, and it becomes an always-on agent in the cloud. It fires scheduled jobs at 9 a.m., resumes long tasks from checkpoints, and answers me in Discord and Telegram from my phone. And it does all that for about a third of the On-Demand price. Copy the prompt from the repo, paste into Kiro, and build a crew that never clocks out.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article