Skip to main content
This guide covers terminating an AWS EC2 instance. Termination permanently deletes the instance. The root EBS volume is deleted by default; other attached volumes may need to be deleted separately.
Complete the pre-termination checklist before proceeding. Termination is irreversible.

Option 1: AWS Management Console

1

Open the EC2 Instances list

Sign in to the AWS Management Console and navigate to EC2 → Instances → Instances.
2

Select your instance

Check the box next to the instance running OpenClaw. Confirm the correct instance by checking its public IP against what appeared on the watchboard.
3

Disable termination protection if set

If termination protection is enabled (Actions → Instance Settings → Change Termination Protection shows “Enabled”), disable it first. Otherwise the terminate action will fail with a OperationNotPermitted error.
4

Terminate the instance

Choose Instance state → Terminate instance from the Actions menu. Confirm when prompted.The instance moves to the shutting-down state and then terminated. AWS retains the terminated record for about an hour before removing it from the list.
Official AWS documentation: Terminate Amazon EC2 Instances

Option 2: AWS CLI

If you have the AWS CLI installed and configured:
# Find your instance ID (if you don't have it)
aws ec2 describe-instances \
  --query "Reservations[*].Instances[*].[InstanceId,PublicIpAddress,State.Name]" \
  --output table

# Terminate the instance
aws ec2 terminate-instances --instance-ids i-XXXXXXXXXXXXXXXXX
If termination protection is enabled, disable it first:
aws ec2 modify-instance-attribute \
  --instance-id i-XXXXXXXXXXXXXXXXX \
  --no-disable-api-termination
Official AWS CLI reference: terminate-instances

Post-termination cleanup

Delete unattached EBS volumes

The root EBS volume is deleted automatically when the instance terminates (if “Delete on Termination” was enabled — this is the default). Additional attached volumes are not deleted automatically.
# List unattached volumes
aws ec2 describe-volumes \
  --filters Name=status,Values=available \
  --query "Volumes[*].[VolumeId,Size,CreateTime]" \
  --output table

# Delete a specific volume
aws ec2 delete-volume --volume-id vol-XXXXXXXXXXXXXXXXX

Delete snapshots

# List snapshots owned by your account
aws ec2 describe-snapshots --owner-ids self \
  --query "Snapshots[*].[SnapshotId,Description,StartTime]" \
  --output table

# Delete a snapshot
aws ec2 delete-snapshot --snapshot-id snap-XXXXXXXXXXXXXXXXX

Remove the Security Group

If you created a Security Group specifically for this instance, delete it:
aws ec2 delete-security-group --group-id sg-XXXXXXXXXXXXXXXXX

Release the Elastic IP (if assigned)

Elastic IPs continue to incur charges if not released after the instance is terminated:
# List Elastic IPs
aws ec2 describe-addresses --query "Addresses[*].[PublicIp,AllocationId,AssociationId]"

# Release an unassociated Elastic IP
aws ec2 release-address --allocation-id eipalloc-XXXXXXXXXXXXXXXXX
AWS guide: Delete or Terminate EC2 Resources

Rotate credentials

After termination, rotate everything the agent had access to. See the post-termination checklist for the full list.