Customers and resellers
Customers, subscriptions and packages
Define packages with limits, give one subscription its own exceptions, change packages, suspend, move, assign a dedicated IP, transfer to another Berth server or log in as the customer.
On this page
- How customers, subscriptions and packages fit together
- Creating a package
- What each limit does
- Creating a customer and a subscription
- Exceptions for one subscription
- Changing package
- Suspending
- Moving a subscription or a domain
- A dedicated IP address
- Usage and alerts
- Transferring a subscription to another Berth server
- Logging in as the customer
- Extra logins for a customer
- Removing a customer
A hosting customer in Berth is a customer with one or more subscriptions, and every subscription is built from a package. This article covers the day-to-day work of a hosting company: designing packages, creating customers, giving one subscription an exception, and suspending, moving or transferring it later. Everything here can be done in the panel, through the REST API and with the berth CLI.
How customers, subscriptions and packages fit together
- A customer is the account that owns things and can log in. A customer may belong to a reseller.
- A subscription is one hosting space: a system user with its own uid, its own webspace under
/var/www/vhosts, its own PHP-FPM pools and its own systemd slice for CPU, memory and IO. Domains, mailboxes, databases, cron jobs and containers all belong to a subscription. See Domains and subscriptions and Isolation. - A package is the template a subscription follows: limits, PHP defaults and what the customer may use. Change the package and every subscription on it follows, unless that subscription has its own exception.
In the CLI a subscription is addressed by its system user (--sysuser acme), a customer by its login (--customer acme).
Creating a package
Panel: Admin → Packages → New package. CLI:
berth plan set --name basis --php 8.3 --disk-mb 10240 \
--max-domains 5 --max-mailboxes 20 --max-databases 5 --for-resellers
berth plan listberth plan set creates the package or updates it by name. For count limits, 0 means unlimited.
What each limit does
| Setting | Flag | Effect |
|---|---|---|
| Domains, mailboxes, databases, database users, cron jobs, extra FTP accounts, containers | --max-domains, --max-mailboxes, --max-databases, --max-db-users, --max-cron, --max-ftp-users, --max-containers | Hard caps per subscription; the panel refuses to create more. |
| Disk space | --disk-mb | Web, mail, databases and containers together. Enforced with filesystem quota where the filesystem supports it: the package value is the soft limit, with a slightly higher hard limit and a grace period. |
| Files (inodes) | --inodes | Soft limit on the number of files and folders, so a cache or session folder with millions of tiny files cannot exhaust the file system. By default 100 per MB of disk space, at least 250,000; -1 means no limit. Only an administrator sets it. |
| Traffic | --traffic-mb | Monthly soft limit: a warning, not a block. |
| Mailbox quota | --mailbox-quota-mb | Default quota for new mailboxes, enforced by Dovecot. |
| PHP | --php, --fpm-pm, --fpm-max-children, --php-setting key=value | Default PHP version, FPM process model, worker count and php.ini defaults. |
| PHP settings locked | --php-locked | The customer cannot change PHP version or php.ini of their domains. |
PHP mail() | --php-mail | Off by default: a hacked site cannot spam through mail(); sites send through SMTP with a mailbox. |
| PHP may start processes | --php-shell | Off by default: exec, system, proc_open and similar stay disabled. |
| Outbound mail budget | --mail-per-hour | Recipients per hour for the subscription, shared by every way mail can leave. |
| Isolation | --cpu-percent, --memory-mb, --max-processes, --io-mbps, --io-iops | Limits on the subscription's systemd slice. 200 CPU percent is two cores. |
| Network connections | --conn-max, --conn-rate | Simultaneous TCP connections, and new outgoing connections per second, for the subscription. |
| Database behaviour | --db-connections, --db-user-connections, --db-statement-seconds | Concurrent connections (by default 60 for the subscription and 20 per database user) and how long one query may run before MariaDB or PostgreSQL stops it. |
| WAF | --waf-mode, --waf-level, --waf-exclude | Mode and strictness for the subscription's domains. See WAF. |
| Features | --shell, --apps, --containers, --postgresql, --no-object-cache | Browser terminal and SSH, Node.js/Python apps, rootless containers, PostgreSQL next to MariaDB, and the per-subscription Valkey object cache. |
| Outbound traffic | --egress-restricted | Sites, apps and containers may reach only web, DNS and the server's own services, with exceptions per subscription. |
| DNS | --dns-template-file, --dns-locked | Records added to every new zone, and whether the customer may edit records. |
| Custom web server rules | --custom-web-directives | Lets the customer and reseller add their own nginx/Apache directives per domain. Off by default. |
| Customer alerts | --notify-customer | The customer also gets the disk warnings (80 % and 95 %) and the traffic warnings (80 % and 100 %). |
| For resellers | --for-resellers | Resellers may put their customers on this package. |
The server owner can set hard limits in the server policy that no package can loosen; see Web server settings.
Packages on several servers
Packages → Export (JSON) downloads all packages; importing the file on another server creates or updates them by name.
berth plan export --out packages.json
berth plan import packages.jsonCreating a customer and a subscription
- Customers → Add customer. Enter login, name and e-mail, optionally a reseller and a password.
- Domains → Add. Choose the customer and the package. A new domain gets its own subscription, or joins an existing subscription of the same customer.
On the command line, a password is always read from standard input so it stays out of the shell history:
printf '%s\n' "$PW" | berth customer add --login acme --name "Acme" \
--email info@acme.nl --password-stdin
berth customer create --customer acme --domain acme.nl --plan basis \
--tls --email info@acme.nlberth customer create sets up the subscription and the first domain in one go (system user, webspace, PHP-FPM pool, web server configuration and, with --tls, a certificate). Running it again is safe.
Exceptions for one subscription
Sometimes one customer needs more databases or mail() switched on without a new package. On the customer page, open the subscription and choose Adjust package. An empty field follows the package, also when the package changes later. Exceptions stay in place when the subscription moves to another package.
berth subscription override --sysuser acme # package, exceptions, effective values
berth subscription override --sysuser acme --set php_mail=aan --set max_databases=20 \
--php memory_limit=512M
berth subscription override --sysuser acme --unset max_databases # follow the package again
berth subscription override --sysuser acme --clear # remove all exceptionsIsolation limits can only be changed by an administrator.
Changing package
Choose the new package at the subscription on the customer page, or:
berth subscription plan --sysuser acme --plan webshopThe subscription's domains are provisioned again with the new settings.
Suspending
| What | How | Effect |
|---|---|---|
| A whole customer | Customer page → Suspend; berth customer suspend --customer acme --reason "…" | All sites show a suspension page; customer logins and mailboxes can no longer sign in. Incoming mail is still accepted. Nothing is deleted. |
| One subscription | Subscription on the customer page; berth subscription suspend --sysuser acme --reason "…" | Websites, SSH/SFTP, cron, FTP and mail of that subscription are closed; apps and containers stop. The customer's other subscriptions keep working. |
The reason is visible to administrators only. unsuspend reverses everything. To take a single website offline instead, see Domains and subscriptions.
Moving a subscription or a domain
- Subscription to another customer: customer page → To another customer, or
berth subscription move --sysuser acme --customer newco. Nothing changes on disk. - Domain to another subscription: domain page → Move to another subscription. Files get the new owner; certificate and mail move along; databases and cron jobs stay with their subscription. Because this hands one customer's files to another, a move started from the panel or the API is a request that root approves outside the panel (
berth domain move-requests, thenberth domain move-approve <id>ormove-reject).
A dedicated IP address
A free address of the server can become the subscription's own address. All its domains move to it, and outgoing mail for those domains leaves from that address.
berth ip list
berth subscription ip --sysuser acme --ipv4 203.0.113.20 --ipv6 2001:db8::20
berth subscription ip --sysuser acme --shared # back to the shared addressAn address the server does not have yet is added with berth ip add, which first checks that no other machine on the network already uses it (ARP for IPv4, NDP for IPv6) and keeps it after a reboot. berth ip check does only the check, berth ip remove takes an unused address away again, and berth ip default chooses which address new domains get:
berth ip add 203.0.113.20
berth ip default --ipv4 203.0.113.10The panel lists the A/AAAA records to change when it does not manage the DNS itself, and it regularly checks that the address has a matching PTR record and that SPF allows it; mail from an address without them is often refused by large providers.
Usage and alerts
The panel compares usage with the package every hour. Subscriptions at or above 80 % of their disk or traffic limit are listed at the top of Packages. Administrators get a notice when a subscription reaches 80 % of its disk space (critical from 95 %), and at 80 % and 100 % of its monthly traffic.
berth subscription usage --sysuser acme
berth plan warningsWith --notify-customer on the package, the customer gets the same warnings. Notification channels are covered in Notifications and alerts.
Transferring a subscription to another Berth server
A subscription can move to another Berth server as one encrypted file: files, databases, mail, logins with their password hashes and second factor, DKIM keys, certificates, aliases, cron jobs and domain settings.
- On the old server: customer page → Move to another Berth server, choose a passphrase and click Create export file.
- On the new server: Admin → Migration → Import, upload the file with the passphrase, or let the new server fetch it with an administrator API token of the old one.
berth transfer export --sysuser acme --out acme.berth --passphrase-file -
berth transfer import --file acme.berth --passphrase-file - --dry-run
berth transfer pull --from https://old-panel.example.nl --token-file token.txt \
--sysuser acme --passphrase-file ---dry-run reports conflicts without changing anything. Container images the customer uploaded themselves are only included with --images (berth transfer images shows their size first). For whole servers, see Migrating a server.
Logging in as the customer
On the customer page, Log in as this customer opens the panel exactly as the customer sees it, with a banner at the top and a button Back to admin. Resellers can do the same for their own customers. Impersonation always needs a real panel session: no API token can do it. Every impersonation is recorded in the audit trail and reported by the audit watchdog.
Extra logins for a customer
A customer can add restricted logins for a web developer or bookkeeper with only the areas they need (domains, files, databases, mail, WordPress, backups, statistics, cron, security), optionally for one subscription:
berth customer login add --customer acme --login webdev --perms domains,files,wordpress \
--sysuser acme --password-stdinSee Roles and permissions for what each role can see.
Removing a customer
Remove the domains first (domain page → Delete domain, or berth domain remove --domain acme.nl, with --purge to delete the webspace too), then the customer on the customer page or with berth customer remove --customer acme. With four-eyes approval enabled, removing the customer, and removing a domain together with its webspace (--purge), become a request to a second administrator.
A removed domain name stays reserved for the same customer for 30 days, so no one else can take it over while DNS may still point here. berth domain release --domain acme.nl frees it earlier for someone else; see Domains and subscriptions.