Websites
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.
On this page
- Customers, subscriptions and domains
- Add a domain
- Subdomains
- Domain-claim protection
- The domain page
- Change the document root
- Aliases and the preferred name
- Preview address
- Give a domain its own IP address
- Switch one website off
- Move a domain to another subscription
- Delete a domain
- Change many domains at once
- When a domain is half created
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 and 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/<domain>/, 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 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.
- Go to Domains → Add. The page is called "Add domain".
- Enter the domain name without
www, for exampleexample.com. - Choose the customer and the package. Leaving the customer empty creates a new customer named after the domain.
- 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).
- 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.
- Optionally change the document root. The default is
httpdocs; frameworks such as Laravel and Symfony wanthttpdocs/public. - Tick Request a certificate now for HTTPS with Let's Encrypt, and HSTS if the site is ready for it.
- Click Add.
On the command line, customer, subscription and first domain are one step. Running it again is safe:
berth customer create --domain example.com --plan basis --customer acme \
--docroot httpdocs/public --tls --email admin@example.comTo add a domain to an existing subscription, name its system user with --sysuser. To put the files in another domain's webspace, add --webspace:
berth customer create --domain example.nl --sysuser acme --webspace example.com --tls --email admin@example.comOther useful flags are --hsts, --no-redirect (keep plain HTTP working on port 80) and --ip / --ipv6 for a site that needs its own address.
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).
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 |
| 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 |
| Security | WAF, write lock, per-visitor limits, geoblocking, hotlink protection; see 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.
berth domain docroot example.com httpdocs/publicAliases 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.
berth domain alias --domain example.com --add www.example.com --add example.nl
berth domain alias --domain example.com --remove example.nlPreview 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.
berth domain preview --domain example.com --onBy 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:
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 addressFor 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.
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.comThe 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:
berth domain move-requests
berth domain move-approve <id>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.
berth domain remove --domain example.com
berth domain remove --domain example.com --purgeMake sure a recent backup exists first; see 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:
berth domain reservations # names that are still reserved
berth domain release --domain example.com # free one early for someone elseChange 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.
berth domain bulk --action php --value 8.4 --domains example.com,example.nl
berth domain bulk --action hsts_on --allWhen 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:
berth domain retry --domain example.com # create it again from the stored settings
berth domain reprovision --domain example.com # re-render its configurationEach change goes through the same render, validate and swap pipeline as everything else; see How changes go live.