Open-source Grok Bot alternative with a virtual machine that bots can use
Self-hosted MausBot — design
Version 1, 2026-11-10. Each section says what it decides; Status against the code says what exists today. Anything not listed there as built is planned.
Decision
Sell self-hosted as "your servers, our control plane" (connected mode) on the Business self-hosted plan. No new repository. Air-gapped comes later.
Modes of one install
| Mode | Who | Connector | Talks to us |
|---|---|---|---|
| Standalone | Individuals, open-source | No | Only the optional services it already uses |
| Connected | Business self-hosted | Yes | One outbound connection: signed jobs in, version, health, seat count and job results out |
| Air-gapped (later) | Enterprise | No | Nothing; offline licence and update bundles |
A standalone server becomes connected by enrolling the connector. No reinstall, no data move.
Parts and where the code lives
- Home: the server image our own Clouds run (
ghcr.io/milind-soni/openmausbot). This repository. - Connector (
connector/): enrols with a one-time code, holds its own Ed25519 key, keeps one outbound WebSocket and runs only a fixed job list. No shell, no command of its own choosing, no read of a file by path. In this repository, so customers can read what it can do. It has two modes, chosen on the server when it enrols:customer-run, for a server its owner installed: seven jobs from us (start,stop,restart,update,status,backup,host-health), two more that only root on the server may run (self-update,restore), four requests it answers itself, and a reduced report. The whole list isconnector/src/customer-run.ts. This is the mode of the Business self-hosted plan.operated, for a server we run a Team Cloud on: those jobs plusexport-diskandimport-disk, astartthat carries the image and the settings, and the Admin's signed requests to the home, pairing among them.
- Installer: one script with a preflight. This repository.
- Paid-only features (SSO, seat checks):
enterprise/in this repository, under its source-available licence. - Control plane: our Admin, in a private repository: enrolment, entitlements, update scheduling, health, billing, operations.
- The licence signing key is in neither repository.
Principles
- Customer data stays on the customer's server: bots, chats, files, AI keys, people, roles, activity, usage. The admin console is served by their server.
- Our outage never stops their bots or their sign-in. Only updates and health reporting pause.
- One image. Self-hosted runs what our Clouds run; no fork, no second profile to keep safe.
- Security hardening is never paid-only. Any server more than one person can sign in to runs the hardened profile: bot sandbox on, service trust (not owner trust) for local requests, AI keys and saved logins out of a bot's reach.
- The connector's powers are a short published list, every job is signed by us and verified, every job is logged on the customer's server, and the customer can pause remote management.
- What leaves the server in connected mode is a short published list: version, health codes and counts, seat count, job results. Nothing a person wrote.
The published lists of principles 5 and 6 are the docs page
What a connected server shares. It describes the
customer-run mode as the code is, including what is still planned.
Updates
- Channel
stable: a version is promoted to stable only after our own Clouds have run it for 48 hours.latestkeeps followingmainand is not for customers. - The customer picks a weekly window, and automatic or approve-first.
- Each update: back up first, pull the image by digest, start, check health; on failed health roll back to the previous image and the backup, and report it.
- The rule that makes rollback safe: version N's data must stay readable by N-1. The data directory carries a schema marker; a change that breaks the rule ships in two releases (read the new format first, write it one release later).
- Standalone servers get the same update as one command they run themselves, or from Update server in the app on a
Docker install whose host has
deploy/update-runner.sh(the installer adds it): the server only leaves a request file, and root's runner on the host runs its own copy ofupdate.shwith no arguments taken from it. Anything running as the server's user can leave that file (bots too, while the sandbox is off on self-hosted servers), so such a run goes by the image's label only, tries each stable image once (never again after a rollback until a person runs update.sh), keeps the person's own copy of the data and its own two newest ones, and stops the server at most every four minutes. Not through the connector: that needs enrolling, and its runner takes an image from its request. - Skew: desktop and phone apps work with any stable server from the last 90 days; an older server shows a banner.
Entitlements
Replaces hand-issued licence keys: a signed document with customer, features, seats, issued, expires. Verified offline with public keys built into the app. Connected servers get a short-lived one (about 35 days) refreshed automatically; a lapse follows the existing warning and grace, then paid features stop and the server keeps running. Seats are soft: over the limit blocks new invites and shows a banner, and never locks anyone out.
Onboarding (connected)
Buy → dashboard account → Add your own server shows a one-line command with a single-use one-hour code → preflight (OS, CPU, RAM, disk, Docker, ports, DNS, outbound) → install → the server appears as pending → the Owner accepts → own domain with HTTPS → AI keys → invite the team → first bot → choose the update window. Target: under 30 minutes.
Supported at first
Ubuntu 22.04 and 24.04, x86-64, Docker. arm64 after it is tested.
Phases
- Signing key, this document in the repository.
- Design partners: hardened default, installer with preflight, stable channel and update with rollback, Add your own server (backend, UI, signing on), entitlements from the Admin, health and operations for customer servers, runbook.
- Sellable: OIDC SSO on the home, seat counting, scheduled backups to the customer's bucket, diagnostics bundle, checkout, published network list, sizing guide, DPA and SLA.
- Enterprise: air-gapped, more roles, SCIM, white-label.
Retire
The Coolify hosted-workspace path (never proven on a real install). fleet stays but is not the business offering.
The customer-run mode
Decided: the server installer brings MausBot; the connector attaches to that install and the Admin never starts it.
- Chosen on the server.
connector/install.shpickscustomer-runwhen/opt/openmausbot/compose.yamlexists and starts the connector withMAUSBOT_MODE=customer-run; the enrolment writes the mode into the connector's state. The stricter of the two always wins, and nothing the Admin sends changes it. A connector started inoperatedmode refuses to enrol where the owner's MausBot already runs. - Enforced on the server, three times over for jobs. A job outside the list is refused as it arrives
(
checkCustomerRunJob), again at the desk every job passes through (jobDesk), and the home the connector attached to has no code path for it (AdoptedHome). Each refusal is a line in the audit log. - We cannot replace the connector.
self-updatefrom the Admin is refused in this mode: any older connector image is still in our registry, and one from before the mode would run asoperated. Only root on the server replaces it (mausbot-connector job self-update), and even then not with an older version or one that names none (images.ts neverOlder, on the image's version label). - Updates only move forward. An
updateto an image older than the one running, or without a version label, is refused by the connector after it pulls the image and again bymausbot-update-runneron the host, which is the check that cannot be bypassed from the connector's container. Going back is the owner's, withupdate.shby hand.SERVER_VERSION_FLOOR(andFLOORin the runner; a test holds them equal) is a second floor, to be set to the first release with the hardened profile; it is0.0.0until such a release exists. restoreis the owner's, and a backup the owner made is never removed to make room for ours: each sender keeps its own three.- Requests never reach the home. The connector answers the four listed requests itself from the facts it already
reports (
customer-run-requests.ts). Everything else is answered 403 and logged. - The report is rebuilt, not filtered.
reducedHeartbeatandreducedReplycopy named fields; every string is an enumerated code or matches a pattern (a version, an image reference, a machine's own name for itself). A failed job sends its code and a fixed sentence; the reason stays in the audit log. - Adoption.
AdoptedHomefinds the Compose projectopenmausbot(serviceomb, Caddy in front,/databound to a folder).start,stopandrestartstart and stop those containers.backupandrestorecopy that folder to and from Docker volumes on the same server with helpers run from the home's own image. - Update: the server's own updater. The connector never recreates the owner's containers and never writes the
owner's
.env. It leavesidandimagein/var/lib/mausbot/update/request; a systemd path unit on the host runsmausbot-update-runner, which checks the image again and runs/opt/openmausbot/update.sh --image <digest>; the connector reads the exit code. So a connected update and a hand-run update are the same code, with the same copy, health check, rollback and journal. Chosen over driving Compose from inside the connector (which would need the install folder writable in a container and a Compose binary in the image) and over recreating containers through Docker's API (which would drift from the Compose file). - Seat count. The home answers
GET /api/seatswith a number, to an admin session or its own loopback. The connector reads it with one fixed command run inside the home's container, together with/api/healthand the version. - Pause.
mausbot-connector pausewrites a file in the connector's state; the running connector reads it before every job and request.
What the Admin must know
Backward compatible: a field is only ever added, and only by a customer-run server.
| Where | Field | Meaning |
|---|---|---|
EnrollRequest (POST /api/cloud/box/v1/enroll) |
mode: "customer-run" |
Present only for a customer-run server; absent means operated, exactly the request sent before. Store it with the box |
Heartbeat.heartbeat |
mode: "customer-run", paused: boolean, seats: number | null |
Present only for a customer-run server. host, home and connector keep their shape; host.checks[] carries id, ok and warning without fix; home.health.box is { box: "on" | "off", checks: null, failed: [] } (whether the bots' sandbox is on, never its checks), or null when the server does not say |
JobErrorCode |
refused_by_mode, paused, update_unavailable, update_not_started, older_version |
Only from a customer-run server. Its error message is a fixed sentence per code |
For a customer-run box the Admin should: send start with no arguments; send update with
ghcr.io/milind-soni/openmausbot@sha256:… (the server image, not the Cloud home image); never an older version than the one running; never send export-disk,
import-disk, self-update, restore or a request other than GET /v1/health, /v1/version, /v1/seats, /v1/update; send
schedule.image: null in the signed config (a Cloud home image there is accepted, any other is ignored with the whole
config); and sign people in by sending them to the server's own address, never by pairing.
Status against the code
Read at the commit that adds the customer-run mode. "Built" means the code is in this repository; it does not mean a customer can buy it.
Built
- The connector: enrolment with a one-time code, its own Ed25519 key, pinned Admin keys, one outbound WebSocket, a
fixed job list, each job signed for one server and refused 15 minutes after signing (
connector/src/protocol.ts,agent.ts,jobs.ts). - The customer-run mode described above: the job and request lists, the reduced report with a seat count, the mode in
the enrolment handshake, pause, and attaching to an installer-made server (
customer-run.ts,customer-run-requests.ts,adopted-home.ts,host/mausbot-update-runner.sh,server/routes/seats.ts). - A server the team's Owner has not accepted answers only
statusandhost-health(agent.ts). - The audit log on the customer's server,
/var/log/mausbot/audit.jsonl: one line per job, step, result and Admin request, each carrying the hash of the line before it. A job that changes something is refused when it cannot be logged (audit.ts,jobs.ts). - The owner's policy file,
/etc/mausbot/policy.json: the job kinds we may run, and a hold on updates (policy.ts). - On an operated server,
updatewith a safety copy of the data and a rollback of image and data when the new version does not report healthy (home.ts). - The connector's own installer with a preflight,
connector/install.sh, which the Admin is to serve with its address and the connector's image digest filled in. - The offline licence check for paid features (
enterprise/server/license.ts).
Different from this document
- Updates on a connected server need
update.shin place. The connector hands an update to/opt/openmausbot/update.sh. The installer places that file only once it and the update command have merged (see In review), so until then theupdatejob is refused withupdate_unavailableand nothing changes. - Backups stay on the server.
backupcopies the data to a Docker volume on the same server. A bucket the customer configures is phase 2. - Pausing is a command.
mausbot-connector pause; a switch in Settings is planned. The heartbeat keeps going while paused. - Emailed sign-in codes pass through us unless the customer sets a mail server. Pairing codes never do. So
principle 2 holds for sign-in by pairing code always, and by emailed code only with
OMB_SIGNIN_SMTP_URL. - The home's own traffic is unchanged by connecting. A report a person sends by tagging
@devscarries their message, the bot's name and recent log lines to us, and its status is asked hourly while it is open; browser analytics are on until a person turns them off. Principle 6 is about the connector; these are the docs page's "What your server itself still sends". - Connector images are not signed. Only the owner replaces the connector on a customer-run server, and never
with an older one, but what they install is trusted by its digest and our registry alone. Planned: a signing key's
public half built into the connector, the signature of the new image's digest checked in
images.tsbefore it runs (theImageCheckhook is where it plugs in), and the same check inconnector/install.sh. - The hardened floor is not set. The mechanism is built and tested; the number waits for the first release with the hardened profile.
- A connector is updated by hand. Since we cannot send
self-update, a fix to the connector reaches a customer-run server only when its owner runs it. The Admin should show which servers run an old connector. - The WebSocket close reason is empty from a customer-run server; the code says why.
- Only one layout is adopted. Docker Compose from the server installer, the published image, data in a folder. A source build or an npm install cannot be connected.
- The seat count is a lower bound for a domain entry.
@example.comon the sign-in list counts each person from it once they have signed in. - The update window. The connector receives and keeps the window the Admin signs, and runs an update when the Admin sends the job. Choosing the window is the Admin's.
- Not run on a real server yet. The customer-run path is covered by unit tests and a run against a local Docker
with a stand-in server; the connector's end-to-end run (
connector/e2e/run.sh) still covers only the operated mode.
In review
Written and under review, not merged:
- The installer (
deploy/install.sh, #5158): the preflight, the install under/opt/openmausbot, and for a version with the hardened profile the host's preparation for the bots' sandbox and the server's own self-check of it. It placesupdate.shand keeps the version that pins. - The
stablechannel and the one-command update with rollback for standalone servers (deploy/update.sh, #5171). Nostableimage tag is published yet. - The hardened default for shared servers and the server image (#5180).
They can merge in any order. The installer turns the sandbox on and places update.sh only once the other two are on
main and a release carries the hardened profile; before that it says what is not there yet.
Planned
Entitlements from the Admin with seats, Add your own server in the dashboard, the schema marker in the data directory, the 90-day skew banner, and everything in phases 2 and 3.