# 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 <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-<version>-1.<arch>.rpm
berth install --hostname server.example.nl --php 8.3
berth license activate --code <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/).
