Docs · how to

Connect a target

Add somewhere for environments to run — your own machines, a cloud account denv provisions in, or a hosted sandbox provider.

A target is where environments run. Connect at least one; you can connect several and pick per environment. denv never owns the compute: machines are in your account, data stays on their disks.

Your own machines

Any Linux host with Docker. Mint a join token, then run the installer as root on the host:

denv host join-token
curl -fsSL https://get.denv.ai | sh -s -- --token <token> --server https://api.denv.ai

The installer downloads denvd for the host's architecture, installs a systemd unit, and joins. The token is single-use and becomes a per-host secret. denvd opens one outbound WebSocket and never listens on a port, so no inbound firewall rule is needed.

With a ZFS pool, snapshots are atomic across volumes and forks are clones:

curl -fsSL https://get.denv.ai | sh -s -- --token <token> --server https://api.denv.ai --zfs-pool denv

Check what the host reported:

denv host list

storage is zfs or dir. On dir, forks copy; on zfs, forks take about a second regardless of data size.

A cloud account denv provisions in

Connect the account once; the provision phase of a deploy creates a machine when no connected host has capacity, installs denvd through cloud-init, and the machine joins by itself.

Hetzner:

denv cloud connect hetzner --name hz --token <hetzner api token> --server-type ax41-nvme --location fsn1

AWS: not yet available; your own EC2 machines work today through the installer above.

Machines carry a denv label and are deletable from your own console at any time.

A hosted sandbox provider

Connect the provider with your key. No sidecar; the control plane drives the provider's API.

denv cloud connect e2b --name e2b --token <api key>
denv cloud connect daytona --name daytona --token <api key>

Each connected provider appears as a target:

curl -s $DENV_SERVER/v1/targets -H "Authorization: Bearer $DENV_API_KEY"

The response carries a capability row per target. Hosted providers run one container per environment: a compose file with more than one service fails at prepare with a clear message. Snapshot and fork are available where the provider has a primitive; verify is not available on hosted providers yet. The E2B and Daytona drivers are untested against the live providers as of this writing.

To run a sandbox on a specific provider:

curl -s -X POST $DENV_SERVER/v1/targets/e2b/sandboxes -H "Authorization: Bearer $DENV_API_KEY" \
  -H 'Content-Type: application/json' -d '{"image":"python:3.12-slim","cmd":["sleep","infinity"]}'

Choosing where an environment runs

Deploys prefer a connected sidecar host. A project can be pinned to a named cloud so every environment of it lands there. Sandboxes created through the API can name a target explicitly, as above.