← Engineering blog

The benefits of rain

You can fork Mainbrella, change the prices, and sell Linux workspaces for AI agents, just as we do. The accounts, billing, quotas, and workspace code are all in the repository. You can even compete with us. So why pay mainbrella.com?

Because somebody has to operate it. I think a hosted open-source service ought to earn its fee by doing work its customers would otherwise have to do. Making the self-hosted version deliberately miserable would be a pretty lousy business model.

Run it yourself: an engineer takes a blue umbrella from a workshop shelf while holding its blueprint.
Have us run it: an operator holds the same blue umbrella over a customer's laptop and tends to the equipment in the rain.

The part after the model answers

Ask an agent to analyze a CSV and build a website with the results. Writing the script is only part of the job. It needs somewhere to install dependencies, run the analysis, keep the output files, and serve the site. When a chart looks wrong, you need a terminal on that same machine.

Mainbrella provides that environment. Your program starts a Linux container, writes files, runs commands, and reads the results through HTTP or our JavaScript and Python SDKs. You can attach through SSH or the browser terminal, then open the app through a protected preview link. You supply the model and pay its API bill separately.

E2B and Daytona address the same general problem. Both also offer ways to control the infrastructure: E2B describes self-hosting, and Daytona documents bring-your-own-compute deployments. Selling a hosted version of open-source software is hardly a new idea. Our bet is that Cloudflare’s developer platform can support most of the machinery needed to run this particular business.

That means shipping more than an endpoint that runs commands. A service has to know who owns each machine, who can access it, how much compute they can spend, and when to shut it down. Those decisions are in the code we’re sharing too.

A small cloud on a Mac

I’ve run hundreds of containers locally on a Mac Studio using OrbStack, without trouble. That makes self-hosting a lot easier to take seriously than a checkbox on a pricing page.

Wrangler, Cloudflare’s development tool, runs the Workers and local state. OrbStack supplies the Docker-compatible engine for Linux containers. Our dev launcher starts the API and container Worker together, so you can change the control plane and run guest workloads on the same computer.

With the container engine running, start the backend’s local development environment with:

npm ci
npm run db:migrate:local
npx wrangler d1 migrations apply mainbrella-preview-routes --local
npm run dev

The API listens at http://localhost:8787, with its reference at /docs. You’ll still need local authentication and access records; starting a dev server doesn’t create an account. Those records are separate from production, and the included coupon tool can grant a local trial without a Mainbrella payment.

There’s no Mainbrella software or hosting fee for this setup. You supply the computer and follow your container engine’s terms. It works well for tinkering, integration testing, and platform development. A service with customers will also need a deployment they can reach and an operator to keep it running.

What changed on Cloudflare

Cloudflare released Containers in public beta in June 2025. Its September 30, 2026 redesign added runtime selection of images and machine sizes, changed scheduling, and put filesystem snapshots into public beta. Mainbrella uses the native ctx.container API. Cloudflare’s Sandbox SDK uses related infrastructure, but our backend doesn’t depend on it.

Each Linux container has a controller that lives outside the guest. Cloudflare calls it a Durable Object, application code with its own identity and persistent storage. When Linux stops, the controller still has the records needed to manage the machine’s lifetime.

We also give each customer account a coordinator. Before a machine boots, the coordinator reserves compute for it; the workspace controller manages the individual guest. If the CSV agent starts five workers, all five draw from one account budget. Stopping a worker doesn’t erase what it spent. Getting that wrong is an expensive way to learn about concurrency.

A shared API connects to separate customer account coordinators. Each coordinator tracks a budget and connects to individual workspace controllers and Linux containers. A stopped container leaves its controller and account budget in place.

Workers handle the API, while D1, Cloudflare’s SQL database, stores account and billing data. The web client includes signup, checkout, prepaid billing controls, API keys, and the workspace dashboard. A fork gets the code that connects these services as well as the container runtime.

Guest files need more care. Stopping the CSV machine discards unsaved changes, so copy out the results or explicitly save a workspace first. Mainbrella uses Cloudflare’s filesystem snapshots to restore saved files into a new machine. The script has to restart there; its RAM and running process don’t come with it.

This backend depends on Cloudflare APIs. Moving it to another cloud means porting the infrastructure layer. The source lets you do that work, but calling the project open source doesn’t make the port disappear.

You can sell the umbrella too

Suppose you teach a programming course. Each student needs a disposable Linux workspace, a browser terminal, and a link to their app. You also need a budget per student. A machine left running all weekend shouldn’t get to spend the rest of the class’s allowance.

You could fork Mainbrella for that course, with your branding, prices, Cloudflare account, and customers. You could do the same for an agent product, or sell a service competing directly with ours.

The GPL v3 license permits commercial use. Its copyleft requirements apply when you distribute covered software, so a fork isn’t permission to redistribute a closed-source version. We charge no software fee or revenue share for operating your own service.

A fresh deployment still takes work. Our checked-in configuration contains our account, domains, and image-release locations. You’ll need to replace those, configure authentication and Stripe billing, and apply the database migrations. The current release scripts assume our service already exists. They won’t bootstrap your business from an empty Cloudflare account.

A fork needs to keep its advertised prices consistent with server policy. Our hosted service now uses prepaid funding, starting at $5, with unused funds carried forward and no monthly subscription. The billing backend validates payments, and runtime policy controls capacity and deadlines. Changing the pricing page doesn’t change what the server charges or permits.

What you pay for

Who runs the service?
ArrangementWhat you pay forWho operates it
Local on your MacYour computer and container engineYou
Your Cloudflare accountCloudflare usage and any other services you configureYou; your customers can pay you
mainbrella.comPrepaid Mainbrella usage, subject to your balance and spending capWe operate the sandbox service

As of October 7, 2026, Cloudflare’s $5/month Workers Paid plan includes 375 vCPU-minutes, 25 GiB-hours of memory, and 200 GB-hours of disk, shared across the account. A small deployment might fit. Hundreds of busy machines won’t. Additional usage and other services can add charges.

If you sell a fork, customers pay you and you pay the infrastructure providers. That revenue has to cover compute, payment processing, support, and your time. The amount a customer pays isn’t your margin. Account budgets can bound the workload, but you still need to measure what it costs.

That’s why I think mainbrella.com can make money while the code stays free. A customer building the CSV analysis app may happily pay us to handle sandbox infrastructure, image rollouts, billing integration, and platform maintenance. They have their own software to build.

Self-hosting makes sense when you want control, need to change the platform, or intend to sell a service around it. If the sandbox is just one dependency in your app, taking over its deployment may be a poor use of your time. Access to the source should let you make that choice.

A hosted customer can use the same backend and web client to start their own deployment when their needs change. The self-hosting overview covers the setup. Moving still takes work; the source repository doesn’t automatically transfer an account or its saved workspaces. If a missing feature is worth that work to you, you can build it without waiting for our roadmap.