Devin ↗︎ runs its agent loop in its own service. Each session works on a machine where Devin runs commands, edits files, and opens a browser. A Devin Outpost moves that machine to infrastructure that you choose. The Devin Outpost template runs each session in its own Linux sandbox: a Container that one Durable Object starts for that session.
You need:
- A Devin Enterprise organization with permission to manage outposts and service users
- A Cloudflare account on the Workers Paid plan with access to Containers
- For manual deployment, Node.js 24 ↗︎ and a running Docker ↗︎ daemon
-
Open your Devin organization outpost settings. In this URL, replace both occurrences of
my-orgwith your organization slug:https://my-org.devinenterprise.com/org/my-org/settings/enterprise-environment?tab=outposts -
Create or select an outpost, and copy its outpost ID for
DEVIN_OUTPOST_ID. -
For
DEVIN_API_TOKEN, use a Devin service-user token with the Run outpost workers permission.
For more information about outposts, refer to the Devin Outposts overview ↗︎.
The Deploy to Cloudflare button creates the Worker, the cron trigger, the Durable Object namespace, and the container application.
Enter these values when the deployment flow prompts for them:
| Variable | Value |
|---|---|
DEVIN_OUTPOST_ID |
Your Devin Outpost ID |
DEVIN_API_TOKEN |
A Devin service-user token with the Run outpost workers permission |
After the deployment finishes, select your outpost from the Virtual environment menu when you create a Devin session.
Deploy manually when you need to add dependencies, tools, or environment variables to the container image.
-
Create a project from the Devin Outpost template:
npm create cloudflare@latest -- cloudflare-devin-outpost --template=cloudflare/sandbox-sdk/devinyarn create cloudflare cloudflare-devin-outpost --template=cloudflare/sandbox-sdk/devinpnpm create cloudflare@latest cloudflare-devin-outpost --template=cloudflare/sandbox-sdk/devin -
Go to the project directory and log in to your Cloudflare account:
cd cloudflare-devin-outpost npx wrangler login -
In
wrangler.jsonc, replace the emptyDEVIN_OUTPOST_IDvalue with your outpost ID.The default
DEVIN_API_URLishttps://api.devin.ai/opbeta. Change this value only if your Devin environment uses another API URL. -
Store your Devin API token as a Worker secret:
npx wrangler secret put DEVIN_API_TOKENEnter your service-user token when Wrangler prompts you. Do not add the token to
wrangler.jsonc. -
Deploy the Worker and container:
npm run deployWrangler builds the container image and deploys the Worker, the container application, and the cron trigger.
-
Check the deployment with the Worker URL from the Wrangler output:
curl https://<YOUR_WORKER>.workers.dev/The Worker returns:
{ "service": "devin-outpost", "status": "ok" }
In Devin, create a session and select your outpost from the Virtual environment menu. The Worker checks for new sessions every 10 seconds by default, so the sandbox for the session starts shortly after you create it.
A cron trigger runs the Worker once a minute. During each run, the Worker asks Devin for the sessions of your outpost every 10 seconds, or every DEVIN_RECONCILE_INTERVAL_MS milliseconds if you set that variable. The Worker sends the status of each session to the Durable Object for that session:
| Devin status | What the template does |
|---|---|
pending, running |
Starts the sandbox for the session if it is not running, from its snapshot if it has one. |
suspended |
Waits for the Devin CLI to exit, saves a snapshot of the sandbox, then stops it. |
terminated |
Stops the sandbox and forgets its snapshot. |
The Durable Object only starts and stops its container. Inside the sandbox, the Devin CLI (devin worker start) claims the session and runs it.
Your Worker connects to Devin on a cron trigger and lists sessions. It sends each session to its own Durable Object, which starts and stops a container. The Devin CLI in the container connects to Devin, claims the session, and runs it. Every connection to Devin starts on Cloudflare, so nothing connects in.
When Devin suspends a session, the Devin CLI exits. The sandbox keeps running until the Durable Object saves a snapshot of its disk. When the session continues, the sandbox starts from that snapshot and the Devin CLI claims the session again. The snapshot keeps the files and installed packages of the session. It does not keep running processes. If the Devin CLI exits while the session is still running, the template saves a snapshot and starts a new sandbox from it.
For more information, refer to Save and restore a sandbox with snapshots.
Each session runs in its own container and does not share files or processes with other sessions. Inside the container, Devin runs as root, can reach the Internet, and holds the Devin API token. Code that runs in a session can read that token. Deploy a separate outpost for each group of users that must not share access.
For more information, refer to Sandbox security.