Choose FlatRun when
- Each piece of code runs once and only its result matters
- You want sandboxes on hardware you already pay for
- Code should start with no network access
- The same server also deploys your apps
FlatRun vs E2B
FlatRun runs a command once on your own server, in a Firecracker microVM for untrusted code or a Docker container for trusted code, with no network by default. E2B offers long-lived cloud sandboxes with SDKs and pause and resume.
Open source, MIT licensed · Runs on any Linux server with Docker
Code sandbox
E2B and FlatRun both run code you do not trust inside Firecracker microVMs.
An E2B sandbox is a machine your agent keeps: it can run for up to an hour on the free plan or a day on Pro, be paused with its memory and resumed later, and is driven through Python and JavaScript SDKs. It is billed per second, and its runtime is open source if you want to host it yourself. A FlatRun run executes one command, and its output and chosen files are kept after the instance is removed. It runs on the server where FlatRun already deploys your apps, so there is no separate bill.
Side by side
| FlatRun | E2B | |
|---|---|---|
| Where code runs | Your own servers | E2B's cloud, or your own with its open source runtime |
| Isolation | Firecracker microVM, or a Docker container for trusted code | Firecracker microVM |
| Lifetime | One command, then removed | Up to 1 hour on Hobby and 24 hours on Pro, with pause and resume |
| State between calls | Kept files and output only | Memory and filesystem kept while paused |
| Network | Off unless a run asks for it | On unless a sandbox turns it off |
| Interface | REST API and dashboard | Python and JavaScript SDKs, a code interpreter SDK and a CLI |
| Pricing | Free. You pay for the server | Hobby is free with a one-time $100 credit; Pro is $150 a month plus usage |
| Compute cost | Fixed by the server you choose | $0.000014 per vCPU second and $0.0000045 per GiB second |
| License | Open source, MIT | Open source runtime and SDKs, Apache 2.0 |
Switching
Install the agent on a Linux server. Docker runs work straight away.
On a Linux host with root and /dev/kvm, follow the setup guide to add Firecracker, a guest kernel and the guest init, then check that the runtime shows as available.
Post an image, a command and the files to keep to /api/runs, then read the output and download the files.
Yes. Its runtime and SDKs are Apache 2.0, and it can be self-hosted on one Linux machine with KVM or with Terraform on AWS, GCP or Azure.
Not inside the instance. Keep files from one run as artifacts and pass what the next run needs in its command, environment or image.
No. Runs are a REST API, so any language with an HTTP client can start one and read its output.
E2B details come from E2B pricing , E2B persistence docs , E2B internet access docs and the E2B runtime . FlatRun details are in the documentation.
More comparisons