2.1 Architecture overview
This page shows what PDC-Backup consists of, how the parts talk to each other and which path the data takes during a backup and a restore. It is the starting point for anyone who wants to understand why certain ports must be open and which part does what. The following pages of the chapter go deeper into the server, the protocol, the repository format, data locations and the API.
Building blocks
Building block | Runs where | Task |
|---|---|---|
Browser / scripts | Anywhere | Talk to the web interface and REST API over HTTPS (port 8443) |
Server | Windows service or systemd service | Web interface (embedded), REST API, scheduler, run control, catalog (SQLite), internal CA, notifications, push deployment, repository service (copy, prune, check, browse, ZIP) |
Agent | Every protected computer | Snapshot providers (VSS, LVM, btrfs, ZFS), workload modules (files, image, SQL Server, MariaDB, PostgreSQL, Docker, Hyper-V, Proxmox), restore, self-update |
Repository | Local disk, SMB/NFS share, S3, SFTP, WebDAV | Storage in the restic format |
| Repository host (Linux), optional | Sets and releases immutable attributes for hardened repositories |
The connections:
Connection | Direction | Port | Protocol |
|---|---|---|---|
Browser or script to the server | Browser to server | 8443 | HTTPS with session cookie or API token |
Agent to the server | The agent always opens the connection | 8444 | Mutual TLS (mTLS) and the restic REST protocol under |
Server to storage | Server to repository | depends on storage | Local, SMB, S3, SFTP, WebDAV (depending on the storage type) |
Server to agent | Exceptions only | β | Push installation (SSH, WinRM, SMB) and Wake-on-LAN packets |
Two consequences:
No inbound port has to be opened on the protected computers. TCP 8443 and 8444 must be reachable on the server.
Agents get no storage credentials. The server maps each repository to its real storage and lets agents write append-only (no overwriting, no deleting except their own lock files, hash check of every upload). Forget, prune and check run on the server.
Data flow of a backup
The steps match the numbers in the diagram:
Schedule due. The server's scheduler checks every 15 seconds (and immediately after events) whether a job is due. It makes up missed times once if
catch_upis on.Create run. The server creates a run in the catalog (
queued). If the agent is offline the run becomespending_agentand starts as soon as the agent connects inside the window. If Wake-on-LAN is enabled for the agent, the server sends a magic packet. Before that the dispatcher checks the limits: concurrent jobs per agent (max_jobs_per_agent, default 1) and per repository (max_jobs_per_repository, default 2), blackout windows and storage quotas.Order to the agent. The server sends the order over the existing connection: run ID, kind, workload, specification, repository access (REST path and the agent's own password), tags, scripts and job credentials.
Snapshot on the agent. A pre script phase runs if configured; then the agent creates a consistent state of the source: VSS shadow copy on Windows, LVM, btrfs or ZFS snapshot on Linux, and the native method for databases and VMs.
Read, split, deduplicate, encrypt. The agent reads the data, splits it into chunks, skips chunks that are already known, compresses and encrypts them. Encryption happens here, before data leaves the computer.
Upload over restic REST to the server. The agent uploads packs, index and the snapshot file over port 8444. Access is append-only; the server checks hashes and ownership.
Server writes to storage. The server stores the files in the repository, whatever the storage type (local, SMB, S3, SFTP, WebDAV).
Feedback to the server. During the run the agent reports progress, log lines and finally the result over the same connection. The web interface shows it live.
Retention, check, copies on the server. After a successful backup the server applies the job's retention (forget). Follow-up jobs with the schedule "after job X" start, such as copy jobs. Prune and check run as their own maintenance jobs.
Catalog, protection status, notifications. The result, the snapshot and the statistics are stored in the catalog, the machine's protection status is recalculated and matching notifications go to the channels.
A run goes through the states queued, running and ends in success, warning, failed or cancelled. If the connection to an agent with a running job is lost for longer than offline_run_timeout_minutes (default 15), the run is marked failed. When an agent reconnects after a restart, it names on connecting the runs it is still executing; the server closes all others as lost.
Run kinds
Kind | Executed on | Purpose |
|---|---|---|
| Agent | Backup, restore, restore test (can also run on the server when no agent is chosen), instant recovery session, mounted restore point, virus scan of a restore point |
| Server | Prune/forget, check, copy to another repository, backup of the server configuration, creating a synthetic full backup |
Data flow of a restore
In the web interface the user picks snapshot, files and target. Browsing snapshots and the ZIP download run directly on the server, which opens the repository with the master key.
For a restore to an agent the server creates a run of kind
restoreand sends the restore specification as an order.The agent reads the blocks it needs through the server's REST interface. In isolation mode
per_machine_indexthe server returns only bytes that belong to the agent; everything else is zeroed.The agent writes the files to the target (original place, another folder, another agent) with permissions and metadata. A secure restore adds a virus scan before the data is moved into place.
Progress and result return to the server as feedback.
The recovery medium uses the same mechanism: it enrolls with a recovery token and asks the server for an image restore run on itself. Details in chapter 09 Restore.
Security boundaries
The server holds all secrets (storage credentials, repository passphrases, master key, CA keys) and decides what agents may do.
Agents are trusted only for the data of their own computer. A compromised agent should reach neither the server's keys nor other machines' snapshots (in
per_machine_indexmode) nor retention decisions.Web users act within their role. The certificate and key model is described in section 2.3 Agent communication and PKI, the roles in chapter 11 Users and Security.