COMPUTER_VMS set to self-managed: it creates no VMs. You create one Azure VM per organization, and the VM connects out to the gateway with that organization’s host token.
The examples use two hostnames on your Cloudflare zone:
1. Get the code
2. Create the Cloudflare resources
3. Create the WorkOS, Slack and GitHub apps
The URLs below usehttps://app.example.com.
WorkOS. Create an application with redirect URI https://app.example.com/auth/callback, and set the sign-out redirect to https://app.example.com in the WorkOS dashboard. Keep the API key and client ID.
Slack. Create a Slack app with:
Bot token scopes:
app_mention, message.im, message.channels, message.groups, app_uninstalled, tokens_revoked, team_leave, user_change, and agent_session_stopped if Slack offers it. Keep the client ID, client secret and signing secret.
GitHub. Create a GitHub App with:
Generate a private key. Keep the app ID, slug, client ID, client secret, webhook secret and private key.
4. Deploy the gateway Worker
Start fromservices/managed-agents/wrangler.production.jsonc and edit:
Write the secrets to a JSON file with mode
0600:
Keep the value of
COMPUTER_HOST_TOKEN_KEY at hand: step 7 derives each organization’s host token from it.
5. Deploy the app Worker
Incloudflare-workers/api-edge/wrangler.toml:
- Set
name,account_id, and the route toapp.example.com. - Set the D1 binding to
computer-appand the KV binding toSESSIONS_KV. - Set the
CREDIT_ACCOUNTbinding’sscript_nameto this Worker’s name. - Set
COMPUTER_ENABLED_FOR_ALL = "true"andMANAGED_AGENTS_API_URL = "https://gateway.example.com". - Remove
tail_consumers.
0600 JSON file:
Build the dashboard into the Worker’s assets, create the schema and deploy:
6. Build and upload the Computer release
From the repository root:7. Get the organization ID and make the host token
- Open
https://app.example.comand sign in. - Open Settings and copy the Organization ID.
- Derive the organization’s host token from
COMPUTER_HOST_TOKEN_KEY:
8. Create the VM
The VM is Ubuntu 24.04 on amd64 with a second, blank disk for/data. It needs outbound internet access and no inbound access.
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:
az vm create also creates a virtual network, a public IP address for outbound traffic, and a network security group; --nsg-rule NONE leaves that group without a rule that allows inbound traffic.
az vm list-skus -l "$REGION" --size Standard_D2 -o table lists the sizes your subscription can use.
The first boot installs the toolchains, formats the blank disk, mounts it at /data and starts the host. It takes about six minutes. The boot script formats a disk only when it is blank.
The token stays in the VM’s custom data. On the VM only root can read it; Azure does not return custom data once the VM exists.
9. Add the Slack app and connect GitHub
- Open
https://app.example.com. The Computer showsOnlineonce the VM has connected. - Click Add to Slack and approve.
- Connect GitHub and choose the repositories.
- Mention
@computerin a channel.
Stop, start and resize
Stop the VM withaz vm deallocate; the Computer shows Offline and Slack messages wait. Start it with az vm start; the host reconnects and the workspace is still on /data. To resize, run az vm resize with the new size.
az vm delete does not delete the data disk.
Check a VM
No rule allows SSH. The boot log is/var/log/calvin-boot.log, and the two services are slack-presence-host and oc-modelproxy. Run checks with Azure Run Command:
Update a VM
A self-managed VM does not update itself. Build and upload a new bundle (step 6), make a newBUNDLE_URL (step 8), and run: