Skip to main content
On AWS the gateway runs with COMPUTER_VMS set to self-managed: it creates no VMs. You create one EC2 instance per organization, and the instance connects out to the gateway with that organization’s host token. The examples use app.example.com and gateway.example.com, as in On Azure.

1. Get the code

2. Create the Cloudflare resources and the apps

Follow two steps of the Azure guide unchanged:

3. Deploy the gateway Worker

Follow Deploy the gateway Worker unchanged. Keep the value of COMPUTER_HOST_TOKEN_KEY at hand: step 6 derives each organization’s host token from it.

4. Deploy the app Worker

Follow Deploy the app Worker unchanged.

5. Build and upload the Computer release

From the repository root:
The bundle holds the Computer source and the model proxy built for Linux amd64. The bucket stays private; step 7 gives the VM a URL that is valid for one hour.

6. Get the organization ID and make the host token

  1. Open https://app.example.com and sign in.
  2. Open Settings and copy the Organization ID.
  3. Derive the organization’s host token from COMPUTER_HOST_TOKEN_KEY:
The token is valid for that organization only, and for as long as the key does not change.

7. Create the VM

The VM is Ubuntu 24.04 on amd64 with a second, blank EBS volume for /data. It needs outbound internet access and no inbound access: a new security group has no inbound rules. Make a download URL for the release, then write the VM’s first-boot script with self-managed-user-data.sh. The script it prints stores the gateway URL and the token in a root-only file on the VM, downloads the release and runs its boot script:
Create the security group and the instance in the default VPC:
The first boot installs the toolchains, formats the blank volume, mounts it at /data and starts the host. It takes about five minutes. The boot script formats a volume only when it is blank. The token stays in the instance’s user data. On the VM only root can read it; in AWS, anyone allowed to call ec2:DescribeInstanceAttribute can.

8. Add the Slack app and connect GitHub

  1. Open https://app.example.com. The Computer shows Online once the VM has connected.
  2. Click Add to Slack and approve.
  3. Connect GitHub and choose the repositories.
  4. Mention @computer in a channel.
Repeat steps 6 and 7 for each further organization.

Stop, start and resize

Stop the instance with aws ec2 stop-instances; the Computer shows Offline and Slack messages wait. Start it with aws ec2 start-instances; the host reconnects and the workspace is still on /data. To resize, stop the instance, change its type with aws ec2 modify-instance-attribute, and start it. Terminating the instance does not delete the data volume.

Check a VM

The VM has no SSH access. The boot log is /var/log/calvin-boot.log, and the two services are slack-presence-host and oc-modelproxy. From a root shell on the VM, for example through AWS Systems Manager Session Manager (the instance then needs an instance profile with the AmazonSSMManagedInstanceCore policy):

Update a VM

A self-managed VM does not update itself. Build and upload a new bundle (step 5), download it to /opt/bootstrap/calvin.bundle on the VM, and run as root: