Mainbrella open source · GPL v3.0
Open Source
Business in a Box
Fork Mainbrella. Make it your own. Set your prices and sell Linux workspaces for AI agents from your own Cloudflare account. Accounts, billing, quotas, and customer access are already built.
GPL v3.0. No Mainbrella software fee.
Existing Workers Paid allowances may cover a small deployment.
- 01Humans & agents
Web · iPhone / iPad · JavaScript · Python · HTTP
- 02Workers + D1
API · identity · account and billing data
- 03Durable Objects
Reservations · quotas · lifecycle · generation fencing
- 04Cloudflare Containers
Real Linux · native filesystem · your workloads
Cloudflare provides the infrastructure. Mainbrella connects it into an agent workspace system.
Your brand. Your prices. Your customers.
Start with a working platform, then build a service for the people you want to serve.
Make the product yours.
Fork the code, change the branding, and shape the experience around your customers. Focus on coding agents, classroom labs, evaluation workloads, or a community you know well.
Choose your business model.
Change subscription prices, compute allowances, and account limits. Connect your own billing integrations and charge your customers for the service you operate.
Run it in your account.
Deploy to your Cloudflare account and domain. Use the included web client, API, and SDKs to onboard customers, then handle their support and grow the service.
The foundation
is already built.
Account management, billing flows, API keys, quota enforcement, machine lifecycle, terminals, and previews take real engineering work. That code is here, along with deployment configs and tests. Put your effort into the audience, experience, and service that make your business worth choosing.
You're welcome to compete directly with mainbrella.com. Forking the platform and selling your own hosted service is part of the invitation.
What if your sandbox infrastructure was mostly Cloudflare?
Linux machines on demand, without assembling a Kubernetes cluster, an EC2 fleet, Redis, and Postgres.
Workers handle the front door.
The API authenticates sessions and named API keys, checks ownership, and routes lifecycle, commands, files, and interactive access to the right machine. D1 holds the surrounding account, billing, and application data.
Durable Objects coordinate the work.
A ContainerAccount object coordinates account reservations, concurrency, and compute budgets. Each machine's runtime has its own state. Cloudflare Containers supply the isolated Linux environment.
Ambiguous response?
Keep one launch.
Creation combines persisted reservations with idempotency keys. If a launch response gets lost, retrying the same request can reconcile the original creation instead of casually starting another paid machine. Commands that may have already run need reconciliation, not blind replay.
How creation and generations work →
The useful parts are already connected.
From an agent's first command to a human opening its work.
Machines & environments
Start and stop isolated Linux workspaces. Choose from five sizes, runtime images, or custom container images. Install packages and reach the Internet with outbound access.
Images and environments →Execution & files
Run commands and managed processes. Use stdin, signals, PTYs, and reconnectable output. Read and write binary bytes, list directories, and manage filesystem metadata.
Execution tools →People & access
Use SSH, a browser terminal, or iPhone and iPad clients. Accounts, API keys, billing, quotas, protected previews, and saved workspaces complete the control plane.
Interactive access →
Use the language
you already use.
JavaScript and Python SDKs expose the same machine workflow. The HTTP API and OpenAPI description let you integrate your own agent or generate a client.
npm install @mainbrella/sdkpip install mainbrellaAn old request never becomes a new machine's command.
A slot name identifies a place. The generation identifies the machine that actually occupied it.
- Start
small, generation A.Launch execution
abc. Receive “downloading…” and “compiling…” through cursor 2. - The connection drops. A stops.
Recreate
smallas generation B: a fresh machine in the same logical slot. - The old client reconnects.
Execution
abc+ generation A + cursor 2 still identifies A's retained execution history. It never attaches to B.
# Read A's retained output, while retained
GET /containers/executions/abc/events
?id=small&createdAt=<A>&cursor=2
→ A's recorded output and status
# Try to run a command on A
POST /containers/exec
?id=small&createdAt=<A>
→ 409 Conflict
{"error":"container_not_running"}The command never runs on generation B.
The API checks the logical ID and exact createdAt before forwarding commands; the runtime rechecks generation identity. Old stdin writes are fenced out too. A malformed generation returns 400 invalid_generation. Retained history remains subject to execution retention limits.
A private machine. A real browser development loop.
Let an agent build the app, then open what it made.
Start a dev server.
Run a Next.js app inside the container on an eligible port, such as 3000.
Request a protected preview.
The gateway routes a temporary URL to the exact account, container, and generation. No public IPv4 address assigned to the container.
Edit and see the changes.
Normal browser traffic and WebSockets support the familiar hot-reload loop. Preview links expire and can be revoked.
Native Linux files. Explicit persistence.
Keep normal filesystem behavior while the machine is alive. Save when you want to keep the work.
- WorkUse the container's native filesystem.
- SaveCapture a filesystem snapshot explicitly.
- StopRelease the running machine.
- RestoreBring saved bytes into a fresh generation.
Files come back. Processes start fresh.
Ordinary stop discards unsaved filesystem changes. Save/restore preserves filesystem state; RAM, running processes, and preview sessions do not resume. Export a workspace when you want a portable backup.
A boundary you can inspect.
The repository includes coverage for save/restore, binary bytes, symlinks, permissions, timestamps, stale generations, account isolation, export, and deletion. The verification tooling is part of the project.
Already on Workers Paid? You have a head start.
Fork Mainbrella and put your existing Cloudflare account to work.
Fork it. Set your own prices. Compete with us.
Mainbrella is free software under GPL v3.0. You are welcome to inspect, fork, modify, and run the code, change the pricing, charge your own customers, and launch a hosted service that competes with mainbrella.com. You do not need a Mainbrella subscription or to pay us a software fee.
Your infrastructure runs in your account. Respect GPL v3.0, including its requirements when distributing modified software.
Read the GPL v3.0 license →Your plan already includes Container usage.
Cloudflare's $5/month Workers Paid plan includes 375 vCPU-minutes, 25 GiB-hours of memory, and 200 GB-hours of disk each month. A small deployment that stays within your account's included allowances may add no compute cost.
Containers require Workers Paid. Allowances are shared across your account; additional usage and other services can incur charges.
Cloudflare pricing and allowances →The deployment
is in the repository.
Worker code, the container runtime and Dockerfile, Wrangler configs, D1 migrations, tests, and deployment tooling are included. Start with the backend README and release runbook: configure your account bindings, domains, identity and billing integrations, and secrets; apply migrations; then deploy the runtime and API in the documented order. Adapt the account entitlements for your own installation.
Cloudflare allowances reviewed October 6, 2026. This is a self-hosting option; Mainbrella's hosted plans are a separate service.
How does this relate to Cloudflare Computer?
Shared distributed-systems problems. Different starting points.
| Design choice | Cloudflare Computer | Mainbrella |
|---|---|---|
| Core abstraction | A durable workspace/filesystem with execution attached. | A managed Linux machine with lifecycle and access attached. |
| Filesystem | Durable Object SQLite is authoritative; the Container backend mounts it through FUSE. | Native container filesystem; explicit snapshot save and restore. |
| Compute | Containers, Worker shell, and Worker JavaScript backends. | Full Linux Cloudflare Containers. |
| Product layer | A developer library to build into an application. | Accounts, billing, quotas, API keys, SDKs, SSH, terminals, previews, images, and mobile clients. |
Execution needs an owner.
Both projects address execution identity, retained output, and the risk of ambiguous command replay. Mainbrella binds machine operations to an exact generation so delayed requests cannot reach a replacement.
Keep native machines. Explore lightweight runtimes.
Mainbrella does not currently use Computer. Its Worker runtimes are an interesting direction for a separate lightweight workspace experiment. Computer currently labels itself preview-only; replacing working backend pieces needs a clear benefit and workload-specific filesystem testing.
Build a business on it.
Choose your audience, make the platform your own, and offer a service people want to use. The code is open, the pricing is yours to change, and your customers are yours to serve.