On this page

3.3 Installing the server on Linux

On Linux the server is installed as a .deb or .rpm package. The package creates a dedicated service account, sets up the systemd service pdc-server and starts it. This page describes the installation, the firewall, the hardened service account, local repository folders and updating from versions that still ran as root.

Installation

The package installs the server and starts it immediately. For ARM64 systems use the _arm64.deb or .aarch64.rpm files.

Debian / Ubuntu

sudo apt install ./pdc-backup-server_<version>_amd64.deb

Fedora / RHEL / AlmaLinux / Rocky

sudo dnf install ./pdc-backup-server-<version>-1.x86_64.rpm

What the package installs and does

During installation the package performs these steps:

  1. Create the group and system user pdc-backup if they are missing. An existing account is never modified.

  2. Stop the service (on an update) and create or hand over the data folder /var/lib/pdc-backup with mode 0700 to pdc-backup.

  3. Copy the agent packages from /usr/share/pdc-backup/packages into the packages folder of the data folder. The server reads them from there, signs them and distributes them.

  4. Reload systemd, enable pdc-server.service and restart it.

  5. Print the web interface address and a reminder about the firewall ports.

Creating the account requires useradd or adduser (Debian: dependency passwd | adduser, RPM: /usr/sbin/useradd).

Files of the server package
β”œβ”€β”€ /usr/bin/
β”‚   β”œβ”€β”€ pdc-server  # server
β”‚   └── pdc-immutable-helper  # helper service for hardened repositories
β”œβ”€β”€ /usr/lib/systemd/system/
β”‚   β”œβ”€β”€ pdc-server.service  # systemd service of the server
β”‚   └── pdc-immutable-helper.service  # helper service (not enabled)
β”œβ”€β”€ /usr/share/pdc-backup/packages/  # agent packages shipped in the package
β”œβ”€β”€ /etc/pdc-immutable-helper/
└── /var/lib/pdc-backup/  # data folder, owner pdc-backup, mode 0700
    β”œβ”€β”€ packages/  # agent packages, signed and distributed by the server
    β”œβ”€β”€ catalog.db  # catalog
    β”œβ”€β”€ secret.key  # master key
    β”œβ”€β”€ pki/  # CA, server and signing keys
    β”œβ”€β”€ logs/  # logs
    β”œβ”€β”€ recovery/  # recovery medium (ISO)
    └── server.toml  # configuration

Firewall

After installation open ports 8443 (web interface) and 8444 (agents) in the firewall if other machines should reach the server.

sudo firewall-cmd --permanent --add-port=8443/tcp --add-port=8444/tcp && sudo firewall-cmd --reload
# or with ufw:
sudo ufw allow 8443/tcp && sudo ufw allow 8444/tcp

If a firewall with custom rules is in use, the two TCP ports are all that is needed. For installing an agent with a command, the new machine must reach port 8444 (see section 3.1 Requirements and installation files).

Showing the web interface address and CA fingerprint

sudo -u pdc-backup pdc-server --data-dir /var/lib/pdc-backup info

The output lists the data folder (data directory), the CA fingerprint (CA fingerprint), the names in the certificate (certificate for) and the web interface address (web UI). Compare the fingerprint with the one in the browser's certificate warning on first access (see section 3.4 First start and initial setup). The command runs as the service account so that no root-owned files appear in the data folder.

Service account and hardened systemd unit

The server runs as the system user pdc-backup (group pdc-backup, home folder /var/lib/pdc-backup, no login shell), not as root, and needs no capabilities. Ports 8443 and 8444 are above 1024. The unit pdc-server.service (installed under /usr/lib/systemd/system/) sets, among others:

Setting

Effect

User=pdc-backup, Group=pdc-backup

The service runs without root rights

StateDirectory=pdc-backup, StateDirectoryMode=0700, UMask=0077

The data folder is readable only by the service account, new files are not readable by others

NoNewPrivileges=true, CapabilityBoundingSet= and AmbientCapabilities= (empty)

No capability can be gained or inherited

ProtectSystem=strict, ProtectHome=read-only, PrivateTmp=true, PrivateDevices=true

The file system is read-only except at the allowed places, no device nodes

ReadWritePaths=/var/lib/pdc-backup -/srv -/mnt -/media

Write access only to the data folder and the usual repository locations. The leading - ignores missing paths. This grants no permissions: the service account needs them on the folders themselves.

