berth

API and automation

The berth command line

An overview of the berth CLI on the server: the command tree by area, how it talks to the agent, --local, reading secrets from stdin, JSON output and everyday examples.

Updated 5 min readcli · command line · berth · terminal · scripting · sshView as Markdown

On this page
  1. How it runs
  2. Finding your way: --help
  3. The command tree by area
  4. Passwords and secrets: never on the command line
  5. Output for scripts
  6. Everyday examples
  7. Things only root can do
  8. When the panel is down
  9. Related

berth is the command-line tool on the server itself. It covers everything the panel does, from creating a customer to migrating a Plesk server, and some things the panel deliberately leaves to root, such as approving a domain move or trusting an extension publisher. You never need it for daily work, but it is the natural tool for scripts, configuration management and for the moments when the web interface is not reachable.

How it runs

  • Run berth on the server as root. Some read commands also work for members of the berth group, but they get only what the panel itself may do.
  • By default a command talks to berth-agent, the small root service that performs privileged work, over its local socket. The agent validates each operation and runs it in a separate subprocess, exactly as it does for the panel. See Architecture.
  • Many commands accept --local: run the operation in-process as root instead of through the agent. That is useful when the agent itself is the problem, and during installation or recovery.
  • Changes made with the CLI land in the same panel database and the same activity log as changes made in the panel.

Finding your way: --help

Every level has help:

berth --help                     # all top-level commands with a one-line description
berth backup --help              # the subcommands of backup
berth backup schedule add --help # the flags of one command

Shell completion is available for bash, zsh, fish and PowerShell:

berth completion bash > /etc/bash_completion.d/berth

The panel shows the matching CLI command next to many actions, which is a quick way to learn the right flags.

The command tree by area

There are more than 100 top-level commands. Grouped by what they are for:

AreaCommands
Setup and lifecycleinstall, uninstall, doctor, repair, rescue, dr, update, license, release, offline-bundle, version, modules, export, status, task, job, watchdog, vulndb
Customers and tenancycustomer, subscription, plan, reseller, brand, transfer, search, quota, lock, egress, beleid
Accessadmin, admins, approvals, sso, token, ssh, sftp, sshd, admin-term, audit, auditwatch, privacy, evidence, incident
Integrationswebhook, extension, homeassistant, ai, openapi, fleet
Websitesdomain, php, tls, cdn, geoip, ip, render, sjablonen, files, ftp, cron, git
Mail and DNSmail, mail-reports, lists, dns
Databases and backupsdatabase, backup
Applicationssoftware, wp, joomla, drupal, nextcloud, matomo, laravel, app, container, docker, sysapp
Monitoring and logsuptime, webvitals, stats, logs, logdrain, report, notify, alert, siem
Server managementsystem, service, service-backup, service-update, component, unit, proc, ports, inventory, integrity, hardening, mitigation, maintenance, snapshot, storage, panel, agent, security, waf
Migrationmigrate, migration, import

The server-management commands that have no page of their own in this library are explained here: admins and sshd in Firewall and bans, sysapp in system apps, ip in Customers and packages, system local-config in How changes go live, sjablonen in Web server settings, service-update in Services and diagnostics, and system repos and system lifecycle in OS updates and maintenance.

Most commands have subcommands: berth mail account add, berth backup history restore, berth migration cutover … go.

Addressing things

Commands use the same names as the panel:

  • a customer by login: --customer acme;
  • a subscription by its system user: --sysuser acme;
  • a domain by name: --domain acme.nl;
  • a mailbox by address: --address info@acme.nl;
  • a package by name: --plan basis.

Passwords and secrets: never on the command line

Arguments end up in the shell history and are visible in the process list to other users. Berth therefore never takes a password or key as a plain argument. Commands that need one read it from standard input or from a file:

PatternUsed by, for example
--password-stdincustomer add, customer login add, reseller create, ftp add, migration add
--key-file -, --token-file, --secret-fileDNS provider tokens, AI provider keys, S3 keys, API tokens of another server
--code-file -license activate
--passphrase-file -transfer export, import and pull
--client-secret-file -sso set

Typical use:

printf '%s\n' "$PW" | berth customer add --login acme --name "Acme" \
  --email info@acme.nl --password-stdin
berth dns account-add --provider cloudflare --name cf --token-file /root/cf-token.txt
berth license activate --code-file - < licence-code.txt

Secrets that Berth generates (a mailbox password left empty, an API token, a webhook secret) are printed once. Store them where they belong straight away.

Output for scripts

  • Many read commands accept --json, for example berth status --json, berth doctor --json, berth search acme --json, berth backup list --json, berth task list --json.
  • berth doctor and berth hardening exit with status 1 when a check fails, so they fit in monitoring or a deploy pipeline. berth status always exits 0, even when something is pending.
  • Long work runs as a job or background task. berth job log <id> --follow and berth task show <id> --wait follow it until it is done; many commands accept --wait themselves.

Everyday examples

Customers and packages (details):

berth plan set --name basis --php 8.3 --disk-mb 10240 --max-domains 5 --max-mailboxes 20
berth customer create --customer acme --domain acme.nl --plan basis --tls --email info@acme.nl
berth subscription usage --sysuser acme
berth subscription suspend --sysuser acme --reason "Invoice overdue"

Mail and DNS (mailboxes, DNS):

berth mail enable --domain acme.nl
berth mail account add --address info@acme.nl --quota-mb 2048
berth mail status --domain acme.nl --check
berth dns link --domain acme.nl --auto && berth dns apply --domain acme.nl

Backups and restore (restoring data):

berth backup schedule list
berth backup history restore --sysuser acme --at "2026-10-28 14:00" \
  --domain acme.nl --path httpdocs/wp-config.php

Server health and updates (OS updates, updating Berth):

berth doctor
berth system updates
berth update --check
berth logs --unit nginx --priority err --since 1h

Finding things:

berth search acme          # domains, mailboxes, aliases, databases, subscriptions, customers, logins
berth status               # background tasks, pending actions and notices

Things only root can do

A few actions are deliberately not available in the panel or the API, so that a compromised panel process cannot perform them. They are done on the server as root:

  • approving a request to move a domain to another subscription (berth domain move-approve);
  • trusting an extension publisher (berth extension trust add);
  • changing the server policy with hard limits that packages cannot loosen (berth beleid);
  • installing an unsigned or HTTP extension (berth extension install).

When the panel is down

The CLI does not depend on the web interface. If the panel daemon will not start, berth doctor shows why, berth repair re-renders configuration from the database and fixes ownership, and berth rescue opens a recovery menu that works even without the database. See Rescue mode and Services and diagnostics.