FlatRun vs E2B

Sandboxed runs, on a server you already run.

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

How FlatRun and E2B differ.

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 and E2B, feature by feature.

FlatRunE2B
Where code runsYour own serversE2B's cloud, or your own with its open source runtime
IsolationFirecracker microVM, or a Docker container for trusted codeFirecracker microVM
LifetimeOne command, then removedUp to 1 hour on Hobby and 24 hours on Pro, with pause and resume
State between callsKept files and output onlyMemory and filesystem kept while paused
NetworkOff unless a run asks for itOn unless a sandbox turns it off
InterfaceREST API and dashboardPython and JavaScript SDKs, a code interpreter SDK and a CLI
PricingFree. You pay for the serverHobby is free with a one-time $100 credit; Pro is $150 a month plus usage
Compute costFixed by the server you choose$0.000014 per vCPU second and $0.0000045 per GiB second
LicenseOpen source, MITOpen source runtime and SDKs, Apache 2.0

Switching

Run your first sandboxed command.

  1. 01

    Install FlatRun

    Install the agent on a Linux server. Docker runs work straight away.

  2. 02

    Turn on Firecracker

    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.

  3. 03

    Send a run

    Post an image, a command and the files to keep to /api/runs, then read the output and download the files.

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

Choose E2B when

  • Your agent needs a machine that lives across many calls
  • You need pause and resume with memory kept
  • You want Python or JavaScript SDKs and a code interpreter
  • You would rather not run the servers yourself

Questions about E2B.

Is E2B open source?

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.

Can a FlatRun run keep state for the next call?

Not inside the instance. Keep files from one run as artifacts and pass what the next run needs in its command, environment or image.

Does FlatRun have an SDK?

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

Star us on GitHub