3.5 Installing agents
An agent is the program that runs on every machine to be backed up, opens the connection to the server itself, and performs backups and restores there. The standard way is a command generated by the web interface and pasted on the new machine. This page describes that way option by option, manual installation on Windows and Linux, and the enrollment token.
Which way when
Way | When | Requirement |
|---|---|---|
Command from the web interface (pull) | Default for any Windows or Linux machine. No preparation of the target machine. | The target reaches the server on TCP 8444. |
Installer by hand | When no command should be pasted, for example through software distribution. | Setup file or package (see section 3.1 Requirements and installation files) and an enrollment token. |
Push from the server | Many machines at once, Linux over SSH. | Credentials for the target machine (see section 3.6 Pushing agents over the network (push)). |
With a command from the web interface (recommended)
Open Agents and click Add agent. The dialog can also be reached from the dashboard, the Deployment page and the command palette.
Under New machine runs choose the operating system of the new machine.
Under Address of this backup server choose the address the new machine uses to reach this server. It is not the name of the new machine. If the address you need is missing, add it under Settings in the Certificate section (see section 3.4 First start and initial setup).
Optionally enter a note and choose how long the token is valid, then click Create command.
Run the displayed command on the new machine: on Windows in PowerShell as administrator, on Linux in a shell with
sudo. The command downloads the agent from the server, checks the checksum, installs it as a service and enrolls it.After a few seconds the machine appears in the list under Agents as online.
The token works once and expires. Create a new command for each further machine.
Options of the "Add agent" dialog
Option | Effect | Default |
|---|---|---|
New machine runs | Switches between Windows and Linux. Determines which command is shown (Windows command or Linux command). | Windows |
Address of this backup server | Selection list of the names in the server certificate. Addresses that only apply on the server itself ( | the name from the browser's address bar if it is in the certificate and not a loopback address, otherwise the first name in the list |
Note (optional) | Free text up to 120 characters (placeholder "e.g. Laptop Anna"). Appears in the token list. | empty |
Valid for | Lifetime of the token: 15 minutes, 1 hour or 24 hours. After that the agent can no longer enroll with this token. | 15 minutes |
Create command | Creates the token and shows the finished command for copying. | β |
If the chosen address is not in the certificate, the dialog says: " is not in the server certificate. The agent will refuse the connection. Add it under Settings, Certificate (no restart needed), then create a new command." Below the command it shows until when the command can be used (once) and which CA fingerprint (first characters) is embedded: "The command only trusts this server."
The server-wide default lifetime of new tokens can be changed with enrollment_token_minutes in server.toml (1 to 1440 minutes allowed, default 15).
The "Enrollment tokens" list
Below the command the dialog lists all tokens (refreshed every 5 seconds):
Column | Content |
|---|---|
Created | When the token was created |
By | User who created it |
Note | Note of the token. A "recovery" badge marks the token of the recovery console, which may restore the image backups of every machine (see chapter 09 Restore). |
State | "valid, expires β¦", "used β¦" or "expired" |
An unused token can be invalidated at once with Delete (button or right-click menu). The right-click menu also copies the note, creator, state and token ID.
What the command does
Windows
The Windows command is deliberately plain, readable PowerShell (no encoded command, no iex) so antivirus products do not flag it. It works in these steps:
Downloads the agent with
curl.exefromhttps://<server>:8444/install/bin/windows-x86_64to%ProgramData%\pdc-agent-setup.exe. The download does not verify the TLS certificate (-k).Compares the SHA-256 hash of the file with the value embedded in the command. On a mismatch the file is deleted and the command aborts. The hash comes from the trusted web interface.
Sets
PDC_ENROLL_TOKENfor the process and startspdc-agent-setup.exe install --server https://<server>:8444.Removes the environment variable and the file, and reports an error if the exit code is not 0.
install copies the agent to C:\Program Files\PDC-Backup Agent\pdc-agent.exe, enrolls the machine with the token (the CA is pinned through the fingerprint in the token), registers the service PDCBackupAgent and starts it. If the server has no Windows agent package, the command aborts with a hint. Run the server setup again so the agent packages are in place, choose Rescan folder under Deployment and create a new command.
Linux
The Linux command needs curl, openssl, sudo and systemd. It works in these steps:
Downloads the server's CA from
https://<server>:8444/install/ca.pem.Compares the SHA-256 fingerprint of the CA with the value in the command and aborts on a mismatch.
Fetches the installation script
agent.sh?token=β¦over the verified connection and runs it withsudo sh.
The script checks that it runs as root and that systemd exists, detects the architecture (x86_64 or aarch64), downloads the agent, verifies the SHA-256 hash, stops an existing agent service, installs the file to /opt/pdc-agent/pdc-agent, runs enroll --force with the token, writes /etc/systemd/system/pdc-agent.service and activates the service with systemctl enable --now pdc-agent. If there is no package for the architecture, it points to the agent packages of the server (see section 3.8 Installation troubleshooting).
Installing an agent by hand
Windows
Start PDC-Backup-Agent_<version>_x64-setup.exe (it is also in the downloads folder of the server). On the page "Connect to the server" the setup asks for two values, which the web interface shows under Agents and Add agent:
Field | Effect | Default |
|---|---|---|
Server (name or IP address, optionally :port; default port 8444) | Address of the server. Allowed forms are | empty; port 8444 |
Enrollment token | The token from the dialog (starts with | empty |
If the agent is already installed, leave both fields empty to update it and keep its registration. Fill in both to register it again. The components page offers these components:
Component | Effect | Default |
|---|---|---|
Agent service | The agent as the Windows service | always |
Tray icon | Shows every user the backup state of the PC in the notification area, with Back up now (if the administrator allows it), progress and a notification when a backup fails. Starts at every logon. | on |
Mount restore points (WinFsp) | Installs the bundled, unmodified WinFsp installer so backups can be mounted read-only as a drive. WinFsp is (c) Bill Zissimopoulos, GPLv3 with FLOSS exception. Skipped if WinFsp is already installed. | off |
Unattended:
PDC-Backup-Agent_<version>_x64-setup.exe /S /SERVER=backup-pc /TOKEN=pdc1....
Switch | Effect |
|---|---|
| Silent installation |
| Server address as above |
| Enrollment token. Alternatively the environment variable |
| Leaves out the tray icon |
| Selects the component "Mount restore points". If Windows asks for a restart, the setup ends with exit code 3010; it never restarts the machine itself. |
Without /SERVER and /TOKEN the setup updates an already installed agent and keeps its registration. If the agent is not installed, it aborts with "The agent is not installed: server and token are needed".
PDC-Backup-Agent_<version>_x64-setup.exe /S /SERVER=backup-pc /TOKEN=pdc1.... /WINFSP
Install paths: program C:\Program Files\PDC-Backup Agent\pdc-agent.exe, service PDCBackupAgent, state (identity, certificates) and logs under C:\ProgramData\PDC-Backup\agent (logs in the logs subfolder). Without the setup, pdc-agent.exe install --server https://<server>:8444 in PowerShell as administrator also works; the token then comes from PDC_ENROLL_TOKEN.
Linux
sudo apt install ./pdc-backup-agent_<version>_amd64.deb # or: sudo dnf install ./pdc-backup-agent-<version>-1.x86_64.rpm
sudo PDC_ENROLL_TOKEN=<token> /opt/pdc-agent/pdc-agent enroll --server https://<server>:8444
sudo systemctl enable --now pdc-agent
The package installs /opt/pdc-agent/pdc-agent and the unit pdc-agent.service. If an agent state already exists (/var/lib/pdc-agent/agent.toml), the package enables the service and restarts it on update. Otherwise it prints the command for enrolling. The state (identity, certificates) lives in /var/lib/pdc-agent.
Options of pdc-agent enroll:
Option | Effect | Default |
|---|---|---|
| Agent endpoint of the server, for example | required |
| Enrollment token. The environment variable keeps it off the command line. | required |
| Replaces an existing enrollment | off: an already enrolled machine is rejected |
| Folder for identity, certificates and logs |
|
The agent runs as root because it has to read every file. The unit starts it with Restart=always and RestartSec=10, low priority (Nice=10, IOSchedulingClass=idle) and creates a runtime directory for the local status socket /run/pdc-agent/agent.sock. For mounting restore points the machine needs FUSE (/dev/fuse); without FUSE the interface does not offer the machine for it. The self-service switch is off by default in the web interface.
The enrollment token
The token starts with
pdc1.and contains the fingerprint of the server's CA. The agent therefore recognizes at the very first contact whether it is talking to the right server.It works once and expires after the chosen time (15 minutes, 1 hour or 24 hours).
On enrollment the agent receives its own certificate. It renews automatically (lifetime
agent_cert_days, default 30 days, renewal at two thirds). The agent also remembers the server's signing key and later installs only packages signed with it (see section 3.7 Updating and uninstalling).For every push operation the server creates a separate token per target machine automatically (see section 3.6 Pushing agents over the network (push)).
An agent enrolled with a token of the recovery console works only
recovery_agent_hourshours (default 24).
Checking
The machine appears under Agents as online as soon as it connects. If it fails, see section 3.8 Installation troubleshooting. What an agent shows and does in operation is described in chapter 05 Agents.