On this page

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.

Architecture: server, agents and repositories
Architecture: server, agents and repositories

Building blocks

Building block

Runs where

Task

Browser / scripts

Anywhere

Talk to the web interface and REST API over HTTPS (port 8443)

Server pdc-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 pdc-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

pdc-immutable-helper

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 /repo/<repository ID>/

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

How a backup run works
How a backup run works

The steps match the numbers in the diagram:

  1. 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_up is on.

  2. Create run. The server creates a run in the catalog (queued). If the agent is offline the run becomes pending_agent and 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.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  7. Server writes to storage. The server stores the files in the repository, whatever the storage type (local, SMB, S3, SFTP, WebDAV).

  8. 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.

  9. 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.

  10. 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

backup, restore, verify, instant, mount, scan

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

maintenance, check, copy, config_backup, synthetic full

Server

Prune/forget, check, copy to another repository, backup of the server configuration, creating a synthetic full backup

Data flow of a restore

  1. 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.

  2. For a restore to an agent the server creates a run of kind restore and sends the restore specification as an order.

  3. The agent reads the blocks it needs through the server's REST interface. In isolation mode per_machine_index the server returns only bytes that belong to the agent; everything else is zeroed.

  4. 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.

  5. 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_index mode) 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.

Last updated Nov 16, 2026