# Berth library — all articles Generated from https://www.berthpanel.app/library/. Each article starts with a level-1 heading. # What is Berth? > A self-hosted web hosting control panel in Go that keeps Plesk's on-disk layout, isolates every subscription, validates every change before it goes live, and manages the whole server from the browser. Source: https://www.berthpanel.app/library/what-is-berth/ · Category: start · Updated: 2026-10-30 Berth is a web hosting control panel that you install on your own server. It manages websites, PHP, certificates, mail, DNS, databases, backups and the server itself, for one administrator or for a hosting company with resellers and thousands of customers. This page explains who it is for, what it covers and what sets it apart, with links into every part of the library. ## Who Berth is for - **Hosting companies and resellers** who want a panel for shared hosting with packages, resellers, white label and billing integration, and who are looking for a way off Plesk, cPanel or DirectAdmin without asking customers to change anything. - **Agencies and developers** who host their own clients' sites and want WordPress, Joomla, Drupal, Node.js, Python, Git deploys and containers in one place. - **System administrators** who want to run a server without opening a terminal for routine work: OS updates with rollback, services, logs, disks and diagnostics are all in the panel. - **Corporate and government IT** that needs separation between tenants, an audit trail, four-eyes approvals, single sign-on and evidence for audits. ## What it runs on Berth runs on Debian 13, Ubuntu 24.04 and 26.04 LTS, and AlmaLinux and Rocky Linux 10, on amd64 and arm64. It is written in Go and uses the standard open-source stack: nginx in front of Apache, PHP-FPM, Postfix, Dovecot, rspamd, ClamAV, MariaDB, PostgreSQL, BIND, restic and Podman. See [System requirements](https://www.berthpanel.app/library/system-requirements/) and [Installing Berth](https://www.berthpanel.app/library/install/). The panel speaks English, Dutch, German, French, Spanish, Polish, Ukrainian and Italian; each login chooses its own language, and mail from the panel goes out in the recipient's language. Everything in the panel is also available through the [`berth` command line](https://www.berthpanel.app/library/berth-cli/) and the [REST API](https://www.berthpanel.app/library/rest-api/). ## What it covers ### Websites and applications - Domains, subscriptions, aliases, redirects and per-domain settings: [Domains and subscriptions](https://www.berthpanel.app/library/domains-and-subscriptions/), [Web server settings](https://www.berthpanel.app/library/web-server-settings/). - PHP 5.6 to 8.5 per domain, with a separate PHP-FPM per subscription: [PHP](https://www.berthpanel.app/library/php/). - Let's Encrypt and other certificate authorities, wildcards via DNS-01: [Certificates](https://www.berthpanel.app/library/certificates/). - Page cache, object cache, WebP/AVIF and CDN integration: [Caching and CDN](https://www.berthpanel.app/library/caching-and-cdn/). - A per-domain security and performance score with fixes: [Site quality scores](https://www.berthpanel.app/library/site-quality-scores/). - A vendor-verified installer for WordPress, Joomla, Drupal, Nextcloud and Matomo, with [smart updates](https://www.berthpanel.app/library/smart-updates/) tested on a copy first and two-way [staging](https://www.berthpanel.app/library/staging/): [Software installer](https://www.berthpanel.app/library/software-installer/). - [Node.js and Python apps](https://www.berthpanel.app/library/node-python-apps/), [Git deploy](https://www.berthpanel.app/library/git-deploy/), rootless [containers](https://www.berthpanel.app/library/containers/) and [scheduled tasks](https://www.berthpanel.app/library/cron/). ### Mail and DNS - Mailboxes, aliases, forwarding and autoresponders: [Mailboxes](https://www.berthpanel.app/library/mailboxes/). - DKIM, SPF, DMARC with report reading, MTA-STS, TLS-RPT and DANE: [Mail authentication](https://www.berthpanel.app/library/mail-authentication/). - [Spam and antivirus](https://www.berthpanel.app/library/spam-and-antivirus/), one [outbound budget](https://www.berthpanel.app/library/outbound-mail/) per subscription, [webmail](https://www.berthpanel.app/library/webmail-and-mail-clients/), built-in [mailing lists](https://www.berthpanel.app/library/mailing-lists/), and [mail import or Microsoft 365 / Google Workspace](https://www.berthpanel.app/library/mail-import-and-external-providers/). - DNS elsewhere with checking, through a provider's API, or on the server itself with DNSSEC: [DNS](https://www.berthpanel.app/library/dns/). ### Data and backups - MariaDB and PostgreSQL per subscription, with [point-in-time restore](https://www.berthpanel.app/library/point-in-time-restore/): [Databases](https://www.berthpanel.app/library/databases/). - File manager, FTPS, SFTP and a sandboxed shell: [Files, FTP and SSH](https://www.berthpanel.app/library/files-ftp-ssh/). - Deduplicated, encrypted backups with an hourly local history, S3 with Object Lock, an append-only NAS, fine-grained restore, weekly restore tests and full-server disaster recovery: [Backups overview](https://www.berthpanel.app/library/backups-overview/), [Backup to S3](https://www.berthpanel.app/library/backup-to-s3/), [Backup to a NAS](https://www.berthpanel.app/library/backup-to-nas/), [Restoring data](https://www.berthpanel.app/library/restoring-data/), [Restore tests](https://www.berthpanel.app/library/restore-tests/), [Disaster recovery](https://www.berthpanel.app/library/disaster-recovery/). ### Moving to Berth - Whole Plesk, cPanel and DirectAdmin servers are taken over with passwords, mail UIDs and database hashes intact, and the cutover is an IP takeover: [Migration overview](https://www.berthpanel.app/library/migration-overview/), [Migrating a server](https://www.berthpanel.app/library/migrate-a-server/), [Parity checks](https://www.berthpanel.app/library/parity-checks/). - Single accounts can be read from backup files: [Importing backup files](https://www.berthpanel.app/library/import-backup-files/). ### Security, monitoring and the server - [Sign-in security](https://www.berthpanel.app/library/sign-in-security/) with passkeys, [single sign-on](https://www.berthpanel.app/library/single-sign-on/), [malware scanning](https://www.berthpanel.app/library/malware-scanning/), a [WAF](https://www.berthpanel.app/library/waf/), [firewall and bans](https://www.berthpanel.app/library/firewall-and-bans/), [vulnerability management](https://www.berthpanel.app/library/vulnerability-management/) and an [audit trail with approvals](https://www.berthpanel.app/library/audit-trail-and-approvals/). The overall design is in [Security model](https://www.berthpanel.app/library/security-model/). - [Uptime and status pages](https://www.berthpanel.app/library/uptime-and-status-pages/), [statistics and metrics](https://www.berthpanel.app/library/statistics-and-metrics/), [notifications and alerts](https://www.berthpanel.app/library/notifications-and-alerts/), [logs and log drains](https://www.berthpanel.app/library/logs-and-log-drains/). - [OS updates and maintenance](https://www.berthpanel.app/library/os-updates-and-maintenance/), [services and diagnostics](https://www.berthpanel.app/library/services-and-diagnostics/), [disks and snapshots](https://www.berthpanel.app/library/disks-and-snapshots/), a [rescue mode](https://www.berthpanel.app/library/rescue-mode/) for when the panel itself is down, and [Fleet](https://www.berthpanel.app/library/fleet/) for managing many Berth servers together. ### Business and automation - [Customers and packages](https://www.berthpanel.app/library/customers-and-packages/), [resellers and white label](https://www.berthpanel.app/library/resellers-and-white-label/), [WHMCS and HostBill](https://www.berthpanel.app/library/billing-integration/). - [REST API with OpenAPI](https://www.berthpanel.app/library/rest-api/), the [CLI](https://www.berthpanel.app/library/berth-cli/), [webhooks and extensions](https://www.berthpanel.app/library/webhooks-and-extensions/), an [AI assistant and MCP endpoint](https://www.berthpanel.app/library/ai-assistant-and-mcp/), and [Home Assistant](https://www.berthpanel.app/library/home-assistant/). - [GDPR](https://www.berthpanel.app/library/gdpr/), [NIS2 and incidents](https://www.berthpanel.app/library/nis2-and-incidents/), and [evidence for audits](https://www.berthpanel.app/library/evidence-for-audits/). ## What makes it different ### Plesk-compatible on disk Berth keeps Plesk's layout: websites in `/var/www/vhosts/`, Maildir under `/var/qmail/mailnames`, the same groups and the same uids and gids as the source server, and the same Dovecot folder namespace. A migration copies data into the place it already had, and mail clients do not download everything again. See [On-disk layout](https://www.berthpanel.app/library/on-disk-layout/). ### An unprivileged panel and a small root agent The panel daemon that serves the UI and the API runs as an ordinary user. Everything that needs root goes to a separate agent over a local socket, as one of a fixed set of typed operations, each checked against an explicit policy. There is no generic "run this command" operation. See [Architecture](https://www.berthpanel.app/library/architecture/). ### Every change is validated before it goes live Service configuration is rendered from the panel database, staged, checked with the service's own config test, swapped in atomically and only then reloaded. A change that fails the test is rolled back, and one customer's broken file is set aside so it cannot block anyone else. See [How changes go live](https://www.berthpanel.app/library/how-changes-go-live/). ### Real isolation per subscription Each subscription gets its own systemd slice with CPU, memory, process and disk-IO limits, its own PHP-FPM, `open_basedir`, a disk quota, no access to the panel's or other subscriptions' local ports, optionally (per package) an outbound network fence and, for containers, its own user namespace. A hacked or overloaded site is contained within its own subscription as far as possible. See [Isolation](https://www.berthpanel.app/library/isolation/). ### Never a terminal for routine work OS updates with snapshots and rollback, emergency patches for actively exploited vulnerabilities, services, logs, disks, time and network checks, and a daily diagnosis with fix buttons are all in the panel. See [OS updates and maintenance](https://www.berthpanel.app/library/os-updates-and-maintenance/) and [Services and diagnostics](https://www.berthpanel.app/library/services-and-diagnostics/). ### Tested recovery Backups are tested by restoring them in a sandbox every week. In a full disaster-recovery drill, 25 subscriptions with about 113 GB of sites, mail and databases came back from S3 in 79 minutes, with every database and every mailbox identical. Migration from Plesk has been rehearsed end to end on a production server with 25 accounts. ## Licensing One licence per server unlocks every feature, including Fleet; there are no editions. A new installation runs as a full 30-day trial without a licence, and Berth never takes sites, mail or databases offline over a licence. See [Licence and trial](https://www.berthpanel.app/library/licence-and-trial/). ## Where to start 1. Check the [system requirements](https://www.berthpanel.app/library/system-requirements/). 2. [Install Berth](https://www.berthpanel.app/library/install/). 3. Follow [First steps](https://www.berthpanel.app/library/first-steps/) to set up the panel, a package, a customer and a domain. 4. Read [Architecture](https://www.berthpanel.app/library/architecture/) and [How changes go live](https://www.berthpanel.app/library/how-changes-go-live/) if you want to know how it works underneath. --- # System requirements > Supported operating systems and architectures, recommended CPU, memory and disk, and what you need before you install: a fresh server, a VPN, DNS names and outbound internet. Source: https://www.berthpanel.app/library/system-requirements/ · Category: start · Updated: 2026-10-30 Berth is installed on a fresh, dedicated server or virtual machine. This page lists the operating systems it supports, the hardware it needs in practice and the things to arrange before you run the installer, so the installation does not stop halfway. ## Operating systems Berth works through an OS adapter: the same panel, with the package names, service names and paths of each distribution translated for you. The installer refuses any other version. | Operating system | Supported | Notes | |---|---|---| | Debian 13 | yes | The primary platform. PHP from the Sury repository. | | Ubuntu 26.04 LTS | yes | Same package generation as Debian 13; PHP from Sury. Berth adds its own AppArmor rules where needed. | | Ubuntu 24.04 LTS | yes | Older package versions, which Berth adapts to. | | AlmaLinux 10 | yes | Packages from the OS, EPEL, Remi (PHP) and the rspamd repository, which the installer sets up. SELinux stays enforcing. | | Rocky Linux 10 | yes | As AlmaLinux 10. | | AlmaLinux 9, Rocky Linux 9 | no | | | Other distributions or versions | no | | Two platform differences to be aware of: - **Package vulnerability scanning** of OS packages works on every supported OS. Berth matches the installed packages against its own vulnerability database (OSV: the Debian security data, the Ubuntu Security Notices including Ubuntu Pro, and the AlmaLinux and Rocky Linux advisories). On Debian, debsecan adds a second check against the Debian security tracker, and on AlmaLinux and Rocky Linux the dnf errata do the same; Ubuntu has no such second check. The other parts of [vulnerability management](https://www.berthpanel.app/library/vulnerability-management/) (PHP, Node.js, lockfiles, container images) work the same everywhere. - **Restoring onto a different OS** is supported: a backup of a Debian server can be restored onto AlmaLinux or Ubuntu and the other way round. See [Disaster recovery](https://www.berthpanel.app/library/disaster-recovery/). ## Architecture Berth runs on **amd64** (x86_64) and **arm64** (aarch64). Release packages exist for both. ## Hardware Berth itself sets no hard minimum. What you need depends on the number of sites, mailboxes and databases and on which parts you install. These are recommendations: | | Minimum | Recommended for production | |---|---|---| | CPU | 2 vCPU | 4 vCPU or more | | Memory | 4 GB | 8 GB or more | | Disk | 40 GB | SSD, large enough for sites, mail, databases and local backups | Things that use noticeable resources: - **ClamAV** (malware scanning, upload scanning, mail antivirus) keeps about 1 GB of memory while `clamd` runs. The realtime malware scan and upload scanning are switched on by default only on servers with at least 2 GB of memory. On a small server you can leave ClamAV out with `--no-malware`. - **Local backups** stay on the same disk: by default the last 7 nightly archives per subscription, plus the hourly deduplicated history. Count that space in. See [Backups overview](https://www.berthpanel.app/library/backups-overview/). - **A PHP-FPM per subscription** costs roughly 15 to 20 MB of memory per subscription and PHP version while idle. On a small server with many subscriptions you can choose to give only packages with limits their own FPM. See [Isolation](https://www.berthpanel.app/library/isolation/). - **PostgreSQL, Node.js, Python and Podman** are installed only when a package allows them and they are first used. ## What you need before you install 1. **A fresh server.** A clean installation of a supported OS, without another hosting panel or hand-made web server configuration. To move away from an existing panel, install Berth on a new server and migrate into it (see [Migration overview](https://www.berthpanel.app/library/migration-overview/)). 2. **Root access.** 3. **A VPN to the server: Tailscale or WireGuard.** After installation, administrative SSH on port 22 is reachable only through a VPN interface, never from the internet. The installer refuses to run without a VPN interface, so set it up first and check that you can log in through it. Existing SSH sessions stay connected, so you do not lock yourself out mid-install. 4. **A fully qualified host name** for the server, for example `server.example.nl`, with an A record (and AAAA if you use IPv6) pointing at the server. Berth uses it for the mail server and the server certificate. 5. **A name for the panel**, for example `panel.example.nl`, also with an A record to the server. It may be the same as the host name. Webmail and Adminer can later get their own names next to it; the panel suggests `webmail.` and `adminer.` in front of the panel name. 6. **Outbound internet** for packages, Let's Encrypt and the licence check. For networks without internet there is an offline bundle; see [Installing Berth](https://www.berthpanel.app/library/install/#installing-without-internet). ### For mail Ask your provider to set the **reverse DNS (PTR record)** of the server's IP address to the host name, and check that outbound traffic on **port 25** is not blocked. Without those two, mail from the server is often rejected or marked as spam. ## Ports The panel's own firewall is switched on by a new installation, with the ports of the services you installed. If there is also a firewall in front of the server (at your provider or in your hypervisor), open the same ports there. | Port | Protocol | Service | |---|---|---| | 80, 443 | TCP | Websites, panel, webmail | | 443 | UDP | HTTP/3 (QUIC); open with the websites, used when HTTP/3 is switched on | | 25 | TCP | Receiving mail (SMTP) | | 465, 587 | TCP | Sending mail from mail clients | | 143, 993 | TCP | IMAP | | 110, 995 | TCP | POP3 | | 4190 | TCP | ManageSieve (closed by default) | | 21 | TCP | FTP with mandatory TLS, plus a passive port range | | 53 | TCP and UDP | DNS for ACME delegation and the server's own DNS (open by default; close it under *Firewall* if you use neither) | | 41641 | UDP | Tailscale direct connections | | 3306, 5432 | TCP | MariaDB and PostgreSQL from outside, only for allowed hosts | | 22 | TCP | Administrative SSH, **only through the VPN** | Customers use SFTP and SSH on a separate port, shown in the panel. Administrators never use the customer port, and customers never use port 22. On AlmaLinux and Rocky Linux the installer also opens the ports of the installed services in firewalld, if it is running. ## Next step When everything above is in place, continue with [Installing Berth](https://www.berthpanel.app/library/install/). --- # Installing Berth > Install Berth on a fresh server with the signed one-line command, a deb or rpm package, a release directory or an offline bundle, choose which parts to install, and claim the panel with the setup code. Source: https://www.berthpanel.app/library/install/ · Category: start · Updated: 2026-10-30 This page takes you from a fresh server to a running panel. Every installation method ends in the same command, `berth install`, which sets up the whole web stack and can safely be run again: what is already there stays, and what is missing is repaired. Check the [system requirements](https://www.berthpanel.app/library/system-requirements/) first; in particular, the server needs a working VPN interface before you start. ## Choosing a method | Method | When | Updating afterwards | |---|---|---| | One-line command with a licence | The usual way: a fresh server with internet and a licence code | `berth update` | | deb package | Debian or Ubuntu, if you prefer an apt repository | `apt-get update && apt-get install berth` | | rpm package | AlmaLinux or Rocky Linux 10 | install the newer package with `dnf` | | Release directory | You have the directory with the Berth binaries | `berth update --from …` | | Offline bundle | Isolated networks without internet | a newer signed bundle | All methods need root (or `sudo`), and you should be logged in through the VPN. ## Installing with the one-line command 1. Log in to the server through the VPN. 2. Copy the installation command from your licence email or the licence download page, which has your licence code filled in and a copy button, and paste it into the shell. 3. Wait until the installation finishes. The last lines show a **setup code**: write it down, you need it for the [first sign-in](#claiming-the-panel-with-the-setup-code). The command downloads the installer and its signature, checks the signature against the Berth release key that is written into the command itself, and only then runs the installer. The installer in turn fetches the release manifest for your architecture, verifies its Ed25519 signature, checks the size and SHA-256 of the program archive against the manifest, records your licence and runs `berth install`. If any signature or checksum does not match, it stops and nothing on the server changes. Options go after `--code "$code"` on the last line of the command: | Option | Meaning | |---|---| | `--code CODE` | Your licence code (already filled in). | | `--email ADDRESS` | Only for a licence that is tied to an email address. | | `--hostname NAME` | Fully qualified name of the server. Default: the output of `hostname -f`. | | `--php LIST` | PHP versions, for example `8.3,8.2`. Default `8.3`. | | `--no-mail` | Without a mail server. | Without a licence you can still install from a package or a release directory; the server then runs as a 30-day trial with every feature. See [Licence and trial](https://www.berthpanel.app/library/licence-and-trial/). ## Installing from a deb package (Debian, Ubuntu) Berth is also available as a deb package in a signed apt repository. The repository address is supplied separately, together with its public key. 1. Put the repository's public key in `/usr/share/keyrings/berth.asc`. 2. Add the repository in `/etc/apt/sources.list.d/` with `signed-by=/usr/share/keyrings/berth.asc`. 3. Install the package and set up the server (the package does not do the setup itself on first install): ```bash apt-get update apt-get install berth berth install --hostname server.example.nl --php 8.3 ``` 4. Record the licence: `berth license activate --code `. Later package upgrades reconfigure the server by themselves, with the choices of the first installation. ## Installing from an rpm package (AlmaLinux, Rocky Linux) There is an rpm package for x86_64 and aarch64 with the same content: ```bash dnf install ./berth--1..rpm berth install --hostname server.example.nl --php 8.3 berth license activate --code ``` Installing a newer package on a server that already runs Berth reconfigures it straight away with the previous choices. ## Installing from a release directory If you have the directory with the Berth programs (`berth`, `berthd`, `berth-agent`, `berth-probe`), copy it to the server and start the installation from there: ```bash sudo /root/berth/berth install --hostname server.example.nl --php 8.3,8.2 ``` `berth install` places the programs and creates the systemd services `berth-agent` and `berthd`. ## Installing without internet For isolated networks, build one file with everything the installation needs on a server **with** internet that runs the same OS version and architecture as the target: ```bash sudo berth offline-bundle create --out berth-offline.tar --php 8.3,8.2 berth offline-bundle verify berth-offline.tar ``` The bundle contains the packages of the whole web stack with their dependencies (including BIND, Node.js and Python), the Berth programs, wp-cli, the ClamAV virus definitions of that server, the latest WordPress (`--apps` adds Joomla, Drupal, Nextcloud or Matomo) and a manifest with the SHA-256 of every file. Install ClamAV and let it fetch definitions on the connected server first, or the mail virus scan and realtime malware scan cannot start offline. On the target server: ```bash tar xf berth-offline.tar sudo ./berth-offline/bin/berth install --offline berth-offline.tar --php 8.3,8.2 ``` The installer checks the OS, the architecture and every file against the manifest, and uses the bundle as its only package source, also for later `--reconfigure` runs. A bundle signed with the Berth release key is verified against the key pinned in Berth. A bundle without that signature installs only with `--offline-unsigned`, and then nothing in it is checked for origin. Updating from a bundle (`berth update --offline`) always requires a signed one. > [!NOTE] > Without internet, Let's Encrypt, virus definition updates, OS package vulnerability scanning and the WordPress vulnerability feed do not work. Use an internal certificate authority or upload certificates; see [Certificates](https://www.berthpanel.app/library/certificates/). ## Choosing what to install `berth install` installs the full hosting stack by default. The most useful options: | Option | Meaning | |---|---| | `--hostname NAME` | Server name for mail and the server certificate. | | `--php 8.3,8.2` | PHP versions to install, from 5.6 to 8.5. Default `8.3`. | | `--profile hosting` or `apps` | `hosting` (default) installs everything. `apps` is a server for applications only: agent, panel, MariaDB, apps, containers, monitoring, updates and vulnerability management, without Apache, PHP-FPM, mail, FTP, webmail, WAF and Adminer. | | `--with` / `--without` | Add or leave out parts by name: `adminer`, `auditd`, `fail2ban`, `ftp`, `mail`, `mail-antivirus`, `malware`, `malware-realtime`, `resolver`, `spam`, `waf`, `web`, `webmail`, `wordpress`. | | `--no-mail`, `--no-spam`, `--no-webmail`, `--no-waf`, `--no-ftp`, `--no-malware`, `--no-adminer`, `--no-wordpress`, `--no-fail2ban`, `--no-auditd`, `--no-resolver`, `--no-web` | Leave a part out. Without the local resolver there is no DANE for outbound mail. | | `--mail-antivirus` | Scan incoming mail with ClamAV. On by default on a new installation when `clamd` already runs for the upload or realtime scan. | | `--malware-realtime`, `--upload-scan` | Realtime malware scan of webspaces and scanning of uploads through the WAF. On by default with enough memory; afterwards the choice under *Security → Malware* applies. | | `--firewall` | Switch on the panel firewall on an existing server that has no firewall choice yet. A new installation always switches it on. | | `--admin-login`, `--admin-email`, `--admin-password-file` | Unattended: create the first administrator straight away (password from a file, or `-` for stdin). No setup code is printed then. | | `--psacln-gid`, `--psaserv-gid`, `--popuser-uid`, `--popuser-gid` | Group and user numbers, only for a migration where the numbers of the old server must be kept. See [On-disk layout](https://www.berthpanel.app/library/on-disk-layout/). | | `--reconfigure` | Run again with the choices of the previous installation; options you give now take precedence. | A profile is only a starting point: parts can be added later with `--with` or under *System → Software*, without reinstalling. To add a PHP version later without losing the other choices: ```bash berth install --reconfigure --php 8.3,8.2,7.4 ``` Unattended installation, for example from cloud-init or Ansible: ```bash printf '%s\n' "$PASSWORD" | berth install --hostname server.example.nl \ --admin-login beheer --admin-email beheer@example.nl --admin-password-file - ``` ## Giving the panel its own name The panel needs its own name with a valid certificate: for password reset by mail, for passkeys (which require https) and for ACME delegation. Point an A record (and AAAA) for the name at the server, wait until it resolves, then: ```bash berth panel hostname set panel.example.nl --tls --email admin@example.nl ``` The panel is now at `https://panel.example.nl/`. You can also do this later under *Settings → Panel*, card *Panel address*. Webmail and Adminer never run on the panel's own address; see [First steps](https://www.berthpanel.app/library/first-steps/#webmail-and-adminer-names). Mail clients and FTP use the certificate of the server host name, which is self-signed until you request a real one: ```bash berth tls issue --domain server.example.nl --email admin@example.nl ``` ## Claiming the panel with the setup code As long as there is no administrator, the installation ends with a twelve-character **setup code**. Only someone with that code can claim the panel. 1. Open the panel in a browser. Every page leads to *Welcome to Berth*. 2. Enter the **Setup code**. 3. Choose your own **User name**, **Email address** and **Password** (at least 12 characters; a sentence works well). Easily guessed names such as `root`, `admin` and `superadmin` are refused. 4. Optionally fill in where server notifications go and a contact address for Let's Encrypt. 5. Click **Set up panel**. You are now signed in as administrator. Lost the code? Create a new one on the server with `berth admin setup-code`; this works only while there is no administrator. Prefer the command line? Create the administrator directly: ```bash printf '%s\n' "$PASSWORD" | berth admin create --login beheer --email beheer@example.nl ``` The same welcome page also offers **Restore from an external backup** for a replacement server after a disaster; see [Disaster recovery](https://www.berthpanel.app/library/disaster-recovery/). ## Checking the installation ```bash berth doctor ``` `berth doctor` checks the OS, accounts, directories, services, config tests, the agent, the API, the panel database and the SSH guard on port 22, and prints OK, WARN or FAIL with what to do. The same checks run daily in the panel under *System → Diagnosis*. See [Services and diagnostics](https://www.berthpanel.app/library/services-and-diagnostics/). ## Troubleshooting | Problem | What to do | |---|---| | The OS is refused | Only the versions in the [requirements](https://www.berthpanel.app/library/system-requirements/#operating-systems) are supported. Use a clean installation of one of them. | | The installer refuses because there is no VPN interface | Set up Tailscale or WireGuard first and connect through it. | | `/etc/resolv.conf` is managed by systemd-resolved or Tailscale | The installer leaves it alone and says what to do. With Tailscale: `tailscale set --accept-dns=false`, then run the same `berth install` again. Without the local resolver, DANE for outbound mail does not work and the spam filter's DNS blocklists refuse public resolvers. | | The panel certificate fails | The name must already point at the server and port 80 must be reachable. The panel stays on http in the meantime. | | Something else fails | Run the same `berth install` again (it is safe; after a successful install `berth install --reconfigure` also works), then `berth doctor`. | ## Removing Berth `berth uninstall` shows what would be removed; `berth uninstall --yes` removes the panel's daemons, timers, firewall, include files, rendered configuration and programs, so websites and mail are no longer served. Customer data always stays: webspaces, Maildirs, customer databases and backups; as long as the panel database is kept, installing Berth again puts every subscription back. Only `--purge` also removes the panel database and `/etc/berth`, including certificates and DKIM keys. ## Next step Continue with [First steps](https://www.berthpanel.app/library/first-steps/). --- # First steps after installing > Turn a fresh installation into a server ready for customers: the setup checklist, the panel's address and name, your own sign-in, notifications, backups, maintenance windows, the first package, customer and domain, and a final diagnosis. Source: https://www.berthpanel.app/library/first-steps/ · Category: start · Updated: 2026-10-30 You have installed Berth and claimed the panel with the setup code (see [Installing Berth](https://www.berthpanel.app/library/install/)). This page walks through what to set up next, in a sensible order, so the server is ready for real customers. Each step links to the article that covers it in depth. ## 1. Look around After signing in you land on *Overview*. The sidebar has the hosting pages at the top (*Domains*, *Software*, *Databases*, *Applications*, *Performance*, *Uptime*, *Backups* and more) and the administrator block **Admin** below: *Admin overview*, *Customers*, *Audit log*, *Backups*, *System*, *Fleet*, *Security* and *Settings*. Resellers, Packages, Migration, PHP and the mail queue are on *Admin overview*; Access, Branding and Integrations are tabs under *Settings*. The search field in the menu finds domains, mailboxes, aliases, databases, subscriptions, customers and logins, and the search on the *Settings* page finds the setting you are looking for. At the top right of every page are three buttons: background tasks, pending actions and notifications. **Pending** collects everything someone needs to do: a reboot after a kernel update, a failed diagnosis, approvals waiting for you, a licence to sort out. The same overview is on the command line: ```bash berth status ``` ## 2. Work through the setup checklist *Settings → Panel* starts with a **Setup** ring: the points a production server needs, each with a link to where you fix it. - **Own address with https**. - **Send mail** (sending mail works). - **Notifications to a recipient**. - **Watchdog**, which restarts services that stop. - **Monitoring from outside**, through a secret health page or an outbound heartbeat. - **Terminal with fresh confirmation** (the browser terminal opens only after a fresh confirmation, for every terminal on the server). - **Vulnerability reporting** (a security contact for `security.txt`). - Webmail and Adminer on their own names, when one of them still waits for DNS or a certificate. ## 3. The panel's address If you did not do it during installation, give the panel its own name with a certificate under *Settings → Panel*, card *Panel address*, or: ```bash berth panel hostname set panel.example.nl --tls --email admin@example.nl ``` After saving, sign in again at the new address. ### Webmail and Adminer names Webmail (Roundcube) and Adminer never run on the panel's own address, so a flaw in either cannot act with your panel session. By default they get `webmail.panel.example.nl` and `adminer.panel.example.nl`. Add A (and AAAA) records for both names; the panel requests their certificates by itself once the names point at the server, and until then shows the DNS records it needs on *Settings → Panel* and in the pending items. Customers use `webmail.`. ```bash berth panel webmail-host webmail.panel.example.nl berth panel adminer-host adminer.panel.example.nl ``` ## 4. The panel's name and branding *Settings → Branding* sets the name customers see, the logo for light and dark mode, the main and accent colour, a favicon and the helpdesk email and URL. The brand appears in the panel, the login page, status pages, monthly reports, notification mails and webmail. ```bash berth brand --name "Example Hosting" --color '#0a5f8c' \ --logo logo.png --logo-dark logo-dark.png \ --support-email support@example.nl --support-url https://example.nl/help ``` Resellers can have their own brand and their own panel address; see [Resellers and white label](https://www.berthpanel.app/library/resellers-and-white-label/). ## 5. Secure your own sign-in - **Two-step verification** is optional and recommended: with only a leaked password nobody gets in. Under *Account*, choose **Set up authenticator app** and store the recovery codes, or **Add passkey**. With two or more passkeys you can sign in with a passkey alone. See [Sign-in security](https://www.berthpanel.app/library/sign-in-security/). - **A second administrator** means you are not the only way in. Create one under *Access → Admins and auditors*. - **An emergency account** for when normal access fails (for example when single sign-on is down): `berth admin break-glass --login nood`. Store the password, shown once, on paper in a safe. With two administrators you can switch on **four-eyes approval** for destructive and security-sensitive actions. See [Roles and permissions](https://www.berthpanel.app/library/roles-and-permissions/). ## 6. Notifications - *Settings → Notifications*: where administrator notifications go, thresholds and office hours. Send a test notification. - *Account → My notifications* → **Link a channel**: Slack, Microsoft Teams, Discord, ntfy, Matrix, Telegram, a signed webhook, SMS and more. See [Notifications and alerts](https://www.berthpanel.app/library/notifications-and-alerts/). ## 7. Check the firewall A new installation switches on the panel firewall with the ports of the installed services. Look at *Security → Firewall* to see what is open. Changes are applied with **Apply** and must be confirmed with **Confirm**; without confirmation the previous rules come back by themselves. See [Firewall and bans](https://www.berthpanel.app/library/firewall-and-bans/). ## 8. Backups off the server Local archives and the hourly history start automatically, but a backup on the same disk does not survive the loss of the server. Set up an external place: 1. *Backups → Places* → **With one key** for S3 at Scaleway, Backblaze B2, AWS, Wasabi or Hetzner, with versioning and Object Lock, or **NAS** for a Synology, Ugreen or TrueNAS in append-only mode. 2. *Backups → Schedules*: apply a preset, *Mostly external*, *Balanced* or *Mostly local*, and check the disk estimate. 3. Store the repository password shown once **outside the server**. Without it, the external backup cannot be read in a [disaster recovery](https://www.berthpanel.app/library/disaster-recovery/). ```bash berth backup preset list berth backup preset apply evenwichtig --dry-run ``` See [Backup to S3](https://www.berthpanel.app/library/backup-to-s3/) and [Backup to a NAS](https://www.berthpanel.app/library/backup-to-nas/). ## 9. Maintenance windows OS updates and reboots that wait for a window happen only inside one. Set windows under *System → Maintenance*, card *Maintenance windows*, in the form days, start time and length in minutes: ```bash berth maintenance windows --window "di,do 02:00 120" --reboot ``` Day names can be written in the panel's language, for example `tue,thu` or `di,do`. See [OS updates and maintenance](https://www.berthpanel.app/library/os-updates-and-maintenance/). ## 10. Licence If you installed without a licence code, the server runs as a 30-day trial with everything on. Record your licence under *System*, card *Licence*, or with `berth license activate`. See [Licence and trial](https://www.berthpanel.app/library/licence-and-trial/). ## 11. The first package, customer and domain 1. **Package**: *Packages* → **New package**. A package is the template for subscriptions: limits for domains, mailboxes and databases, disk, PHP version, isolation limits, shell, apps and containers. ```bash berth plan set --name basis --php 8.3 --disk-mb 10240 --max-domains 5 --max-mailboxes 20 ``` 2. **Customer**: *Customers* → **Add customer**. ```bash printf '%s\n' "$PW" | berth customer add --login acme --name "Acme" \ --email info@acme.nl --password-stdin ``` 3. **Domain**: *Domains → Add*. Choose the customer and the package (which creates a subscription) or an existing subscription, the document root and whether to request a certificate straight away. ```bash berth customer create --domain acme.nl --plan basis --customer acme --tls --email info@acme.nl ``` Then switch on mail for the domain and add a mailbox ([Mailboxes](https://www.berthpanel.app/library/mailboxes/)), point DNS ([DNS](https://www.berthpanel.app/library/dns/)) and install an application ([Software installer](https://www.berthpanel.app/library/software-installer/)). Packages, subscriptions and overrides are explained in [Customers and packages](https://www.berthpanel.app/library/customers-and-packages/) and [Domains and subscriptions](https://www.berthpanel.app/library/domains-and-subscriptions/). Coming from another panel? Instead of creating customers by hand, take the whole server over; see [Migration overview](https://www.berthpanel.app/library/migration-overview/). ## 12. Run the diagnosis *System → Diagnosis* shows every check with OK, WARN or FAIL. A finding that Berth can repair has an **Fix…** button, which leads to **Start repair**. The same checks run daily and after every update. ```bash berth doctor berth doctor --json ``` `berth doctor` exits with code 1 on any FAIL, so you can use it in your own monitoring. See [Services and diagnostics](https://www.berthpanel.app/library/services-and-diagnostics/). --- # Licence and trial > One licence per server unlocks every feature; a new server runs as a full 30-day trial, and without a valid licence Berth stops only new additions and updates, never existing sites, mail or databases. Source: https://www.berthpanel.app/library/licence-and-trial/ · Category: start · Updated: 2026-10-29 Berth is licensed per server. A licence unlocks everything, there is no feature gating, and a server without a valid licence keeps hosting what it already hosts. This page explains the trial, how to record a licence, what each licence state means and what happens when you move to a new server. ## One licence per server, no editions There are no editions or feature tiers. One licence per server unlocks every part of Berth, including [Fleet](https://www.berthpanel.app/library/fleet/), resellers, white label, the API and the AI features. Prices are announced at launch. Licences are issued through InnoKEYS, the licensing service behind Berth. The licence code is what you need; the installation command in your licence email already contains it. ## The 30-day trial A new installation without a licence runs as a **trial for 30 days, with every feature on**. The licence card shows how many days are left. You can install, migrate and test exactly as with a licence; recording a licence later changes nothing on the server except lifting the time limit. ## Recording a licence In the panel: 1. Go to *System*. The *Licence* card shows the state, the masked code, the validity, the last check and whether a newer Berth release is available. 2. Enter the **Licence code**, and the email address only if your licence is tied to one. 3. Click **Save licence**. The panel checks the code immediately. On the server: ```bash berth license activate --code [--email
] berth license activate --code-file - # read the code from stdin, so it stays out of the process list berth license status # state as of the last check berth license check # check now, and look for a newer release ``` With the one-line installation command, the licence is recorded during installation and you do not need to do this. The licence card also has a **Buy licence** button. ## How checking works The panel checks the licence when it starts and regularly after that. The licence service signs its answer, and Berth verifies that signature against a key pinned in Berth itself, so a forged answer is rejected. If the licence service is temporarily unreachable, the panel keeps working on the last valid answer for a grace period. When something needs attention, administrators see it under *Pending* and receive a notification. ## What each state means | State on the licence card | What works | |---|---| | **Trial**: no licence, within 30 days of installation | Everything. | | **Valid** | Everything. | | **Grace**: the licence service cannot be reached for a while, or the licence has expired but is within its grace period | Everything. After expiry, new Berth releases are not installed until the licence is renewed; rolling back to the previous version is always allowed. | | **None** after the trial, or **Not valid** | No new customers, subscriptions, domains, resellers or imports, and no Berth updates. Everything that exists keeps working and stays manageable. | ## Berth never takes anything offline Whatever the licence state, existing websites, mail, databases, DNS and backups keep running, and you can still manage them: change settings, add mailboxes and databases to existing subscriptions, restore data, apply OS updates. A licence problem only blocks *growth* (new customers, subscriptions, domains, resellers, imports) and updates of Berth itself. Recording a valid licence lifts the restriction immediately. ## Removing a licence The licence card has **Remove licence** in its danger zone, and the command line has `berth license remove`. The panel keeps working, but `berth update` can no longer fetch releases, and once the trial period is over the restrictions above apply. ## Moving to a new server A licence belongs to a server. When you replace a server, for example after a [disaster recovery](https://www.berthpanel.app/library/disaster-recovery/), check the licence card on the new server (`berth license status`) and confirm the licence again with `berth license activate --code ` if needed. A recovery drill server (restored with `--drill`) never activates or reports the licence and installs no updates, so a drill can never take over the real server's licence. ## Updates and the licence A licence is also what lets `berth update` download new releases. Every release is signed with the Berth release key and checked before anything is installed, independent of the licence. See [Updating Berth](https://www.berthpanel.app/library/updating-berth/). --- # Updating Berth > Update Berth from the panel or with berth update; every release is signature-checked first, falls back automatically when it is unhealthy, can be rolled back, and patch releases can install themselves in the maintenance window. Source: https://www.berthpanel.app/library/updating-berth/ · Category: start · Updated: 2026-10-30 Berth updates itself as one signed unit: the panel, the agent, the CLI and the rendered configuration of every site move to the new release together. This page covers checking which version runs, updating by hand or automatically, what happens during an update, and how to go back. This article is about Berth itself. OS packages, PHP versions and kernels are updated separately; see [OS updates and maintenance](https://www.berthpanel.app/library/os-updates-and-maintenance/). ## Which version is running? - In the panel: under *System → Updates → Berth*, which also shows whether a newer release is available, what is new in it, and whether it is a patch, a new version or a security update. The version is also on the *System* overview. - On the server: `berth version`. ## Before you update 1. Pick a quiet moment, preferably inside a [maintenance window](https://www.berthpanel.app/library/os-updates-and-maintenance/). 2. Check that the last backups and the external copy succeeded under *Backups*. If the server is a virtual machine, a snapshot is a cheap extra safety net; the update policy can have Berth take one before every update it runs (see [Disks and snapshots](https://www.berthpanel.app/library/disks-and-snapshots/)). 3. Check the server: `berth doctor`. ## Updating | Installed with | Update with | |---|---| | The one-line command with a licence | `berth update`, or *System → Updates → Berth* | | deb package (Debian, Ubuntu) | `apt-get update && apt-get install berth` | | rpm package (AlmaLinux, Rocky Linux) | the newer package with `dnf` | | Your own source of signed releases | `berth update --from ` | | Offline bundle | `berth update --offline ` | In the panel, *System → Updates → Berth* has a **Update** button that runs the update as a system job with a live log. On the command line: ```bash berth update --check # fetch and verify only, install nothing berth update # update to the newest release ``` On a deb installation `berth update` refuses and points you to apt; the package reconfigures the server itself after installing. ### Your own release source With signed releases in a directory or on an https server of your own: ```bash berth update --from https://releases.example.nl/linux-{arch} ``` `{arch}` becomes `amd64` or `arm64`. Plain http is refused unless you pass `--insecure-http`, and never for automatic updates. ### Without internet `berth update --offline berth-offline.tar` installs from an offline bundle. The bundle is staged next to the current one and fully checked before anything changes: every file against the manifest, the Ed25519 signature against the pinned release key, and the OS and architecture. A bundle without a valid signature is refused. See [Installing Berth](https://www.berthpanel.app/library/install/#installing-without-internet). ## What an update checks first Before anything is installed, `berth update` downloads `SHA256SUMS` and its signature, verifies the **Ed25519 signature** against the release key pinned on the server, and then checks every file against the SHA-256 sums. If anything does not match, nothing changes. Two more rules protect against being pushed back to an old, vulnerable release: - Only a **newer** version is installed. `--force` reinstalls the same version, for example when integrity checking reports that a panel binary changed. - After every successful update, that version becomes the **lowest allowed version**. Installing anything below it requires an explicit `--allow-downgrade`. ## What happens during an update 1. The current programs are kept aside. 2. The new programs are put in place and `berth-agent` and `berthd` restart. 3. The panel database is migrated. Before each schema migration the panel database is dumped, so there is always a copy from just before the change. 4. `berth install --reconfigure` runs with the choices of the original installation, and every domain and the panel's own virtual host are rendered again, so new protections apply everywhere at once. Each file goes through the usual validation; see [How changes go live](https://www.berthpanel.app/library/how-changes-go-live/). 5. File integrity is checked against the checksums of the signed release. The panel is briefly unavailable while it restarts. Websites, mail and databases keep running. ## Automatic fallback Every update has a way back: - **After 90 seconds:** if the agent or the panel is not healthy, the previous version is put back immediately and you are notified. - **For 24 hours afterwards:** if the panel keeps crashing, the watchdog restores the previous version and skips the failed one until a newer release appears. A version that was rolled back this way is listed on the update page as *Skipped after problems*. ## Rolling back by hand To go back to the version from before the last update: - In the panel: *System → Updates → Berth*, danger zone **Restore previous version**. Type `terug` to confirm. - On the server: `berth update --rollback`. The version you rolled back from is then excluded from automatic updates until there is a newer one. Rolling back is always allowed, whatever the licence state. Database migrations only add, so the previous version can work with the migrated database. ## Automatic updates The update policy under *System → Updates → Policy* has a setting for Berth itself: | Setting | Behaviour | |---|---| | `auto` | Patch releases (for example 1.4.2 to 1.4.7) install themselves in the next maintenance window. A new minor or major version is announced, and you install it yourself. | | `notify` | Every new release is announced; you install it yourself. | | `off` | Berth is not updated automatically. | A patch that fixes security vulnerabilities does not wait for the window. ```bash berth system update-policy --panel auto berth system update-policy --panel notify --snapshot on ``` If you manage several servers, [Fleet](https://www.berthpanel.app/library/fleet/) can roll a Berth update out in rings with a health gate. ## After updating 1. `berth doctor`. 2. Check *System → Updates → Berth* for the new version and the result of the last update. 3. Optionally look at *Security → Integrity*, where the panel's binaries are compared with the checksums of the signed release. ## If an update stopped halfway Run the update again (`berth update --force`) or `berth install --reconfigure`. Both are safe: what is in place stays, and what is missing is repaired. If a service misbehaves afterwards, see [Services and diagnostics](https://www.berthpanel.app/library/services-and-diagnostics/). If the panel itself does not come up, the [rescue mode](https://www.berthpanel.app/library/rescue-mode/) works without the panel database. --- # Architecture > How Berth is built: an unprivileged panel daemon, a small root agent that accepts only typed and individually authorised operations, a subprocess per operation, modules with their own tables, a MariaDB panel database, an event bus, jobs and an OS adapter. Source: https://www.berthpanel.app/library/architecture/ · Category: concepts · Updated: 2026-10-29 Berth is split along one line: the part that talks to the internet never has root, and the part that has root never talks to the internet. This article describes the four programs, the protocol between the panel and the root agent, how each operation is authorised and executed, and the building blocks inside the panel: modules, the panel database, the event bus, jobs and the OS adapter. It is meant for administrators, auditors and developers who want to know what runs where and why. ## The four programs | Program | Runs as | Role | |---|---|---| | `berthd` | the unprivileged user `berth` | The panel: web UI, REST API with OpenAPI, the MCP endpoint for AI assistants, the modules and the panel database. Listens only on loopback, behind nginx. | | `berth-agent` | root | Carries out everything that needs root, on request, over a local unix socket. Accepts only a closed set of typed operations. | | `berth` | the administrator, usually root | The command line. Talks to the agent like the panel does, or runs in-process as root with `--local` when the agent itself is not running. | | `berth-probe` | anyone, anywhere | Measures domains from outside: HTTP, HTTPS, TLS, DNS, MX and STARTTLS, optionally IMAP, POP3, submission and FTP, and a few pages per site. Writes one JSON line per domain, compares two runs and builds a parity report. Used for [migration parity checks](https://www.berthpanel.app/library/parity-checks/). | ```text browser / API client / AI connector │ https ▼ nginx ──────────────► websites (Apache, PHP-FPM, apps, containers) │ loopback ▼ berthd (user berth) ── MariaDB: panel database "berth" │ unix socket: typed requests, one response each ▼ berth-agent (root) ── one worker subprocess per operation │ ▼ /etc/berth/rendered, systemd units, users, quotas, nftables, ... ``` ## berthd: the unprivileged panel `berthd` runs as the system user `berth` under a systemd sandbox: `NoNewPrivileges`, `ProtectSystem=strict`, `ProtectHome`, `PrivateTmp`, `PrivateDevices`, protected kernel tunables, modules and control groups, `RestrictSUIDSGID`, and memory and task limits so a leak cannot take the server with it. It is not a member of the customer groups. It cannot read webspaces, Maildirs or customer databases directly; it reaches them only by asking the agent. Every API and UI request runs with panic recovery: a bug in one handler returns an error for that request, not a dead panel. The same applies to every background job. ## berth-agent: a small root service with a closed vocabulary The agent listens only on a local unix socket, never on the network. The wire format is deliberately plain: newline-delimited JSON, one request, one response. Each request names an **operation** and carries its parameters. There are a little over 300 operations, and each one is a Go type with its own `Validate()` method: enums for choices, bounds for numbers, strict patterns for domain names, user names and paths. The agent does not trust anything the panel sends; it validates every field again before acting. **There is no generic "run this command" or "write this file anywhere" operation.** Where the panel needs something new from root, a new typed operation has to be written for it. Derived data comes from the agent's own lookups, not from the request. For example, when the panel asks for a PHP-FPM pool or a web server virtual host, the agent renders the file itself from a typed specification and looks up the subscription's uid, sockets and certificate paths on its own, binding them to the subscription the request names. ### Who is asking: peer credentials The agent identifies the caller through the kernel, with `SO_PEERCRED` on the socket, not from anything in the request. If the kernel cannot tell, the request is denied. A request may carry an *actor* (which panel user asked for it), but the agent treats that as information for its audit trail only, never as authorisation. - **Root** (the `berth` CLI run by an administrator, the installer, timers) may use every operation. - **Any other caller**, in practice `berthd`, goes through an explicit policy. ### Per-operation policy Every operation has exactly one rule for non-root callers: - **allowed**, with a written reason for why that is safe (what `Validate()` and the handler already limit); - **root only**, for things the panel must never do itself, such as changing the hoster's server policy; - **checked**, guarded by a named check, for example that a file operation stays inside the webspace of the subscription it names, that a service unit is not on the protected list, or that a quota value fits. An operation without a rule is denied to the panel. A test in the build fails when someone adds an operation without deciding its rule, and also when a rule names a check that does not exist. The result is a simple guarantee: **even a fully compromised panel process can only do what the agent's policy allows it to do.** Each operation also has a sensitivity class: *read*, *access* (new access to data: passwords, keys, sign-in links), *export*, *destroy* or *security* (anything else that changes the server). The agent keeps its own append-only audit trail of everything above *read* and of every denied request, chained with an HMAC key the panel never has, and anchors it against the panel's activity log so a rewritten log is detected. See [Audit trail and approvals](https://www.berthpanel.app/library/audit-trail-and-approvals/). ### One subprocess per operation The agent does not run operations in its own process. For each request it starts itself again as a worker subprocess, passes the request on stdin and reads the response from stdout. The worker validates the request exactly as the agent does. A handler that crashes, hangs or eats memory affects only that one process; the agent enforces a timeout and an output limit and kills the whole process group when either is exceeded. Concurrency is capped per subscription, per customer and per reseller, with a reserve that is always kept free for system work. One busy customer cannot occupy the agent for everyone else. Background work (backups, the hourly history, scans, statistics, migration syncs, image conversion) runs in a background slice at the lowest CPU and IO priority, so the panel, PHP and MariaDB come first whenever they need the CPU or the disk. Where the disk scheduler supports weights, Berth switches it to BFQ so the IO priority actually takes effect. ## Modules The panel is built from modules: customers, auth, databases, mail, web, TLS, cron, FTP, SSH access, backups, malware, uptime, statistics, log drains, incidents, the audit watchdog, migration, parity, containers, software, mailing lists, notices, alerts, system apps, vulnerabilities, AI, Fleet and more. `berth modules` lists them in start order. - The core interface is small: a name, a description and dependencies. Optional abilities, such as database migrations, are separate interfaces that a module implements if it needs them. - Each module owns its tables, with a prefix, and its own migrations. - Modules start in dependency order. A module reports its health as *Healthy*, *Degraded* (the rest of the panel keeps running), *Disabled* or *Migrating*, during which the panel answers with a temporary error rather than half-migrated data. ## The panel database The panel database is the MariaDB schema `berth`, reached over a unix socket with socket authentication, so there is no database password to steal. It holds the **desired state**: customers, subscriptions, domains, mailboxes, schedules, settings. Before each schema migration it is dumped, and the last few dumps are kept. The agent does not need the database. Services run from the files rendered into `/etc/berth/rendered/`, so a stopped panel or database does not stop websites or mail. The [rescue mode](https://www.berthpanel.app/library/rescue-mode/) also works without the database. How desired state becomes configuration is described in [How changes go live](https://www.berthpanel.app/library/how-changes-go-live/). ## Event bus Modules publish events such as `domain.created` or `cert.renewed` on an in-process bus, and other modules subscribe with patterns (`domain.*`). Delivery is synchronous and isolated per handler: a handler that fails or panics does not affect the others. Every event carries the correlation id of the request or job that caused it, so logs can be followed end to end. Audit events are also what [webhooks and extensions](https://www.berthpanel.app/library/webhooks-and-extensions/) receive. ## Jobs and background tasks - **System jobs**: long root work, such as an OS upgrade or enabling disk quotas, runs in its own transient systemd unit with a live log, so it survives a panel restart. `berth job` lists and follows them. - **Background tasks**: long panel work, such as a restore test or an installation, shows a bar at the top of the page with progress and details, and a safe stop where stopping cannot leave things half done. `berth task list`, `berth task show`, `berth task stop`. ## OS adapter All distribution differences live in one place, the OS adapter, with implementations for Debian, Ubuntu (24.04 has its own variant) and the EL family (AlmaLinux, Rocky Linux). The adapter knows package names, service names (`apache2` or `httpd`), paths, the PHP repository (Sury or Remi), the web server user, config test commands, SELinux labels and AppArmor rules. The rest of Berth asks the adapter instead of hard-coding paths, which is also what makes [disaster recovery onto a different OS](https://www.berthpanel.app/library/disaster-recovery/) possible. ## Open-source components and licensing Berth uses the standard Linux hosting stack: nginx, Apache, PHP-FPM, Postfix, Dovecot, OpenDKIM, rspamd, ClamAV, ModSecurity and Coraza with the OWASP Core Rule Set, nftables, fail2ban, MariaDB, PostgreSQL, BIND, unbound, ProFTPD, OpenSSH, Roundcube, Adminer, restic, Valkey and Podman. Libraries compiled into the Berth binaries are MIT, BSD, Apache or MPL licensed only; the build fails if a GPL or AGPL library slips in. GPL tools such as Postfix or ClamAV run as separate programs, as they would without Berth. ## Extensions run outside the panel Extensions are separate processes supervised by the panel, each with its own scoped key and its own sandboxed systemd service, not plugins loaded into `berthd`. A failing extension cannot crash the panel, and it sees only what its key and the administrator's consent allow. See [Webhooks and extensions](https://www.berthpanel.app/library/webhooks-and-extensions/). ## Further reading - [How changes go live](https://www.berthpanel.app/library/how-changes-go-live/): render, stage, test, swap, reload. - [Isolation](https://www.berthpanel.app/library/isolation/): what separates one subscription from another. - [Security model](https://www.berthpanel.app/library/security-model/): the threat model and the defences together. - [On-disk layout](https://www.berthpanel.app/library/on-disk-layout/): where everything lives on the server. --- # How changes go live > Every configuration change is rendered from the panel database, staged, checked with the service's own config test, swapped in atomically and reloaded, with automatic rollback, quarantine of one customer's broken file and a change log with diffs. Source: https://www.berthpanel.app/library/how-changes-go-live/ · Category: concepts · Updated: 2026-10-30 When you change a PHP version, add an alias or switch on mail for a domain, Berth does not edit configuration files in place. It writes complete files from the desired state in the panel database, tests them with the service's own checker, and only then makes them live. A change that does not pass is rolled back before any service sees it. This article explains that pipeline, what happens when one customer's file breaks, and where you can see every change afterwards. ## Desired state, not patches The panel database holds what the server *should* look like: domains, aliases, certificates, PHP settings, mailboxes, DNS records. Configuration files are always **rendered in full** from that state, through templates that have golden-file tests. Berth does not patch lines in the files it owns, so there is no drift between "what the panel thinks" and "what is on disk" that builds up over time. If someone does edit a rendered file by hand, the next apply or `berth repair --areas config` simply writes the correct version again. The one exception is Postfix, which has no include mechanism: a hoster's own additions set parameters from a fixed list with `postconf -e`, still tested and rolled back on failure. Rendered files live under `/etc/berth/rendered/`, one directory per service (and per PHP version for PHP-FPM). Each service's own configuration contains only a small include file that points there, so the distribution's packaged config stays intact. Your own additions go in `/etc/berth/local/`, which Berth includes but never overwrites. See [On-disk layout](https://www.berthpanel.app/library/on-disk-layout/#etc-berth-rendered). You can also edit those additions in the panel, under *System → Configuration* (`berth system local-config`): one managed addition per service (nginx, Apache, PHP-FPM per version, Postfix, Dovecot, MariaDB, sysctl, journald and logrotate). Berth refuses directives that would let a program run as root. Each change runs through the service's own test and goes back automatically unless you confirm within a few minutes that the service still runs and answers. Earlier versions can be applied again, and a hand edit on disk can be adopted as the new addition. For the web server virtual hosts and PHP-FPM pools, the agent renders the files itself from typed specifications instead of receiving finished text from the panel, and binds paths, sockets and the run-as user to the subscription the request is for. See [Architecture](https://www.berthpanel.app/library/architecture/). ## The five steps Every apply is a small transaction carried out by the root agent: 1. **Stage.** The new files are written next to the current ones under a temporary name that the service's include patterns do not read. The old content is kept for the diff. 2. **Swap.** The new files replace the old ones with an atomic rename, and the previous version of each file is kept. A reader sees either the old file or the new one, never half of each. 3. **Test.** The OS adapter runs the service's own configuration test against the full configuration: | Service | Test | |---|---| | nginx | `nginx -t` | | Apache | `apache2ctl configtest` (Debian, Ubuntu) or `httpd -t` (AlmaLinux, Rocky) | | PHP-FPM | `php-fpm -t`, separately for each subscription's own FPM | | Postfix | `postfix check` | | Dovecot | `doveconf -n`, with Sieve scripts compiled before they are put in place | | BIND | `named-checkzone`, per zone | 4. **Roll back on failure.** If the test fails, the previous files go back and the service is **not** reloaded. The change is reported as failed with the test output; nothing live has changed. 5. **Reload.** If the test passes, the service is reloaded in a safe order; PHP-FPM reloads let running requests finish. nginx is restarted instead when a change alters its shared memory zones (rate-limit or cache zones), which a reload cannot take over, and after every nginx reload Berth checks that the new configuration was really accepted, restarting nginx if it was silently refused. Only one apply runs per service at a time, including applies started by timers and by `berth repair`, so two changes can never see each other's half-swapped files. ### Batched tests for busy servers `nginx -t` reads the configuration of every site on the server, so ten customers saving at the same moment would mean ten full tests. Applies that wait for the same service are therefore collected: whoever gets the lock stages and swaps all waiting changes, runs one test and one reload, and gives each its own result. If that combined test fails, everything is rolled back and each change tests itself, so one broken change still cannot block the others; it costs at most one extra test. ## One customer's mistake affects only that customer A configuration test checks the whole service, so a single invalid file can make every apply on the server fail. That happens most often with a file that *became* invalid without being changed: a certificate that was removed, a directory that no longer exists, an IP address the server can no longer bind. Berth handles that case explicitly. When a test fails, the agent rolls back and checks whether the configuration from *before* the change also fails. If it does, the problem is not the new change but a file that was already broken. The agent finds that file from the test output and sets it aside under a `.berth-quarantine` name that the includes do not read, keeping its content for inspection. Then it tests again and lets the original change through. - Only a file in the service's rendered directory can be quarantined, never a file that belongs to the change being applied. - If the test still fails after quarantining, everything goes back: Berth prefers touching nothing over touching too much. - A quarantined file raises an alert for the administrator, a warning in `berth doctor` and a notice to the customer whose domain it is. Until it is fixed, that one site or pool is left out of the configuration, while every other site keeps working and keeps accepting changes. - The quarantine is lifted automatically as soon as a valid version of that file is applied or the domain is removed. DNS works the same way per zone: a zone that fails `named-checkzone` keeps serving its previous version. ## The change log *Audit log → Changes* lists every configuration the panel writes that actually changes something: which file, who caused it, when, and whether the service's test passed. Open a change to see the full diff and the steps (stage, swap, test, reload) with their duration and the exact command, including attempts that were rolled back. You can search by domain or any text in the diff. ```bash berth admin changes --limit 50 berth admin changes --contains acme.nl ``` The broader activity log, with its tamper-evident hash chain, is described in [Audit trail and approvals](https://www.berthpanel.app/library/audit-trail-and-approvals/). ## Customising safely Several layers let you change what Berth renders without giving up validation: - **Per-domain web server directives** (*Custom web server rules*): extra nginx or Apache directives for one domain. Off by default per package; validated before activation; the agent binds paths, sockets and ports to the subscription's own webspace and refuses dangerous directives. See [Web server settings](https://www.berthpanel.app/library/web-server-settings/). - **Template fragments** for hosters: files under `/etc/berth/local/sjablonen/` that hook into named points of the nginx, Apache and PHP-FPM templates, optionally per package. `berth sjablonen check` validates them before use, and `berth domain reprovision` applies them. - **Server policy**: root-only TOML files in `beleid.d` under `/etc/berth` with hard limits that neither packages nor the panel can loosen. Unknown keys or invalid values make the agent refuse the whole file and keep the last valid policy, and `berth doctor` reports it. `berth beleid show` and `berth beleid check`; the panel shows the policy read-only at *Server policy*. ## Repairing drift If a server has been changed by hand, or a restore left something inconsistent, `berth repair` puts it back into the state the panel knows: ```bash berth repair --dry-run # show what would happen berth repair --areas config # rewrite every domain, mail and the panel from the database berth repair # config, permissions, services and the SSH guard ``` `berth doctor` runs before and after. In the panel: *System → Diagnosis*, **Fix…** on a finding. See [Services and diagnostics](https://www.berthpanel.app/library/services-and-diagnostics/). ## Why this matters - A typo, a missing certificate or a bad directive never takes the web server or mail down for everyone. - Every change is reversible and visible, with the exact diff. - Updates of Berth itself re-render every site through the same pipeline, so new protections apply everywhere without risk; see [Updating Berth](https://www.berthpanel.app/library/updating-berth/). --- # Isolation between subscriptions > What keeps one customer from affecting another: a systemd slice with one resource budget per subscription, a PHP-FPM per subscription, PHP hardening, disk quotas, an outbound network fence, hidden processes and rootless containers in their own user namespace. Source: https://www.berthpanel.app/library/isolation/ · Category: concepts · Updated: 2026-10-30 On a shared server, the question is not whether a site will be hacked, overloaded or misconfigured, but what that does to everyone else. Berth's answer is that it should only affect the subscription it happens in. This article explains each layer of separation, from CPU and memory to disk, network, processes and containers, and where you set the limits. A **subscription** is the unit of isolation: one system user with its webspace, domains, mailboxes and databases, created from a package. A customer can have several subscriptions. See [Domains and subscriptions](https://www.berthpanel.app/library/domains-and-subscriptions/). ## A system user per subscription Every subscription has its own Linux user and runs everything as that user: PHP, Node.js and Python apps, scheduled tasks, the file manager, SFTP, the shell and containers. Files in the webspace belong to that user. Other subscriptions cannot read them: the webspace root belongs to root and is open only to the web server group, and the document root belongs to the subscription. A system user ID is handed out only once, so a new subscription never inherits files or rights that a removed one left behind. See [On-disk layout](https://www.berthpanel.app/library/on-disk-layout/). ## A systemd slice with one budget Each subscription runs in its own systemd slice, a cgroup with its own limits. Inside it: - the subscription's own **PHP-FPM**, one per PHP version it uses; - its **Node.js and Python apps** and their background workers; - its **object cache** (a Valkey instance on a unix socket); - its **browser terminal** and **SSH sessions**; - its **scheduled tasks**; - its **containers**. All of these share **one budget**. Web traffic, a cron job and an SSH session of the same subscription draw from the same CPU, memory, process and disk-IO limits, so a subscription cannot get twice its package by spreading work across services. | Limit | Meaning | |---|---| | CPU | Without a package limit, subscriptions share the CPU equally when the server is busy, and one site may use more when it is quiet, up to a ceiling of 90 % of all cores by default. A package can set a fixed cap instead, as a percentage of one core (200 means two cores). | | Memory | Hard limit, with swap capped per subscription as well; usage is measured as PSS, so shared pages are counted fairly. | | Processes | Processes and threads together. A fork bomb stops at this limit. | | Disk IO | Read/write throughput in MB/s and operations per second. | In a package, `0` means the server default and `-1` means deliberately no limit. The server default is set under *Packages → Limits per subscription*: CPU as a ceiling and memory as a share of the server, so a server that grows gives every subscription more. Changing a limit takes effect immediately; nothing restarts. ```bash berth plan set --name basis --cpu-percent 100 --memory-mb 1024 --max-processes 256 berth plan isolation-defaults --cpu-share 90 --memory-share 50 berth subscription isolation --sysuser acme ``` As memory gets close to the limit, the kernel first slows the subscription down; only at the limit does it stop a process, while the rest of the site keeps running. Because swap is capped too, one site that runs out of memory cannot push the whole server into swapping, and the database and the shared system services keep a guaranteed amount of memory. The alert engine notifies the administrator, the customer and the reseller when a subscription sits at its memory or process limit or is throttled on CPU for a sustained period. **Per-app limits** narrow this further: inside a subscription, each app can have its own CPU, memory, process and IO limit, never above the subscription's own (`berth app limits`, or *Apps → Limits* on the domain). **Background work** of the panel itself (backups, scans, statistics) runs in a separate low-priority slice, and the root agent caps how much work it does at once per subscription, per customer and per reseller. One customer's large restore cannot crowd out everyone else's panel actions. ## PHP-FPM per subscription Every subscription gets its own PHP-FPM master per PHP version, inside its slice. A PHP memory leak, a scraper hammering a slow page or a pool full of stuck requests affects only that subscription, not other sites on the same PHP version. An idle FPM costs roughly 15 to 20 MB of memory per subscription and version. On a small server with many subscriptions you can choose *Only packages with limits*, and the rest share one FPM per version. PHP is hardened by default: - `open_basedir` is the subscription's home, and `security.limit_extensions` allows only `.php`. - Process functions such as `exec`, `system` and `proc_open` are disabled. The package option *PHP may start processes* (`--php-shell`) allows them. - `mail()` is off per package by default (`--php-mail` allows it), and when allowed it goes through Berth's mail gate, which counts it against the subscription's outbound budget. See [Outbound mail](https://www.berthpanel.app/library/outbound-mail/). - `expose_php` is off, session cookies are hardened, and FPM runs with its own `/tmp` inside the subscription's webspace and a private view of `/proc`. See [PHP](https://www.berthpanel.app/library/php/). ## Disk quota The disk space of a package is enforced by the file system where possible: | File system | How | What counts | |---|---|---| | xfs with `pquota`, ext4 with the `quota` and `project` features | Project quota | Webspace, Maildirs, MariaDB databases and container storage of the subscription together | | ext4 without the `project` feature (the Debian and Ubuntu default) | Per-user quota | What the subscription's user writes in its webspace; mail, databases and containers are measured and enforced separately | | btrfs, ZFS, network file systems | Measure only | Measured hourly and reported | The package value is the soft limit; the hard limit is slightly higher, and a subscription above the soft limit has a week of grace. At the hard limit, the file system refuses new files for that subscription only, so a customer or a hijacked site cannot fill the server's disk. Packages also limit the number of files and folders (inodes): by default 100 per MB of disk space, at least 250,000, so a cache or session folder with millions of tiny files cannot exhaust the file system (`berth plan set --inodes`; `-1` means no limit). Temporary files and logs count as well. Each subscription gets its own `/tmp` and `/var/tmp` inside its webspace, for PHP, apps and the shell, and on Debian and Ubuntu for scheduled tasks too, so they count towards its quota and cannot fill the server's shared `/tmp`. PHP error and slow logs are rotated as soon as they grow large. Space that still falls outside the quota is capped: a domain's log folder that runs away is cut back with a notice, and a subscription's files in the shared temporary directories are removed above a limit (`berth quota shared` runs the same check by hand). What the file system does not cover, Berth enforces itself: - **Databases** over the hard limit are write-locked: MariaDB databases can still be read and cleaned up with `DELETE`, `DROP` and `TRUNCATE`; PostgreSQL databases become read-only. The lock lifts by itself once usage is back under the package. - **Containers** over the hard limit are stopped, and the site falls back to its normal content; they start again when space is freed. - **Mailboxes** have their own quota, enforced by Dovecot. Quota is switched on under *System → Disks → Disk quota* with a dry run first, or `berth quota enable --dry-run` and `berth quota enable`. Berth never remounts a file system itself; when a mount option is needed, it takes effect at the next reboot. See [Disks and snapshots](https://www.berthpanel.app/library/disks-and-snapshots/). ## Outbound network fence Two layers control what a subscription can reach on the network. **Always on, for every subscription:** - No subscription can reach the panel's internal services over loopback: the panel API, the rescue service, the admin terminal, or the internal mail signing and spam services. A hacked site cannot talk to the panel from the inside. - Ports of apps and containers on loopback answer only their own subscription and nginx. Another subscription is refused, and the attempt is shown to the customer. - Outbound SMTP on port 25 from sites is closed by default; mail goes through authenticated submission and the outbound budget. - New outbound connections and concurrent connections per subscription are limited, configurable per package. **Restricted mode, per package** (*Restrict outbound traffic*): sites, apps, scheduled tasks, SSH sessions and containers can reach only the web, DNS and the server's own services. Exceptions are set per subscription. The customer sees what was blocked under *Outbound traffic*. A hacked site in restricted mode cannot become a spam relay or join a botnet. ```bash berth plan set --name basis --egress-restricted berth egress allow --subscription acme --proto tcp --ports 22 --dest 198.51.100.20 berth egress show --subscription acme ``` ## Processes are hidden `/proc` is mounted with `hidepid=invisible`. A customer sees only their own processes, in `ps`, `top`, the terminal and from PHP; command lines, environments and working directories of other subscriptions are invisible. PHP-FPM, apps and the object cache get their own `/proc` view from systemd as well. ## Shell, SFTP and the browser terminal - SFTP without shell is chrooted into the subscription's home. - The shell and the browser terminal run as a transient systemd unit inside the subscription's slice, with its limits, and see only the subscription's own webspaces. - SSH keys are managed by the panel and stored outside the webspace, so a PHP script cannot plant a key. - Customers use a separate SSH port; administrative SSH on port 22 is reachable only through the VPN. See [Files, FTP and SSH](https://www.berthpanel.app/library/files-ftp-ssh/). ## Containers in a user namespace Containers run with **rootless Podman**, without a Docker daemon. Each subscription has its own user namespace, so root inside a container maps to an unprivileged range on the host that belongs to that subscription alone. Containers run inside the subscription's slice and budget, from root-owned Quadlet units the customer cannot edit. - Never privileged; no host network, PID or IPC namespace. - `no-new-privileges`, a seccomp profile, and an optional read-only root file system. - Ports are published only on loopback; nginx is the only way in. - Volumes and images count toward the subscription's disk quota. See [Containers](https://www.berthpanel.app/library/containers/). ## Databases on a shared server MariaDB and PostgreSQL are shared services, so Berth separates customers inside them: database and user names carry the subscription prefix, a database user can be granted rights only on databases of its own subscription (checked in the panel and again in the agent), connections are limited per user and per subscription, and every database user has a query-time limit so one runaway query cannot hold the server. See [Databases](https://www.berthpanel.app/library/databases/). ## Web-facing helpers run on their own Webmail and Adminer run on their own host names, never on the panel's address, and each as its own system user. The file manager in the panel runs as the subscription's user. A flaw in one of them does not reach the panel session or another customer's files. ## Where to see it - Per subscription: limits, live usage and its own PHP-FPMs on the subscription's usage page, or `berth subscription isolation --sysuser `. - Server-wide: *Statistics* for CPU, memory and IO per subscription with peaks; see [Statistics and metrics](https://www.berthpanel.app/library/statistics-and-metrics/). - The alerts: *System → Problems*. For the design of the root agent that enforces all of this, see [Architecture](https://www.berthpanel.app/library/architecture/) and [Security model](https://www.berthpanel.app/library/security-model/). --- # Roles and permissions > Who can do what in Berth: administrators, resellers, customers and auditors, restricted logins with per-area rights, an emergency account, four-eyes approval for sensitive actions and temporary just-in-time elevation. Source: https://www.berthpanel.app/library/roles-and-permissions/ · Category: concepts · Updated: 2026-10-30 Berth has a small number of roles with clear boundaries, plus a few mechanisms that limit what even an administrator can do alone. This article describes each role, the restricted logins customers give to colleagues and web developers, and the controls for sensitive actions: four-eyes approval, just-in-time elevation and the emergency account. Everything a role can do in the panel, it can also do through the [REST API](https://www.berthpanel.app/library/rest-api/); every change lands in the activity log. The `berth` command line on the server runs as root and is meant for the server's administrators. ## The roles | Role | Sees | Can | |---|---|---| | **Administrator** | Everything | Everything, including server settings. | | **Auditor** | Everything an administrator sees | Change nothing except their own account. Can request temporary administrator rights. | | **Reseller** | Their own customers | Manage their customers, subscriptions, domains and logins, within their own limits. | | **Customer** (the owner) | Their own subscriptions | Manage their domains, mail, databases, files, backups and logins, within their package. | | **Restricted login** | What the customer assigns | Only the chosen areas, optionally for one subscription. | | **Emergency account** | Everything | An administrator for when normal access fails; every sign-in is reported. | Each role has its own dashboard. In the panel, administrators and auditors are listed together under *Access → Admins and auditors*; "staff" is a grouping, not a separate role. ## Administrators Administrators manage the whole server: customers, resellers, packages, system settings, security, backups and migrations. Create one under *Access → Admins and auditors*, or on the server: ```bash printf '%s\n' "$PW" | berth admin create --login jan --email jan@example.nl ``` Without a password, the panel generates one and shows it once. You cannot disable yourself or the last administrator. An administrator can **sign in as a customer** from the customer page: a bar at the top of every page shows that you are working as that customer. Your administrator session ends when you start; the *Back to admin* button signs you out, and you sign in again as yourself. This is logged. ## Auditors An auditor sees everything an administrator sees and changes nothing, for example for an accountant, a security officer or a regulator. Read-only means *looking*, not *taking*. An auditor does not download customer content or secrets: no files from a webspace, no backup archives, no database dumps, no migration export files, no customer data exports, no customer mail (list archives, queued messages, the mail catcher) and no `.env` files. Values of environment variables and secrets in a `.env`, and addresses that contain a token (status page links, heartbeat URLs, webhooks), are shown as *(hidden)*. What an auditor does see: every list and setting, logs, the activity log, the access review, certificates and incidents (including CSV exports) and the [evidence pack](https://www.berthpanel.app/library/evidence-for-audits/). ```bash printf '%s\n' "$PW" | berth admin create --login accountant --role auditor ``` ## Resellers A reseller sells hosting on: they manage their own customers, those customers' subscriptions, domains and logins, can sign in as their customers, suspend them and move subscriptions between them. Limits apply across all their customers together: customers, subscriptions, domains, mailboxes, databases and disk space. Optionally a reseller may oversell disk, create their own packages and use their own brand and panel address. Everything at server level stays with the administrator: system settings, firewall, backup storage, PHP versions, certificate authorities, single sign-on and other resellers. See [Resellers and white label](https://www.berthpanel.app/library/resellers-and-white-label/). ## Customers and their restricted logins A customer owns one or more subscriptions and manages everything inside them within the package. A customer should never share their own password: instead they give a web developer, colleague or bookkeeper a **restricted login** with only the areas they need. The activity log then shows who did what. In the panel: *Users* → *Add login* for the customer, or the *Logins* tab on the customer page for an administrator. Choose the areas: | Area | Gives access to | |---|---| | Websites and settings (`domains`) | Domain settings, redirects, protected folders | | Files, SFTP and FTP (`files`) | File manager, SFTP, FTP, Git, apps, containers, terminal | | Databases (`databases`) | Databases | | Mail (`mail`) | Mailboxes and aliases | | WordPress (`wordpress`) | WordPress management | | Backups (`backups`) | Making and restoring backups | | Statistics and logs (`stats`) | Usage, statistics, logs, uptime | | Scheduled tasks (`cron`) | Scheduled tasks | | Security (`security`) | WAF, malware scan, outbound traffic | Optionally limit the login to one subscription. A restricted login can never manage logins, add or remove domains, or connect an AI assistant. New parts of the panel are closed to restricted logins until a permission explicitly covers them. ```bash berth customer login add --customer acme --login webbouwer --email dev@acme.nl \ --perms files,databases,wordpress --sysuser acme berth customer login set --customer acme --login webbouwer --disabled ``` ## API tokens API tokens act with the rights of the login that created them, narrowed by a scope: `full`, `ai:read`, `ai:write`, `ai:full`, `provisioning` (for billing systems), `metrics`, `probe` and `monitor:read`. A token can be limited to one subscription, expires (by default after a year) and is stored only as a hash. No token can manage tokens or two-step verification, and sensitive operations need an explicit `sensitive` scope or a fresh re-authentication. See [REST API](https://www.berthpanel.app/library/rest-api/) and [AI assistant and MCP](https://www.berthpanel.app/library/ai-assistant-and-mcp/). ## Four-eyes approval With four-eyes switched on, a sensitive action by one administrator becomes a request that a second administrator must approve. Switch it on under *Access*, card *Four-eyes for sensitive actions*, or `berth approvals four-eyes on`. It requires at least two administrators. Covered actions include: - deleting a customer, a domain with its files, or a database; - restoring a backup over the original (a whole account, parts or files), and deleting a backup; - removing an IP address from the server, and changing the firewall; - weakening sign-in security, and switching four-eyes off; - creating an administrator, or resetting another administrator's password or second factor. When a new administrator is approved, they receive a reset link on their own email address and choose their own password; the requester never sees it. So nobody can create a second administrator to approve their own requests. Another administrator approves under *Security → Approvals*, or with `berth approvals list` and `berth approvals approve`. The action then runs in the name of the requester. A request expires after 24 hours. An administrator's API or AI token that is limited to one subscription also falls under four-eyes. Root on the server and the emergency account are outside four-eyes by design: they are the way back in when the panel's own controls are the problem. Both are logged. ## Just-in-time elevation Nobody needs permanent administrator rights for occasional work. An auditor requests administrator rights for 1 to 8 hours, with a reason, under *Account*, card *Temporary administrator*. Another administrator approves the request under *Security → Approvals*. The auditor is then an administrator until the time runs out, or until they or an administrator end it: ```bash berth admin elevation-end --login accountant ``` ## The emergency account An emergency account (break-glass) is for when normal access fails, for example when the single sign-on provider is down: ```bash berth admin break-glass --login nood ``` The password is long, random and shown once: store it on paper in a safe or a sealed envelope. The emergency account does not need a second factor, so it works even when the second factor is the problem. In return, every sign-in is recorded in the activity log and notified to all administrators, a session lasts at most an hour, and API tokens do not work with it. `--off` turns it back into a normal administrator. ## Narrowing sign-in further - **Allowed addresses per login**: under *Account*, *Sign in only from*, or `berth admin allowed-ips --login --set 203.0.113.0/24`. - **Single sign-on only**: logins linked to a provider can be restricted to signing in through it. See [Single sign-on](https://www.berthpanel.app/library/single-sign-on/). - **Two-step verification and passkeys** are optional and recommended for everyone. See [Sign-in security](https://www.berthpanel.app/library/sign-in-security/). ## Reviewing access *Access*, card *All accounts*, lists every account with its role, second factor, last sign-in, sessions and API tokens, with a CSV export for periodic access reviews: ```bash berth admin access berth admin sessions list --login jan berth admin disable --login jan ``` Disabling a login ends its sessions immediately. The [audit watchdog](https://www.berthpanel.app/library/audit-trail-and-approvals/) reports unusual events such as privilege changes, impersonation, use of the emergency account and sign-ins from a new country. --- # On-disk layout > Where Berth keeps websites, logs, mail and configuration: the Plesk-compatible paths under /var/www/vhosts and /var/qmail/mailnames, the users and groups with their uids and gids, the Dovecot folder namespace, and the rendered configuration under /etc/berth. Source: https://www.berthpanel.app/library/on-disk-layout/ · Category: concepts · Updated: 2026-10-30 Berth uses the same directory layout as Plesk. That is deliberate: a server migrated from Plesk keeps its data in the place it already had, scripts and backups that know Plesk paths keep working, and administrators who know Plesk find their way at once. This article lists where everything lives and who owns it. ## Overview | Path | What | |---|---| | `/var/www/vhosts/` | Webspace of a subscription (home directory of its system user) | | `/var/www/vhosts//httpdocs` | Default document root | | `/var/www/vhosts/system//logs` | Web server and PHP logs per domain | | `/var/qmail/mailnames///Maildir` | Mail, one Maildir per mailbox | | `/etc/berth` | Panel settings, certificates, DKIM keys, licence, installation choices | | `/etc/berth/rendered` | Configuration rendered by Berth, one directory per service | | `/etc/berth/local` | Your own additions to service configuration | | `/var/lib/berth/backups` | Local backup archives per subscription | | MariaDB schema `berth` | The panel database | ## Webspaces under /var/www/vhosts Each subscription has a system user whose home is its webspace, `/var/www/vhosts/`, named after the subscription's first domain. Inside: | Path | Owner | Mode | Purpose | |---|---|---|---| | `/var/www/vhosts/` | `root:psaserv` | `0750` | The webspace itself. Owned by root because SFTP chroots into it; the web server reaches it through the `psaserv` group. | | `httpdocs/` | `:psacln` | `0750` | Document root of the site. | | `httpdocs/error_docs/` | the subscription | | Custom error pages (403, 404, 500, 50x), used when enabled for the domain. | | `tmp/` | `:psacln` | `0750` | PHP upload directory and session storage, and `/tmp` and `/var/tmp` of the subscription's PHP-FPM, apps and shell (counts towards the disk quota). | Details worth knowing: - **Custom document roots** are supported, for example `httpdocs/public` for Laravel. Root creates only the first directory under the webspace; deeper directories are created as the subscription user, so a symbolic link placed by a customer can never redirect a root operation. - **Several domains in one webspace**: a domain can have its own webspace, or share the webspace of another domain in the same subscription with its own document root. Migrated accounts keep their source layout, for example `domains//public_html` from DirectAdmin. - **Other subscriptions cannot read a webspace**: they are in the `psacln` group, which has no access to the webspace root. ## Logs under /var/www/vhosts/system Per domain, logs are in `/var/www/vhosts/system//logs`, as in Plesk: | File | Content | |---|---| | `proxy_access_log`, `proxy_access_ssl_log` | nginx access logs (http and https) | | `proxy_error_log` | nginx errors | | `access_log`, `error_log` | Apache | | `php_error_log`, `php_slow_log` | PHP errors and slow requests | | `modsec_audit.log` | WAF events for the domain | The log directory belongs to root and is readable by the web server and, through an ACL, by the subscription's own user, not by other subscriptions: logs contain visitor addresses and sometimes URLs with tokens. Root ownership also stops a customer process from planting a symbolic link that the web server would follow as root. Customers search their own logs under *Statistics → Logs*. See [Logs and log drains](https://www.berthpanel.app/library/logs-and-log-drains/). ## Users and groups | Account | Default id | Purpose | |---|---|---| | group `psacln` | gid 1001 | All subscription users (the customers' group) | | group `psaserv` | gid 1002 | The web servers (nginx, Apache), which need to enter webspaces | | user and group `popuser` | uid 30, gid 31 | Owner of all Maildirs; Dovecot and delivery run mail as this user | | user `berth` | system account | The unprivileged panel daemon `berthd` | | one user per subscription | assigned at creation, never reused | Runs everything of that subscription: PHP, apps, cron, SFTP, shell, containers | If gid 1001 or 1002 is already taken (a cloud image often has a group `ubuntu` on 1001), the installer picks the first free id above it. ### Keeping ids from a migration source When you migrate a server, the new server should use the **same uids and gids** as the old one, so file ownership in copied data, archives and NFS mounts stays correct. Set them at installation, with the numbers from the source server: ```bash berth install --psacln-gid --psaserv-gid --popuser-uid --popuser-gid ``` Subscription users are created with the same name and uid as on the source. An id that is already in use on the new server gives a clear error instead of a silent mismatch. See [Migrating a server](https://www.berthpanel.app/library/migrate-a-server/). ## Mail under /var/qmail/mailnames Each mailbox is a Maildir at `/var/qmail/mailnames///Maildir`, owned by `popuser`, exactly as on Plesk. Dovecot is configured to match: - **Namespace** `INBOX.` with separator `.`, so a folder is `INBOX.Archive` and a subfolder `INBOX.Archive.2026`. Mail clients that were set up against Plesk see the same folder names. - **Folder names in UTF-8 on disk**, as Plesk writes them, so folders with accents or an ampersand migrated from Plesk open normally. - **Special folders** *Drafts*, *Sent*, *Trash* and *Junk* are created and subscribed automatically, with their IMAP special-use flags. - **UIDs are preserved** on migration: the `dovecot-uidlist` with its UIDVALIDITY is copied along, so mail clients do not download every message again after the move. Mailbox passwords are stored as SHA512-CRYPT; hashes migrated from the source keep working. Autoresponder, forwarding and spam filter rules are Sieve scripts kept next to the Maildir and rendered from the panel database. See [Mailboxes](https://www.berthpanel.app/library/mailboxes/). ## /etc/berth `/etc/berth` holds everything that makes the server *this* server: settings, certificates, DKIM keys, the licence, the choices of the installation (used by `berth install --reconfigure` and package upgrades) and the server policy in `beleid.d`. It is part of every server-settings backup and of [disaster recovery](https://www.berthpanel.app/library/disaster-recovery/). ### /etc/berth/rendered Berth renders the configuration of each service into its own directory here: ```text /etc/berth/rendered/ nginx/vhosts/.conf apache/vhosts/.conf php-fpm-8.3/pools/... one directory per PHP version postfix/ maps for domains, mailboxes, aliases, limits dovecot/ opendkim/ proftpd/ berth-waf/ webmail/ ... ``` Each service's own configuration contains only a small include file that points into this tree, so the configuration shipped by the distribution stays in place. Files are always rendered whole from the panel database, tested and swapped in atomically; see [How changes go live](https://www.berthpanel.app/library/how-changes-go-live/). Do not edit files here by hand: the next apply or `berth repair --areas config` writes them again from the database. A file that the configuration test singled out as broken gets a `.berth-quarantine` suffix, which the includes do not read; its content stays for inspection. ### /etc/berth/local Your own additions for nginx, Apache, Postfix and Dovecot go in `/etc/berth/local/`, which the services include but Berth never overwrites. Template fragments for the hoster live in `/etc/berth/local/sjablonen/`; see [How changes go live](https://www.berthpanel.app/library/how-changes-go-live/#customising-safely) and [template fragments](https://www.berthpanel.app/library/web-server-settings/#template-fragments). Both are kept in server-settings backups. You can also edit these additions in the panel, under *System → Configuration* (`berth system local-config`). There is one managed addition per service: nginx, Apache, PHP-FPM per version, Postfix, Dovecot, MariaDB, sysctl, journald and logrotate. Directives that would run code as root or touch files that do not belong to the service are refused. Each change runs through the service's own configuration test, and after a minute Berth checks that the service still runs and answers; unless you confirm the change within a few minutes, the previous content goes back automatically. Every version is kept and can be applied again, and an edit made by hand on disk can be adopted as the managed addition. ```bash berth system local-config list berth system local-config check nginx --file extra.conf # forbidden directives and the diff, nothing written berth system local-config apply nginx --file extra.conf --note "longer timeout" berth system local-config confirm nginx berth system local-config adopt postfix # take over a hand edit berth system local-config apply-version nginx 3 ``` ## Programs | Installed with | Programs | |---|---| | The one-line command or a release directory | `/usr/local/sbin/berth`, `berthd`, `berth-agent`, `berth-probe` | | deb or rpm package | `/usr/lib/berth/`, with `berth` in `/usr/sbin` | The systemd units `berth-agent.service` and `berthd.service` start them. ## Backups and other data - **Local archives** per subscription: `/var/lib/berth/backups`. By default the last 7 nightly archives stay on the server. - **The hourly history** is a deduplicated restic repository per subscription on the same server. - **Container storage** (images, layers, volumes) is kept per subscription, outside the webspace, and counts toward the subscription's disk quota. See [Backups overview](https://www.berthpanel.app/library/backups-overview/). ## What Berth does not touch `berth uninstall` removes the panel's programs, units, includes and rendered configuration, and puts back the original configuration of each service. It never removes customer data: `/var/www/vhosts`, the Maildirs, customer databases and backups stay. Only `--purge` also removes the panel database and `/etc/berth`. --- # Domains and subscriptions > Add a website, choose its own or a shared webspace and document root, set aliases and a preview address, switch a site off, and change many domains at once. Source: https://www.berthpanel.app/library/domains-and-subscriptions/ · Category: sites · Updated: 2026-10-30 Every website in Berth is a **domain** that belongs to a **subscription**. This article explains how the two relate, how to add a domain from the panel or the CLI, and what you can change afterwards: document root, aliases, preview address, switching a site off and bulk changes across many domains. ## Customers, subscriptions and domains Berth uses three levels, the same way Plesk does: - A **customer** is a person or organisation with one or more panel logins. - A **subscription** is a hosting account on a package. It has its own Linux system user, its own PHP-FPM, its own resource slice and quota, and the limits of its package (domains, mailboxes, databases, disk space). See [Customers and packages](https://www.berthpanel.app/library/customers-and-packages/) and [Isolation](https://www.berthpanel.app/library/isolation/). - A **domain** is a website (and usually a mail domain) inside a subscription. A subscription can hold several domains; each one counts towards the package's domain limit. On disk, a domain's files live under `/var/www/vhosts//`, with the website in `httpdocs/` by default. The layout matches Plesk, so files, scripts and tools that expect that structure keep working. [On-disk layout](https://www.berthpanel.app/library/on-disk-layout/) has the full picture. ## Add a domain The domain must point at the server in DNS before you can request a certificate for it. Everything else works before that, and a preview address (below) lets you look at the site first. 1. Go to *Domains → Add*. The page is called "Add domain". 2. Enter the domain name without `www`, for example `example.com`. 3. Choose the **customer** and the **package**. Leaving the customer empty creates a new customer named after the domain. 4. Choose whether the domain gets **its own subscription** or joins an **existing subscription** of the same customer (an extra domain under the same system user). 5. Optionally choose where the website's files live: - **its own webspace** (the default), or - **the webspace of another domain in the same subscription**, like an additional domain in Plesk. 6. Optionally change the **document root**. The default is `httpdocs`; frameworks such as Laravel and Symfony want `httpdocs/public`. 7. Tick *Request a certificate now* for HTTPS with Let's Encrypt, and HSTS if the site is ready for it. 8. Click **Add**. On the command line, customer, subscription and first domain are one step. Running it again is safe: ```bash berth customer create --domain example.com --plan basis --customer acme \ --docroot httpdocs/public --tls --email admin@example.com ``` To add a domain to an existing subscription, name its system user with `--sysuser`. To put the files in another domain's webspace, add `--webspace`: ```bash berth customer create --domain example.nl --sysuser acme --webspace example.com --tls --email admin@example.com ``` Other useful flags are `--hsts`, `--no-redirect` (keep plain HTTP working on port 80) and `--ip` / `--ipv6` for a site that needs its own address. > [!NOTE] > Customers and resellers can add domains themselves while their package has room. They see the same form, limited to their own subscriptions. ## Subdomains A subdomain such as `shop.example.com` is an ordinary domain in Berth. Add it like any other domain, in the same subscription, and choose either its own webspace or a folder inside the parent's webspace. There is no separate "subdomain" object, so everything in this library about domains applies to subdomains too. ## Domain-claim protection On a shared server, the domain you add decides who receives its mail and who can request its certificates. Berth therefore refuses some names when a customer or reseller adds them (an administrator can still add them): - a public suffix such as `co.uk`, - the domain of a large mail provider, - a name of the server itself: its host name, the mail and webmail names, the Adminer address, the panel address, the base of preview addresses, or their parent domain, - a parent domain or subdomain of a domain that belongs to another customer, - the mail domain of a login, customer or reseller that is not theirs, - a domain that was deleted less than 30 days ago and is still reserved for another customer (see [Reserved for 30 days](#reserved-for-30-days)). This stops one customer from catching another customer's password-reset mail or certificates. In addition, the root agent keeps its own register of which subscription serves which domain, so a configuration for a domain can only be written for the subscription that owns it. ## The domain page *Domains → example.com* is the home of one website. It has tabs for *Overview, Mail, Files, Backups, Statistics* and groups the settings on the overview in sections: | Section | What you find there | |---|---| | *Website* | Document root, IP address, preview address | | *Certificate and HTTPS* | Request, renew or upload a certificate; see [Certificates](https://www.berthpanel.app/library/certificates/) | | *Settings* | Names and aliases, PHP, HTTPS redirect and HSTS, security headers | | *Speed* | PHP processes, page cache, object cache, static files, CDN; see [Caching and CDN](https://www.berthpanel.app/library/caching-and-cdn/) | | *Security* | WAF, write lock, per-visitor limits, geoblocking, hotlink protection; see [Web server settings](https://www.berthpanel.app/library/web-server-settings/) | | *Developers* | Environment variables and secrets, custom web server rules | | *Danger zone* | Move, switch off, delete | Buttons at the top lead to logs, scheduled tasks, Git, apps, containers, WordPress and the other tools of the domain. **Test connection**, also at the top, checks from the server what a visitor runs into: whether the name resolves, whether the port answers, whether the certificate is right and whether the mail server introduces itself properly. Customers can use it too, so they can rule out the server before they call you. ## Change the document root Under *Website → Document root*, pick another folder inside the webspace, for example `httpdocs/public`. The files stay where they are; only the web server configuration changes. ```bash berth domain docroot example.com httpdocs/public ``` ## Aliases and the preferred name Under *Settings → Names* you add extra names for the same website, such as `www.example.com` or an old brand domain, and choose the **preferred name**: with or without `www`. The other name redirects to it, so search engines see one address. Each alias must point at the server in DNS. ```bash berth domain alias --domain example.com --add www.example.com --add example.nl berth domain alias --domain example.com --remove example.nl ``` ## Preview address A preview address lets you (or your customer) look at a site before DNS is switched, which is handy during a migration. Turn it on under *Website → Preview address*. The site gets an extra address that already points at the server; search engines ignore it. ```bash berth domain preview --domain example.com --on ``` By default the address is under `sslip.io`, a public service that resolves a name containing an IP address to that IP. An administrator can set an own base under *Settings → Panel → Preview addresses*, for example `preview.example.nl`, after creating a wildcard record `*.preview.example.nl` that points at the server. ## Give a domain its own IP address By default a domain uses the subscription's address, which is usually the server's main address. An administrator can give one domain its own IPv4 (and optionally IPv6) address of the server: ```bash berth domain ip --domain example.com --ipv4 203.0.113.25 --ipv6 2001:db8::25 berth domain ip --domain example.com # back to the subscription's address ``` For a whole subscription, use `berth subscription ip`. ## Switch one website off Sometimes a single site has to go offline, for example after a compromise or an unpaid invoice, without suspending the whole subscription. Under *Danger zone → Switch website off*: - visitors see a suspension page, - the domain's apps are stopped, - optionally its mailboxes are closed as well, - files, databases, FTP and SSH stay as they are, so the site can be cleaned up or exported. ```bash berth domain disable --domain example.com --reason "Being cleaned after a malware find" berth domain disable --domain example.com --mail # also close the mailboxes berth domain enable --domain example.com ``` The reason is visible to both the administrator and the customer. To suspend everything of a subscription (websites, SSH/SFTP, cron, FTP and mail), use `berth subscription suspend` instead. ## Move a domain to another subscription *Danger zone → Move to another subscription* moves a domain with its files, PHP pool and access. Because a move hands one customer's files to another subscription, the button in the panel only creates a **request**. Root approves or rejects it on the server, or through [rescue mode](https://www.berthpanel.app/library/rescue-mode/): ```bash berth domain move-requests berth domain move-approve ``` After approval the panel carries out the move. A compromised panel process therefore cannot pull a customer's files into a subscription of its own. ## Delete a domain *Danger zone → Delete domain* removes the configuration. Administrators and resellers can tick *Also delete files, logs and certificate*; on the command line that is `--purge`. A customer who deletes a domain keeps the files; the hosting company removes them. ```bash berth domain remove --domain example.com berth domain remove --domain example.com --purge ``` Make sure a recent backup exists first; see [Backups overview](https://www.berthpanel.app/library/backups-overview/). ### Reserved for 30 days After deletion the name and its aliases stay reserved for the same customer for 30 days, because DNS often still points here. During that time no other customer can add the name, so nobody can catch the previous owner's mail or request a certificate for it; that customer (or their reseller) and an administrator can add it again. Reservations are listed and released on the command line: ```bash berth domain reservations # names that are still reserved berth domain release --domain example.com # free one early for someone else ``` ## Change many domains at once *Domains → Several at once* applies one action to a selection of domains, with the outcome per domain: - set the PHP version, - request certificates (in batches), - switch the HTTP-to-HTTPS redirect or HSTS on or off, - switch the page cache on or off, - apply the recommended static-file cache times, or go back to the defaults, - switch the WAF on, or to detection only. ```bash berth domain bulk --action php --value 8.4 --domains example.com,example.nl berth domain bulk --action hsts_on --all ``` ## When a domain is half created Creating a domain touches several services. If one step fails (a DNS check, a certificate, a service reload), the domain is marked as unfinished instead of being left half-configured. The panel retries unfinished domains in the background; you can also do it yourself: ```bash berth domain retry --domain example.com # create it again from the stored settings berth domain reprovision --domain example.com # re-render its configuration ``` Each change goes through the same render, validate and swap pipeline as everything else; see [How changes go live](https://www.berthpanel.app/library/how-changes-go-live/). --- # PHP versions, settings and PHP-FPM > Run PHP 5.6 to 8.5 side by side, choose a version and php.ini values per domain, tune PHP-FPM per subscription, watch OPcache, add extensions or ionCube, and update a PHP version as one unit. Source: https://www.berthpanel.app/library/php/ · Category: sites · Updated: 2026-10-30 Berth runs several PHP versions next to each other and lets every domain pick its own. Each subscription gets its own PHP-FPM, so one busy or broken site cannot starve the others. This article covers versions, per-domain settings, the FPM process model, OPcache, extensions and how PHP is kept up to date. ## Supported versions PHP 5.6 up to 8.5 can be installed. Packages come from the established third-party repositories: **Sury** on Debian and Ubuntu, **Remi** on AlmaLinux and Rocky Linux. Versions that no longer receive security fixes (such as 7.4, 8.0 and 8.1) stay available, so an old site can move to Berth first and be upgraded afterwards. The panel marks them as *outdated*, shows the date of the last security fix, and warns on the domain page and in the [site quality score](https://www.berthpanel.app/library/site-quality-scores/). ### Add or remove a version An administrator manages versions under *System → Software*, or on the command line: ```bash berth php version list # installed and available versions, end of support, who uses them berth php version add 8.4 berth php version remove 7.4 # refused while a domain, package, webmail or Adminer still uses it ``` Adding a version runs as a system job with its own live log. If someone installs a PHP version by hand outside the panel (for example `apt install php8.4-fpm`), Berth detects it and offers *Adopt PHP 8.4*. It never assigns such a version to a domain by itself. ## Choose the PHP version of a domain On the domain page, open *Settings → PHP*, pick the version and save. An empty choice follows the package default. ```bash berth domain php --domain example.com --version 8.3 berth domain php --domain example.com --version "" # back to the package default ``` To move many domains at once, use *Domains → Several at once* or `berth domain bulk --action php --value 8.4 --domains …`. ## php.ini per domain Under the same *PHP* section you set php.ini values for one website. An empty field follows the package. Typical keys: | Setting | Example | |---|---| | `memory_limit` | `256M` | | `upload_max_filesize`, `post_max_size` | `64M` | | `max_execution_time`, `max_input_time` | `60` | | `max_input_vars` | `3000` | | `date.timezone` | `Europe/Amsterdam` | | `session.gc_maxlifetime` | `1440` | | `error_reporting` | `E_ALL & ~E_DEPRECATED` | | `display_errors`, `log_errors`, `short_open_tag`, OPcache, `allow_url_fopen` | on or off | A `.user.ini` in the website is honoured as well. ### Defaults and locking in the package The package sets the defaults for every domain on it: ```bash berth plan set --name basis --php 8.3 \ --php-setting memory_limit=256M --php-setting upload_max_filesize=64M berth plan set --name managed --php 8.3 --php-locked ``` With *PHP settings locked* (`--php-locked`) customers can no longer change the PHP version or php.ini of their domains; the administrator still can. For a single subscription, deviate from the package with an override: ```bash berth subscription override --sysuser acme --php memory_limit=512M berth subscription override --sysuser acme --set php_version=8.4 ``` ### Hard limits from the server policy A hosting company may want limits that no package, override or panel action can loosen, for example a maximum `memory_limit` or an allow-list of PHP versions. Those live in the root-only server policy (`berth beleid`), described in [Web server settings](https://www.berthpanel.app/library/web-server-settings/#server-policy). ## PHP-FPM per subscription Every subscription runs **its own PHP-FPM master per PHP version**, inside the subscription's systemd slice. Its processes run as the subscription's system user and count towards its CPU, memory and task limits. An idle pool costs very little memory. On servers with many small sites, the option *Only packages with limits* keeps the own FPM for packages that have resource limits and lets the rest share an FPM per version. The pools are rendered and tested by the root agent itself from a typed specification, and a reload never cuts off running requests: requests in flight may finish, new ones wait briefly in the queue. See [How changes go live](https://www.berthpanel.app/library/how-changes-go-live/). ### Process model | Model | When to use it | |---|---| | `ondemand` (default) | Most sites. Processes start when requests arrive and stop when idle. | | `dynamic` | Busy sites that benefit from a few processes kept warm. | | `static` | A fixed number of processes; for predictable, heavy load. | The package sets the model and the maximum number of PHP processes per domain. An administrator can deviate per domain under *Speed → PHP processes*: ```bash berth plan set --name basis --fpm-pm ondemand --fpm-max-children 5 berth domain fpm --domain example.com --pm dynamic --max-children 12 berth domain fpm --domain example.com --reset ``` The same section shows how many processes are busy, the peak since the last start, memory use and slow requests, with advice when the pool was full. A slow request log is kept per domain; open it from the section or with `berth domain logs --domain example.com --kind php_slow`. ## OPcache dashboard *Admin → PHP* shows, per PHP version, the occupancy of every pool (full pools, slow requests) and the OPcache state: memory used, cached files, interned strings, hit rate, with advice when the cache is too small. OPcache memory, the number of files, interned strings and JIT are configurable per version: ```bash berth php status berth php opcache --version 8.3 --memory 256 --files 20000 --jit --jit-buffer 64 ``` Because OPcache is shared by the sites on one PHP version, functions such as `opcache_reset()` and `opcache_get_status()` are not available to websites. PHP picks up new code by itself after an upload. ## Extensions and ionCube Extra PHP extensions, such as `apcu`, are added per version under *System → Software → PHP 8.3*. Only extensions from Berth's built-in list for the operating system are offered. ```bash berth php ext add 8.3 apcu berth php ext remove 8.3 apcu ``` Sites encrypted with ionCube need the **ionCube Loader**. Berth downloads it only from ionCube over HTTPS, checks it against a SHA-256 you supply (or pins the hash of what ionCube delivers now), test-loads it, and enables it as the first Zend extension, followed by a config test and a PHP-FPM reload: ```bash berth php ioncube install 8.3 --accept-license --sha256 berth php ioncube status 8.3 ``` The loader is covered by ionCube's own licence; `--accept-license` confirms you have read it. Extension and ionCube changes reload PHP-FPM, including the own FPMs of every subscription on that version. ## Hardening defaults Every pool starts hardened. The defaults are: - `open_basedir` limited to the subscription's home, - `security.limit_extensions` set to `.php`, - process functions (`exec`, `system`, `proc_open` and similar) and the OPcache control functions disabled, - `mail()` **off** in new packages: a hacked site cannot send spam through it, and `mail()` returns `false`. Sites send mail over SMTP with a mailbox instead (WP Mail SMTP, PHPMailer), - `expose_php` off, hardened session cookies, - each subscription's FPM with its own `/tmp`: the webspace's `tmp/` folder, which counts towards the subscription's disk space; other processes on the server are hidden. Two package switches relax this when a site really needs it: | Package option | Effect | |---|---| | *Allow PHP mail()* (`--php-mail`) | PHP may send with `mail()`, within an hourly recipient budget per subscription | | *PHP may start processes* (`--php-shell`) | Process functions are allowed | Hidden files such as `.env`, `.git` and `.htaccess`, and the private folders of web shops, are never served to visitors; `.well-known` is. ## Updating PHP as one unit The automatic security updates include PHP from Sury or Remi, within a version only patch releases. All packages of one PHP version (fpm, cli, common and the extensions) always move together: *System → Updates* shows one line per version, for example "PHP 8.3: 8.3.26 → 8.3.27, 15 packages", with **Update PHP 8.3**. The update runs with a check before and after; if the check fails, all packages go back together. The check afterwards requests every site on the updated version again: a site that worked before the update and now returns a server error makes the update count as failed. See [OS updates and maintenance](https://www.berthpanel.app/library/os-updates-and-maintenance/) and [every site is watched for server errors](https://www.berthpanel.app/library/uptime-and-status-pages/#every-site-is-watched-for-server-errors). ## Related - [Domains and subscriptions](https://www.berthpanel.app/library/domains-and-subscriptions/) - [Isolation](https://www.berthpanel.app/library/isolation/) for slices, quotas and outbound traffic - [Software installer](https://www.berthpanel.app/library/software-installer/) for WordPress and other PHP applications - [Customers and packages](https://www.berthpanel.app/library/customers-and-packages/) --- # Certificates and HTTPS > Get free certificates from Let's Encrypt automatically, use wildcards via DNS-01, switch to another ACME CA or upload your own certificate, and keep an inventory of everything that expires. Source: https://www.berthpanel.app/library/certificates/ · Category: sites · Updated: 2026-10-30 Every website on Berth can have HTTPS without manual work. Certificates come from Let's Encrypt by default, renew themselves, and are used for the website as well as for the domain's mail and webmail names. This article covers requesting and renewing certificates, wildcards, other certificate authorities, your own certificates, the TLS profile and troubleshooting. ## Automatic certificates With automatic certificates on (the default), a daily round requests a certificate for **every domain whose DNS points at the server** and does not have one yet. A customer who adds a domain and points it at the server gets HTTPS within a day without doing anything. HTTPS then works, but plain HTTP is not redirected until the site owner chooses *Redirect HTTP to HTTPS*, so a site that is not ready for HTTPS does not break. ```bash berth tls auto # show the setting berth tls auto --on=false # turn automatic certificates off ``` ## Request a certificate for a domain On the domain page, open *Certificate and HTTPS*: 1. Under *Names on the certificate* tick *Also www.* and, if the domain allows DNS-01, *Wildcard \*.*. 2. Optionally tick *Enable HSTS*. Browsers then use only HTTPS for the domain; enable it once everything works over HTTPS. 3. Click **Request certificate**. It takes a few seconds. By default port 80 then redirects to HTTPS. Tick *Do not redirect HTTP to HTTPS* if you need plain HTTP to keep working. On the command line, a certificate is requested over HTTP-01 for an existing domain: ```bash berth tls issue --domain example.com --san www.example.com --email admin@example.com berth tls issue --domain example.com --san www.example.com --hsts berth tls status --domain example.com ``` When you add a domain with `berth customer create … --tls`, the certificate is requested in the same step. All certificates of the server come from one shared account at the certificate authority, which limits how many new certificates that account may order. To keep one customer from using up that allowance for everyone, requests by customers and resellers are paced: one request at a time per domain, and a limited number of new certificates per customer and per reseller per hour. Renewals, automatic certificates and requests by an administrator do not count. ## Renewal Certificates renew automatically every day once they are within 30 days of expiry, reusing the names of the current certificate. If a renewal fails, you get an alert so it does not expire unnoticed. Manual renewal: ```bash berth tls renew --domain example.com berth tls renew --all --days 30 ``` ## Validation methods and wildcards | Method | How it works | When to use it | |---|---|---| | **HTTP-01** | Let's Encrypt fetches a token from `http:///.well-known/acme-challenge/` | The default; port 80 of the domain must reach this server | | **DNS-01 via a DNS provider** | The panel sets a TXT record at the linked provider | Wildcards, or sites behind a proxy | | **DNS-01 on the panel's own DNS** | The record is set in the zone the server hosts | Wildcards when Berth runs your DNS | | **DNS-01 via delegation** | One `NS` record delegates `_acme-challenge.` to the server's own responder | Wildcards while the zone stays at a provider Berth cannot reach | Wildcard certificates (`*.example.com`) always need DNS-01. Linking a DNS provider or running your own zone is described in [DNS](https://www.berthpanel.app/library/dns/). Delegation is useful when the DNS of a domain is somewhere else and you cannot or do not want to give the panel API access. You add one record once at the provider, and the server answers the challenge itself: ```bash berth tls delegation --domain example.com --on berth tls delegation --domain example.com --check # checks publicly that the NS record is in place ``` Port 53 (UDP and TCP) of the server must be reachable from outside for delegation. New Let's Encrypt keys are ECDSA P-256 by default. ## Other certificate authorities Besides Let's Encrypt, Berth can request certificates over ACME from: - ZeroSSL (DV), - Sectigo DV, OV and EV, - DigiCert, - Google Trust Services, - Buypass Go SSL, - an internal ACME CA with your own root certificate. Paid CAs use External Account Binding (EAB): you get a key ID and an HMAC key from the CA. Set them up under *Security → Certificates → Certificate authorities*: ```bash berth tls ca list berth tls ca set --preset sectigo-ov --eab-kid --eab-hmac-file - --email admin@example.com berth tls ca domain --domain example.com --ca sectigo-ov ``` With `--customers`, customers may choose that CA for their own domains. A domain switches to the chosen CA from its next request or renewal. For an internal CA, pass its root certificate with `--ca-cert`; browsers outside your organisation will then show a warning. ## Your own certificate For a certificate bought elsewhere, open *Certificate and HTTPS → Certificate from the supplier* and either paste certificate, intermediate certificates and key as PEM, or choose a PKCS#12 file (for example an export from Windows) with its password. The panel checks that the key matches, that the names fit the domain, that it is valid, and that the chain ends at a trusted root. It puts the chain in the right order and uses the certificate for the website and the domain's mail names. ```bash berth tls upload --domain example.com --cert cert.pem --chain bundle.pem --key key.pem berth tls upload --domain example.com --pfx example.p12 --password-file - ``` An uploaded certificate is **not** renewed automatically. The certificate inventory shows when it expires, and the panel warns in time. ### Create the key and CSR in the panel If the CA needs a certificate signing request, let the panel make it: *Create request*. The private key is generated on the server and never leaves it; you send only the CSR to the supplier. Fill in organisation, unit, city, province and country for OV or EV; leave them empty for domain validation only. ```bash berth tls csr --domain example.com --name www.example.com --key-type ecdsa-p256 --org "Acme B.V." --country NL --out example.csr berth tls upload --domain example.com --cert cert.pem --chain bundle.pem # no --key: uses the pending request ``` ### Go back to the previous certificate Uploading or replacing a certificate keeps the old one as the previous version. If the new one turns out wrong, **Restore previous version** puts it back after the same checks; running it again swaps them back. ```bash berth tls restore-previous --domain example.com ``` To move from a bought certificate to a free one, use **Switch to Let's Encrypt**. ## TLS profile The TLS settings of all websites follow the guidelines of the Dutch NCSC for TLS. The profile **Good** allows TLS 1.2 and 1.3 with modern ciphers, which is what internet.nl expects. **Sufficient** adds older ciphers for old clients. ```bash berth tls profile berth tls profile --set goed ``` The profile applies to the websites. Postfix and Dovecot accept only TLS 1.2 and 1.3, whichever profile is chosen. ## Certificates for mail and webmail Each domain can have its own `mail.` and `webmail.` names, so mail clients see the customer's own name instead of the server's. Postfix and Dovecot pick the right certificate per name (SNI); a wildcard certificate on the domain covers them as well. See [Webmail and mail clients](https://www.berthpanel.app/library/webmail-and-mail-clients/). ## Certificate inventory *Security → Certificates* lists every certificate on the server, websites, panel and mail, with the one that expires first at the top. **CSV for audits** exports the list. ```bash berth tls inventory ``` ## When a certificate does not work Per domain, *Certificate: diagnosis* compares the certificate the server actually serves with the file on disk, and explains why a request failed: DNS that points elsewhere, port 80 that does not reach the server, a CAA record that forbids the CA, a rate limit at the CA. ```bash berth tls diagnose --fix # reload what differs and check again berth tls diagnose example.com --acme # why a request for this domain failed ``` The domain's [quality score](https://www.berthpanel.app/library/site-quality-scores/) also flags a missing or expiring certificate, a missing redirect and missing HSTS. For HSTS duration and the other security headers, see [Web server settings](https://www.berthpanel.app/library/web-server-settings/). --- # Caching, compression and CDN > Make sites fast with the nginx page cache or microcaching, a private Valkey object cache per subscription, long browser cache times with WebP and AVIF, a Cloudflare or Bunny CDN, HTTP/2, HTTP/3 and Brotli. Source: https://www.berthpanel.app/library/caching-and-cdn/ · Category: sites · Updated: 2026-10-30 A Berth website has several speed layers that you switch on per domain: a page cache in nginx, an object cache for the application, browser cache times for static files with modern image formats, and an optional CDN in front. This article explains what each layer does, when to use it, and how it stays correct when content changes. All of these settings live on the domain page under *Speed*. Customers can manage them for their own domains. ## How a request travels nginx accepts every request. It serves static files (images, CSS, JavaScript, fonts, downloads) itself and passes the rest to Apache, which runs PHP through the subscription's own PHP-FPM. The page cache sits in nginx, in front of Apache and PHP; the object cache sits behind PHP, in front of the database. ```text visitor ─► CDN (optional) ─► nginx ─┬─► static file from disk (browser cache times, WebP/AVIF) ├─► page cache HIT └─► Apache ─► PHP-FPM ─┬─► object cache (Valkey) └─► MariaDB / PostgreSQL ``` ## Page cache With the page cache on, nginx stores the pages your site produces and serves them itself for the chosen time, without PHP or the database. That makes pages much faster and keeps a site standing during a traffic peak. What is **never** cached: - visitors who are logged in, - form submissions and other non-GET requests, - URLs with a query string (searches, filters); with microcaching these are cached too, for the few seconds you chose, - shopping carts and checkout, - admin pages such as `/wp-admin`, - responses that set a cookie or ask for `no-store` themselves. WordPress and WooCommerce are recognised automatically. The response header `X-Cache` shows whether a page came from the cache (`HIT`). ### Choose a cache time Open *Speed → Page cache*, switch it on and choose a **Cache time**: | Option | Times | Good for | |---|---|---| | Microcaching | 1, 5 or 10 seconds | Dynamic sites: content stays practically live, while a burst of identical requests is answered from one PHP run | | Page cache | 5, 10 or 30 minutes, 1 or 4 hours, 1 day | Sites whose pages change a few times a day or less | ```bash berth domain cache --domain example.com --on --ttl 30 # 30 minutes berth domain cache --domain example.com --on --seconds 5 # microcaching berth domain cache --domain example.com --off ``` ### Stale content and stampedes The cache is configured so that a site stays up when the application has trouble. When a cached page expires, the first visitor triggers a refresh in the background while others still get the previous version; only one request at a time fills an entry. If PHP answers with an error or times out, nginx keeps serving the last good version. ### Purge After a change, visitors see the new version after the cache time at the latest, or immediately after **Clear cache**. ```bash berth domain cache --domain example.com --purge ``` For WordPress, a small plugin clears the affected pages as soon as you publish or change something, so you rarely need the button. If a CDN is linked, clearing the page cache clears the CDN too. ## Object cache (Valkey) Applications such as WordPress, WooCommerce and Laravel can keep the results of expensive database queries in an object cache. Berth gives every subscription **its own Valkey** (the open-source continuation of Redis): - reachable only by the subscription's own websites, over a unix socket, - no password needed, and each website gets its own key prefix, - memory only: nothing is written to disk, - it runs inside the subscription's resource slice, so it counts towards its memory limit. Switch it on under *Speed → Object cache* and pick a size (from 32 MB up). The section shows memory use, number of keys and the hit rate. **Clear object cache** flushes it. ```bash berth subscription objectcache --sysuser acme --on --size 128 berth subscription objectcache --sysuser acme --flush ``` **WordPress** is linked with one button on the WordPress page (*Object cache → Link WordPress*). That installs the *Redis Object Cache* plugin and writes the connection into `wp-config.php`. ```bash berth wp objectcache --domain example.com --link ``` Other applications connect with any Redis client to the socket path shown in the section. The package option *Object cache (own Valkey per subscription)* decides whether a subscription may have one; it is on by default. ## Static files and browser cache times Under *Speed → Static files* you choose how long browsers may keep files, per type: images, CSS and JavaScript, fonts, video and audio, documents and downloads. Options run from *off* and *no-cache* through 1 hour, 1 day, 7 days and 30 days to 1 year. The default is 7 days for everything. Long times (30 days, 1 year) are faster, but a changed file with the same name reaches visitors later. WordPress and most frameworks put a version number in the URLs of CSS and JavaScript, which makes 1 year safe for those. ```bash berth domain static --domain example.com --images 30d --css-js 1y --fonts 1y berth domain static --domain example.com --reset ``` ### WebP and AVIF With *Offer WebP and AVIF* on, the panel creates a smaller WebP and AVIF version of every JPEG and PNG (`photo.jpg.webp`, `photo.jpg.avif`), but only when it is actually smaller. nginx serves it to browsers that ask for it; others get the original, which always stays in place. New images are converted every night, or immediately with **Convert now**. ```bash berth domain static --domain example.com --modern-images on berth domain images convert --domain example.com berth domain images status --domain example.com ``` ### When .htaccess must apply to static files Because nginx serves static files itself, rules in `.htaccess` (a password on a download folder, `Deny from all`, a hotlink rule) do not apply to them. Plesk behaves the same way. If you rely on such rules, switch on *Everything via Apache*. All files then go through Apache. It is a little slower, and it cannot be combined with WebP/AVIF. ```bash berth domain static --domain example.com --via-apache on ``` ## CDN: Cloudflare or Bunny If a site sits behind Cloudflare or Bunny, link it under *Speed → CDN*. Choose the provider, enter the zone ID (Cloudflare) or pull zone ID (Bunny) and an API key. Two things change: - **Real visitor addresses.** nginx takes the visitor's address from the CDN's header, but only from the provider's published address ranges, which the panel refreshes daily. Logs, statistics, PHP, the WAF and bans all see the real visitor instead of the CDN. - **Purging.** Clearing the page cache, or publishing in WordPress, also clears the cache at the CDN. **Clear CDN** does it by hand. The API key only needs the right to purge the cache. For Cloudflare that is *Zone · Cache Purge* and *Zone · Read*. ```bash berth domain cdn --domain example.com --provider cloudflare --zone --token-file - berth domain cdn --domain example.com --purge berth domain cdn --domain example.com --provider off berth cdn refresh # refresh the providers' address lists now ``` ## Protocols and compression - **HTTP/2** is always on for HTTPS sites. - **HTTP/3** (QUIC over UDP port 443) is a server-wide switch, off by default. An administrator turns it on under *Settings → Panel → HTTP/3*. It applies to every site with a certificate and to the panel; browsers that cannot use it fall back to HTTP/2. The panel's own firewall opens UDP 443 by itself, but a firewall in front of the server must allow it as well. - **Compression**: nginx compresses text responses, including PHP output from Apache, with Brotli for browsers that support it and gzip for the rest, and serves pre-compressed `.br` files when they exist. - **TCP tuning**: the server uses BBR congestion control with fair queueing, and does not fall back to a slow start on an idle keep-alive connection. That helps visitors on mobile and long-distance connections. Where the kernel does not support it, the setting is left out. ## Check the effect The domain's [quality score](https://www.berthpanel.app/library/site-quality-scores/) has a performance part that checks most of the above: page cache, object cache for WordPress, static cache times, WebP/AVIF, HTTP/3, a recent PHP version and whether PHP processes ran out. With Core Web Vitals measurement on, it shows real-world loading figures too. Busy PHP pools are covered in [PHP](https://www.berthpanel.app/library/php/#php-fpm-per-subscription), and per-site traffic and response codes in [Statistics and metrics](https://www.berthpanel.app/library/statistics-and-metrics/). --- # Web server settings > How the nginx and Apache stack works, and how to set redirects, HSTS, security headers, protected folders, hotlink protection, error pages, custom directives, per-visitor limits, geoblocking and the write lock. Source: https://www.berthpanel.app/library/web-server-settings/ · Category: sites · Updated: 2026-10-30 This article covers the per-domain web server settings in Berth: redirects and HTTPS, security headers, protected folders, hotlink protection and error pages, custom nginx and Apache rules, rate limits per visitor, geoblocking and the write lock. It also explains the server policy and template fragments that let an administrator set rules for every site at once. Most settings are on the domain page under *Settings*, *Security* and *Developers*. Customers can change them for their own domains unless noted otherwise. ## The stack: nginx in front, Apache behind Berth uses the same arrangement as Plesk: - **nginx** accepts all HTTP and HTTPS traffic, terminates TLS, serves static files, runs the page cache and applies redirects, headers, per-visitor limits and geoblocking. - **Apache** sits behind nginx and handles what needs PHP or `.htaccess`. It passes PHP to the subscription's own PHP-FPM through `mod_proxy_fcgi`. For HTTPS requests nginx talks to Apache over TLS on the loopback interface. A site therefore sees exactly what it saw on Plesk: `HTTPS=on`, port 443 and the `https` scheme, in PHP and in `mod_rewrite`. Common `.htaccess` rules that send HTTP to HTTPS (`RewriteCond %{HTTPS} off`, WordPress, Really Simple SSL) do not cause a redirect loop. Every vhost is rendered from the database, tested with `nginx -t` and `apachectl configtest` before it is activated, and rolled back if the test fails. If one domain's configuration becomes invalid later, only that file is set aside and everyone else's changes still go through. See [How changes go live](https://www.berthpanel.app/library/how-changes-go-live/). ## HTTPS redirect and HSTS Under *Settings → HTTPS*: - **Redirect HTTP to HTTPS** sends every plain HTTP request to HTTPS. - **HSTS** tells browsers to use only HTTPS for the domain from then on. Enable it once everything works over HTTPS. You choose the duration (half a year, one year by default, or two years) and whether it covers subdomains (`includeSubDomains`). internet.nl and the NCSC ask for at least a year. HSTS and the redirect can also be set when requesting a certificate (`berth tls issue --hsts`, `--no-redirect`) or for many domains at once: ```bash berth domain bulk --action redirect_on --domains example.com,example.nl berth domain bulk --action hsts_on --all ``` ## Security headers *Settings → Security headers* adds response headers, one per line as `Name: value`. Allowed are `Content-Security-Policy`, `X-Frame-Options`, `X-Content-Type-Options`, `Referrer-Policy`, `Permissions-Policy`, `Cross-Origin-Opener-Policy`, `Cross-Origin-Resource-Policy`, `X-Robots-Tag` and `Cache-Control`. ```text X-Content-Type-Options: nosniff Referrer-Policy: strict-origin-when-cross-origin Content-Security-Policy: default-src 'self'; img-src 'self' data: ``` The [internet.nl check](https://www.berthpanel.app/library/site-quality-scores/#internet-nl-checklist) can add the recommended set with one click. An administrator can also require headers on every site through the [server policy](#server-policy). ## Redirects The **Redirects** page of a domain offers two kinds: - **Forward the whole domain** to another address, for example after a rebrand. Choose the status code (301, 302, 307 or 308) and whether to keep the path and query. - **Redirect individual paths**, such as `/old` to `/new`, or everything under `/old/*` to a new location. ```bash berth domain forward --domain example.nl --url https://example.com --code 301 --keep-path berth domain forward --domain example.nl --off berth domain redirect add --domain example.com --from /old/* --to /new/ --keep-path berth domain redirect list --domain example.com ``` ## Protected folders **Protected folders** puts HTTP Basic authentication on a folder or on the whole site, with users you create there. Passwords are stored as bcrypt hashes. ```bash berth domain protect add --domain example.com --path private --title "Staff only" berth domain protect list --domain example.com berth domain protect user-add --domain example.com --id 1 --user anna # password generated ``` An empty path protects the whole website, which is useful for a site under construction. ## Hotlink protection *Security → Hotlink protection* stops other websites from embedding your images and video and using your bandwidth. They get an error instead of your file. Opening a file directly keeps working, as do browsers that send no referrer. Your own domain and aliases are always allowed; add other sites that may embed, for example `google.com` for Google Images. ```bash berth domain hotlink --domain example.com --on --ext jpg,png,webp,mp4 --allow google.com ``` ## Error pages With custom error pages on, the panel places example files for 403, 404, 500 and other codes in `httpdocs/error_docs/`. Edit them to match the site. ```bash berth domain errorpages --domain example.com --on ``` ## .htaccess `.htaccess` files work as on any Apache host: rewrites and redirects, `ErrorDocument`, headers and environment variables, handlers and MIME types, caching, authentication and a limited `Options`. `.htaccess` cannot enable CGI or server-side includes, and cannot change how PHP is passed to PHP-FPM. That covers what CMSs, plug-ins and frameworks ship with, while keeping the riskiest directives out of reach of a compromised site. `.htaccess` may not switch on `FollowSymLinks` (Apache answers with a 500); use `SymLinksIfOwnerMatch` instead. Sites migrated or imported into Berth have this rewritten automatically. Because nginx serves static files directly, `.htaccess` rules do not apply to images, PDFs and other static files. If you need that (a password on a download folder, an `.htaccess` hotlink rule), switch on *Everything via Apache*; see [Caching and CDN](https://www.berthpanel.app/library/caching-and-cdn/#when-htaccess-must-apply-to-static-files). ## Custom nginx and Apache rules For things the panel has no setting for, such as an extra `location` block or a `proxy_pass` to an app, a domain can carry its own nginx and Apache directives: *Developers → Custom web server rules*. nginx rules go into the domain's server block, Apache rules into its `VirtualHost`. ```bash berth domain directives --domain example.com --nginx nginx-extra.conf berth domain directives --domain example.com --apache - < apache-extra.conf berth domain directives --domain example.com --clear ``` Rules are tested before they go live; on an error the previous configuration stays. Every change to a domain reloads the web servers, so changes by customers and resellers that rewrite the web server configuration are paced per account: someone who changes settings in a rapid loop gets a *busy, try again shortly* answer (`429`) for a moment. Because custom rules are free-form configuration, they are guarded: - **Off by default per package.** The administrator can always set them. Customers and resellers can only when their package has *Allow custom web server rules* (`berth plan set … --custom-web-directives`) or their subscription has that override. A reseller can only enable it in his own packages when the administrator gives him that right. - **Bound to the subscription.** The agent refuses directives that the root processes would execute (loading modules, piped logs, log files outside the domain's log folder), and binds `alias`, `root`, `proxy_pass` and similar to the subscription's own webspace, sockets and ports. - **Switching it off breaks nothing.** Existing rules keep working; the customer can no longer see or change them, only the administrator can. ## Per-visitor limits *Security → Per-visitor limits* slows down bots and login attacks. Visitors who ask too much get a short `429 Too Many Requests`. Limits count per IP address (behind a CDN, the real visitor's address); IPv6 addresses count per /64, so one host cannot dodge the limit by rotating addresses. | Limit | Options | |---|---| | *Limit login attempts* | On by default: a fixed limit per address on WordPress `wp-login.php` and `xmlrpc.php`, and on Joomla and Drupal logins | | Requests per second per address | No limit, 10, 30 or 100 for the whole site, with bursts of twice that | | Concurrent connections per address | 0 (no limit) or 10–1000 | | Own paths | A path, a limit per minute (10, 60, 300 or 1200), optionally counting only `POST` | ```bash berth domain ratelimit --domain example.com --login --site 30 --path "/api/ 300" --path "/contact 10 post" berth domain ratelimit --domain example.com --off ``` Each call sets the full list again, so name every limit you want to keep. How often limits were hit shows up in the package health; see [Site quality scores](https://www.berthpanel.app/library/site-quality-scores/#package-health-and-overload-notices). ## Geoblocking *Security → Geoblocking* either blocks visitors from chosen countries or admits only chosen countries. Blocked visitors get a 403. Let's Encrypt's validation requests and addresses without a country (private networks) are always allowed. Only the account owner can change it. ```bash berth domain geo --domain example.com --block RU,CN berth domain geo --domain example.com --allow NL,BE berth domain geo --domain example.com --off ``` Country data comes from DB-IP Lite (CC BY 4.0) and is updated by the panel. An administrator can add own ranges and can geoblock the panel itself; status pages stay reachable: ```bash berth geoip status printf '198.51.100.0/24 NL\n' | berth geoip overrides berth geoip panel --allow NL,BE,DE ``` ## Write lock A write lock makes a subscription's websites read-only, so an intruder who gets in through a vulnerable plugin cannot leave a backdoor. Switch it on under *Security → Write lock*. While it is on: - no PHP script, SFTP or FTP account or scheduled task can change files in the document roots, - only the writable exceptions you list stay writable (by default `wp-content/uploads` and `wp-content/cache`), - ownership and permissions do not change; the document roots are mounted read-only. For an update, lift the lock temporarily for 15 minutes, an hour, four hours or a day; it goes back on by itself, or immediately with **Lock again now**. The panel's own tools (file manager, WordPress management, restore) lift it briefly when they need to write. The lock applies to the whole subscription. ```bash berth lock on --subscription acme --exceptions wp-content/uploads,wp-content/cache berth lock unlock --subscription acme --for 1h berth lock relock --subscription acme berth lock status --subscription acme ``` ## Rules for every site Two root-only mechanisms let a hosting company set web server rules for all sites, which neither packages nor a compromised panel can loosen. ### Server policy The server policy holds hard limits in TOML files under `/etc/berth/beleid.d/`. The agent applies them to every PHP pool and vhost; the panel can only read them (*Admin → Server policy*). Keys include: | Key | Effect | |---|---| | `web.custom_directives` | `toegestaan` (allowed), `alleen_beheerder` (administrator only) or `nooit` (never) | | `web.headers_required` | Headers set on every site; a domain cannot override them | | `php.mail` | `toegestaan` (allowed) or `nooit` (never): `mail()` off everywhere | | `php.disable_functions_extra` | Extra functions disabled in every pool | | `php.max.memory_limit`, `php.max.upload_max_filesize`, `php.max.post_max_size`, `php.max.max_execution_time` | Upper bounds for php.ini values | | `php.versions_allowed` | The only PHP versions offered | ```bash sudo berth beleid show sudo berth beleid set web.headers_required 'X-Frame-Options: SAMEORIGIN' 'Referrer-Policy: strict-origin' sudo berth beleid set php.max.memory_limit 512M sudo berth beleid check ``` An unknown key or invalid value makes the whole policy invalid: the last valid version keeps applying, and `berth doctor` and the policy page show the error. Imports from Plesk, cPanel or another Berth server pass through the same policy. ### Template fragments For configuration the panel does not know, root can place a fragment on a fixed hook in the templates, for all domains or only those of one package: in the nginx server block, in `location /`, before the proxy to Apache, in the Apache `VirtualHost`, or at the end of the PHP-FPM pool. The agent fills in variables such as `{domein}`, `{webroot}`, `{sysuser}`, `{php_socket}` and `{logs}`, refuses pool fragments that would touch the subscription's sandbox, and the normal config test decides whether it goes live. The fragments are root-owned files in `/etc/berth/local/sjablonen/