| title | Run DevIntern on a Cloud VM | ||||||
|---|---|---|---|---|---|---|---|
| sidebarLabel | Cloud VM | ||||||
| description | Use when deploying the DevIntern Code worker on a VPS or cloud VM (Ubuntu 22.04/24.04, Debian 12) such as DigitalOcean, Hetzner, or AWS: install, headless agent sign-in, sandbox, license, background service, and dashboard access. | ||||||
| section | Automation | ||||||
| order | 2.25 | ||||||
| dateModified | 2026-12-01 | ||||||
| tags |
|
A small cloud VM makes a good always-on worker: it keeps running when your laptop sleeps, and its credentials stay on a machine that only runs DevIntern. This guide covers Ubuntu 22.04 and 24.04 and Debian 12 on any provider (DigitalOcean, Hetzner, AWS, and others). Everything runs as a regular user without sudo, except one-time system setup (packages, the AppArmor profile, lingering).
For the steps the worker setup shares with a laptop, see the Quick Start.
Create a regular user for the worker (not root), install git, unzip, and curl, then run the installer as that user:
sudo apt-get update && sudo apt-get install -y git unzip curl
curl -fsSL https://devintern.com/install.sh | shThe installer never runs sudo. On Ubuntu 23.10 and later it also prints a note when agent sandboxes that use bubblewrap can't start yet; see Choose a sandbox.
Install the agent CLI as the worker user, then sign in over SSH. No browser is needed on the VM: each CLI prints an address you open on your own computer.
| Agent | Sign in |
|---|---|
| Claude Code | Run claude, open the address it prints, and paste the code back. Or set ANTHROPIC_API_KEY |
| Codex | codex login --device-auth, then enter the code on any device with your ChatGPT account. Or printenv OPENAI_API_KEY | codex login --with-api-key |
Other agents are listed in Agent Harness. Set AGENT_HARNESS in ~/.devintern/.env when you don't use Claude Code.
Ubuntu 23.10 and later (including 24.04) block the bubblewrap sandbox that Claude Code and Codex use until an AppArmor profile is loaded. Ubuntu 22.04 and Debian 12 don't have this restriction. Either load the profile once with sudo, or use AGENT_SANDBOX=nono, which needs no sudo. The commands are in Native sandbox on Ubuntu 23.10 and later.
Check the result with:
devintern sandboxUnattended runs need the Worker Pilot or a license key. Put the key in the workspace .env before setup:
mkdir -p ~/.devintern && touch ~/.devintern/.env && chmod 600 ~/.devintern/.env
echo 'LICENSE_KEY=CODE-XXXX-XXXX-XXXX-XXXX' >> ~/.devintern/.envSome providers' IP ranges are blocked by the license server's firewall. From 2.35.0 DevIntern handles this automatically.
To use the Worker Pilot instead, pass --sign-in github in the next step and open the printed address on your computer (Signing in without a terminal).
Clone your repository as the worker user (for a private repository, use an SSH deploy key or gh repo clone), then run setup without prompts:
git clone git@github.com:acme/app.git ~/app && cd ~/app
export GITHUB_TOKEN=...
devintern worker init --non-interactive --tracker github --repo-from-cwd --start--start installs and starts the background service when every check passes. Flags for other trackers and credential files are in Non-interactive setup. To install the service later, run devintern worker service install (Running as a service).
The service keeps running after you log out and starts at boot. That needs lingering for the user; if worker service install prints sudo loginctl enable-linger <user>, run it once.
The dashboard listens on 127.0.0.1:4400 on the VM and can't be bound to a public address, so it is never reachable from the internet. Open it through an SSH tunnel from your computer:
ssh -N -L 4400:127.0.0.1:4400 devintern@your-vm
# then open http://localhost:4400Don't forward the port with a firewall rule or a proxy without a login: the dashboard has no login of its own. For Tailscale or a reverse proxy, see Access the dashboard from another device.
Most providers accept cloud-init user data when you create the VM. This example for Ubuntu 24.04 creates a devintern user, installs the packages, loads the bubblewrap AppArmor profile, enables lingering, and runs the installer as that user. Replace the SSH key with yours. This example has not been tested end to end on a provider, so check the first boot with cloud-init status --long and /var/log/cloud-init-output.log:
#cloud-config
users:
- default
- name: devintern
shell: /bin/bash
ssh_authorized_keys:
- ssh-ed25519 AAAA... you@laptop
packages:
- git
- curl
- unzip
- bubblewrap
- apparmor-profiles
runcmd:
- install -m 0644 /usr/share/apparmor/extra-profiles/bwrap-userns-restrict /etc/apparmor.d/
- apparmor_parser -r /etc/apparmor.d/bwrap-userns-restrict
- loginctl enable-linger devintern
- su - devintern -c 'curl -fsSL https://devintern.com/install.sh | sh'On Ubuntu 22.04 and Debian 12, leave out the two AppArmor lines: the restriction doesn't exist there. Then SSH in as devintern and continue from step 2. Agent sign-in and worker setup need your credentials, so keep them out of user data, which the provider stores and shows in its console.