RestrictAddressFamilies=AF_UNIX AF_INET AF_INET6

Unix sockets, IPv4 and IPv6 only

Restart=on-failure, RestartSec=10

The service restarts 10 seconds after a failure

In addition, the kernel and process surfaces the server does not use are locked (ProtectKernelTunables, ProtectKernelModules, ProtectKernelLogs, ProtectControlGroups, ProtectClock, ProtectHostname, LockPersonality, RestrictRealtime, RestrictSUIDSGID, RestrictNamespaces, SystemCallArchitectures=native).

Local repository folders and network shares

Because the service account is not root, backup locations must belong to it or be writable for it.

  • Local repositories (for example on /srv/backups or a USB disk): the folder must belong to the account. The server never changes owners. It creates the folder if it is allowed to and restricts it to itself. Otherwise prepare the folder: sudo install -d -o pdc-backup -g pdc-backup -m 0700 /srv/backups/pdc or sudo chown -R pdc-backup:pdc-backup <folder>.

  • Other locations than /srv, /mnt and /media must additionally be released in a drop-in (see below).

  • Network shares (SMB, NFS) are mounted by the system. The server never mounts and never changes permissions there. Example /etc/fstab line for SMB that assigns all files to the service account:

//nas/backup /mnt/nas-backup cifs credentials=/etc/pdc-backup/nas.cred,uid=pdc-backup,gid=pdc-backup,file_mode=0600,dir_mode=0700,_netdev,nofail 0 0

The credentials file /etc/pdc-backup/nas.cred contains username=... and password=... (mode 0600, owner root). Then enter the mount point as a local repository (see chapter 08 Repositories and Storage). For an NFS export, the numeric UID of pdc-backup must be allowed to write. If the UID must be fixed, create the user yourself before installing the package: groupadd --system --gid 900 pdc-backup and useradd --system --uid 900 --gid pdc-backup --home-dir /var/lib/pdc-backup --no-create-home --shell /usr/sbin/nologin pdc-backup. The package keeps an existing user.

Adjusting the unit

Put changes in a drop-in so package updates do not overwrite them:

sudo systemctl edit pdc-server

More repository locations and a mount the service should wait for:

[Service]
ReadWritePaths=/data/backups /home/backup/pdc
RequiresMountsFor=/data/backups

A port below 1024 (for example web_listen = "0.0.0.0:443" in server.toml) additionally needs:

[Service]
AmbientCapabilities=CAP_NET_BIND_SERVICE
CapabilityBoundingSet=CAP_NET_BIND_SERVICE

If binding fails, the log shows cannot listen on <address>: Permission denied.

Updating from a version that ran as root

Earlier versions ran as root. When updating to the package with a service account, this happens:

  1. The package stops the service so the old root process cannot create new root-owned files.

  2. It creates the account pdc-backup and hands /var/lib/pdc-backup over to pdc-backup once. File systems mounted inside the data folder and a data folder on a network file system are left unchanged (the package prints a warning).

  3. It starts the new unit.

The package does not touch repository folders created by root outside the data folder. Give each of them to the service account once (not for network shares):

sudo chown -R pdc-backup:pdc-backup <folder>
sudo systemctl restart pdc-server

At startup the journal shows local repository folder is not usable by the server account for every local repository that cannot be read (journalctl -u pdc-server). The connection test in the repository editor of the web interface shows the same error.

Running server commands by hand

Run commands that write to the data folder (info, dr restore, four-eyes disable, server-key and others) as the service account. A catalog.db created by root would otherwise prevent the service from starting:

sudo -u pdc-backup pdc-server --data-dir /var/lib/pdc-backup info

To restore the server from a configuration backup, see chapter 09 Restore.

Hardened repositories

Hardened repositories (immutable files) need the helper service pdc-immutable-helper on the repository host. The Linux packages include the helper service (/usr/bin/pdc-immutable-helper, pdc-immutable-helper.service and the folder /etc/pdc-immutable-helper) but do not enable it. It is paired and activated in the repository panel (Set up helper…, see chapter 08 Repositories and Storage).

Removing

apt remove and apt purge (or dnf remove) stop the service but never delete data, the account or repositories. Catalog, CA and master key live in the data folder. See section 3.7 Updating and uninstalling.

Last updated Nov 16, 2026