Tenants

The Tenants page — managing customer orgs, resellers, and reseller sub-accounts; their tier, status, servers, MRR, and workspace subdomains; issuing statements; and the governance rules that admit deployments and domains.

Tenants

The Tenants page is where an operator manages every customer org on the platform. It requires the tenants.manage privilege — without it the page shows a locked state ("You need the tenants.manage privilege to view orgs & billing.") instead of any data. See the god-mode overview for how that gate works.

A tenant is a customer organization. Tenants form a two-level hierarchy:

KindMeaning
directA customer that buys from you directly
resellerAn MSP-style customer who resells under their own brand
end_clientA reseller's sub-account, linked to its parent via parentTenantId

The table renders the hierarchy inline: each reseller is followed by its sub-accounts, indented one level. Direct tenants and orphaned rows follow.

What the page shows

At the top, five KPI stats summarize the fleet of customers — Active, Trialing, Resellers (with a sub-account count), Past due, and Total MRR. A badge next to the title reads persisted or demo data depending on whether a database is configured; on demo data the rows are the seeded set (Girard Media, Northwind MSP and its sub-accounts, Atlas Studio, Reform Code, Lumen Health), not live customers.

Each tenant row shows:

ColumnNotes
TenantName (click to edit) plus its live workspace link, ‹subdomain›.hostssh.com, or "no workspace"
Kinddirect / reseller / end-client
Tiersolo · team · business · msp · enterprise
Statusactive · trial · past due · churned
ServersServer count on the account
MRRDerived from the plan catalog; resellers also show a +… sub roll-up of their sub-accounts' MRR
CreatedWhen the org was created

MRR is never hand-entered — it's derived from the tenant's tier, status, and server count against the plan catalog (lib/billing/plans), so the figures here reconcile with Billing and Profitability. Trials and churned tenants contribute 0.

Below the table, a White-label brands card lists the custom-domain brands powered by the platform, each with its status, domain, owning tenant, and SPF/DKIM/DMARC readiness. Brands themselves are managed on the White-label page.

Creating and editing a tenant

New tenant opens a drawer. Clicking a tenant name opens the same drawer pre-filled for editing. The fields:

FieldNotes
NameRequired
Workspace subdomainLeave blank to auto-derive a unique slug from the name; every tenant gets a live ‹sub›.hostssh.com workspace
Kinddirect / reseller / end_client
TierSets the plan and the server cap
Parent resellerShown only for end_client — pick the reseller it belongs to
Statusactive / trial / past_due / churned
ServersBounded by the tier's server cap (shown as a hint; enforced on save)
Primary contactEmail

Server count is validated against the tier's cap on save — e.g. a solo tenant can manage at most 1 server. The subdomain is normalized to a free, claimable slug, so a name collision quietly appends a numeric suffix rather than failing.

Deleting a reseller detaches its sub-accounts (they're re-parented to none, not deleted). You can delete one tenant from its edit drawer, or select several rows and use Delete selected in the bulk bar; both ask for confirmation and cannot be undone.

Sending a statement

From a tenant's edit drawer, Send statement issues that tenant's next invoice — a real, persisted open invoice for the amount derived from the plan catalog (tenantMrr), due in 7 days. It appears on the Billing Invoices table. If the tenant's derived amount is 0 (a trial or churned org), the action reports "No amount due" rather than creating an empty invoice.

Governance: admitting deployments and domains

Tenant governance is a pure policy layer (lib/tenants/governance.ts) that server actions call before enqueuing work. It doesn't have its own page — it's the enforcement behind tenant-scoped operations. It defines, per tier, the ceilings a tenant may not exceed:

Limit (per tier)soloteambusinessmspenterprise
Max servers11030250∞
Max deployments32080800∞
Replicas per deployment124832
Max total replicas3301601,600∞
Max custom domains1315200∞
Rollback versions kept35102050

Two admission checks matter most:

  • Deployment admission (admitTenantDeployment) blocks a new deployment when the tenant is churned (export/restore only), warns when it's past due, and rejects it if any tier quota — deployments, servers, total replicas, or per-deployment replicas — would be exceeded. It also plans a replica spread across online racks, refusing multi-replica deploys that can't land on at least two separate racks.

  • Domain admission (admitTenantDomain) decides whether a tenant may claim a hostname. A tenant may use any host inside its own platform zone (‹anything›.‹tenant›.hostssh.com) or inside one of its live brand domains. It cannot claim the platform apex, a platform-reserved label, or another tenant's zone.

These rules are the same contracts future tenant-owned deployment surfaces reuse, so a customer can never out-provision or out-domain their plan regardless of which surface they act through.

  • Plans, invoices, and dunning → Billing
  • The keys these tenants' agents run on → Licensing (admin)
  • Brands and custom domains referenced here → White-label
  • Every create/edit/delete here can be reviewed in the Audit log