<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/run-coding-agents-in-e2b-sandboxes-with-real-infrastructure-rfokqbnri" -->

---
title: Run coding agents in E2B sandboxes with real infrastructure
description: Encore and E2B can now be combined to give coding agents isolated sandboxes with a full backend (databases, queues, buckets, caches, secrets, cron jobs)...
canonical: https://daily.dev/posts/run-coding-agents-in-e2b-sandboxes-with-real-infrastructure-rfokqbnri
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: Run coding agents in E2B sandboxes with real infrastructure | daily.dev
og:description: Encore and E2B can now be combined to give coding agents isolated sandboxes with a full backend (databases, queues, buckets, caches, secrets, cron jobs)...
og:url: https://daily.dev/posts/run-coding-agents-in-e2b-sandboxes-with-real-infrastructure-rfokqbnri
og:image: https://api.daily.dev/og/posts/RFokqBNRI.png
og:image:alt: Run coding agents in E2B sandboxes with real infrastructure
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Run coding agents in E2B sandboxes with real infrastructure

**[Encore](https://daily.dev/sources/encore-blog)** · 5 min read · 1 upvotes · 0 comments

## Summary

Encore and E2B can now be combined to give coding agents isolated sandboxes with a full backend (databases, queues, buckets, caches, secrets, cron jobs) running locally, matching production. Agents write Encore's Infrastructure SDK declarations, run encore run/check/test inside an E2B sandbox, and get type-safe infrastructure feedback and runtime traces before deploying. Both E2B and Encore support running inside your own AWS or GCP account (BYOC), so the same declarations that ran in the sandbox provision production infrastructure unchanged, keeping code, data, and credentials in your cloud.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://encore.dev/blog/encore-e2b-sandboxes>

## Questions this post answers

### How can I let a coding agent run a full backend with a real database and queues inside an isolated sandbox?

Combine E2B sandboxes with Encore's Infrastructure SDK: the sandbox gives the agent an isolated filesystem, processes, and network, while Encore runs local implementations of databases, queues, buckets, caches, secrets, and cron jobs declared in code. Running encore run inside the sandbox starts these local infrastructure primitives alongside the APIs, without needing a separate Docker Compose setup.

_daily.dev surfaces integrations like this for engineers wiring coding agents into real backend infrastructure._

### How do I deploy an agent-built Encore application to my own AWS or GCP account without changing the code?

Encore maps the same infrastructure declarations used locally in the sandbox to production infrastructure it provisions directly in your AWS or GCP account, including networking and IAM. Because provider choice, capacity, and access policy are declared separately from application code, the code that ran in the E2B sandbox deploys unchanged to production.

_Teams choosing a path from agent sandbox to production cloud can track approaches like this on daily.dev._

### How do I set up an E2B sandbox template to run Encore applications for coding agents?

Build a custom E2B template named something like encore-docker with Docker, the Encore CLI, and application dependencies pre-installed, giving it enough CPU and memory for Docker workloads. New sandboxes then start from that base image, clone the app repo, run npm install, and start encore run as a background process listening on 0.0.0.0:4000 so agents can keep working while the backend runs.

_daily.dev helps developers configuring agent sandbox environments keep up with setups like this one._

## Similar posts on daily.dev

- [Code Execution Sandbox for Agents on Heroku](https://daily.dev/posts/code-execution-sandbox-for-agents-on-heroku-bzmzhxxko) · Heroku · 0 upvotes · 0 comments
- [Encore for Rust](https://daily.dev/posts/encore-for-rust-iurebtf6y) · Encore · 46 upvotes · 3 comments

---

Tags: [#ai-agents](https://daily.dev/tags/ai-agents), [#iac](https://daily.dev/tags/iac)

[View this post on daily.dev](https://daily.dev/posts/run-coding-agents-in-e2b-sandboxes-with-real-infrastructure-rfokqbnri)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"Run coding agents in E2B sandboxes with real infrastructure","url":"https://daily.dev/posts/run-coding-agents-in-e2b-sandboxes-with-real-infrastructure-rfokqbnri","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/run-coding-agents-in-e2b-sandboxes-with-real-infrastructure-rfokqbnri"},"datePublished":"2026-09-15T13:49:43.280Z","dateModified":"2026-09-15T13:50:08.020Z","description":"Encore and E2B can now be combined to give coding agents isolated sandboxes with a full backend (databases, queues, buckets, caches, secrets, cron jobs)...","image":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/ba29816b33389dee5260206f403e834f?_a=AQAEuop","thumbnailUrl":"https://media.daily.dev/image/upload/f_auto,q_auto/v1/posts/ba29816b33389dee5260206f403e834f?_a=AQAEuop","isAccessibleForFree":true,"articleSection":"Encore","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Encore","logo":"https://media.daily.dev/image/upload/s--8Bz0eBFn--/f_auto,q_auto/v1780213589/logos/encore-blog?_a=BAMAMiWQ0","url":"https://daily.dev/sources/encore-blog"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/run-coding-agents-in-e2b-sandboxes-with-real-infrastructure-rfokqbnri","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":1},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"ai-agents,iac","timeRequired":"PT5M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Encore","item":"https://daily.dev/sources/encore-blog"},{"@type":"ListItem","position":3,"name":"Run coding agents in E2B sandboxes with real infrastructure"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/run-coding-agents-in-e2b-sandboxes-with-real-infrastructure-rfokqbnri#faq","mainEntity":[{"@type":"Question","name":"How can I let a coding agent run a full backend with a real database and queues inside an isolated sandbox?","acceptedAnswer":{"@type":"Answer","text":"Combine E2B sandboxes with Encore's Infrastructure SDK: the sandbox gives the agent an isolated filesystem, processes, and network, while Encore runs local implementations of databases, queues, buckets, caches, secrets, and cron jobs declared in code. Running encore run inside the sandbox starts these local infrastructure primitives alongside the APIs, without needing a separate Docker Compose setup. daily.dev surfaces integrations like this for engineers wiring coding agents into real backend infrastructure."}},{"@type":"Question","name":"How do I deploy an agent-built Encore application to my own AWS or GCP account without changing the code?","acceptedAnswer":{"@type":"Answer","text":"Encore maps the same infrastructure declarations used locally in the sandbox to production infrastructure it provisions directly in your AWS or GCP account, including networking and IAM. Because provider choice, capacity, and access policy are declared separately from application code, the code that ran in the E2B sandbox deploys unchanged to production. Teams choosing a path from agent sandbox to production cloud can track approaches like this on daily.dev."}},{"@type":"Question","name":"How do I set up an E2B sandbox template to run Encore applications for coding agents?","acceptedAnswer":{"@type":"Answer","text":"Build a custom E2B template named something like encore-docker with Docker, the Encore CLI, and application dependencies pre-installed, giving it enough CPU and memory for Docker workloads. New sandboxes then start from that base image, clone the app repo, run npm install, and start encore run as a background process listening on 0.0.0.0:4000 so agents can keep working while the backend runs. daily.dev helps developers configuring agent sandbox environments keep up with setups like this one."}}]}
```

