This episode brings pgBackRest to life for the first time: creating a stanza with stanza-create, validating the entire connection and WAL archiving chain with check, then running your first full backup and reading its status via pgbackrest info. This is the moment your repository starts holding real data.

Our configuration was correct in episode 3, but there's not yet a single real stanza in the repository. In episode 4 we do three things for the first time: create a stanza, validate the entire chain, and run your first full backup. These three moments are the "first heartbeat" of your backup system.
The order must not be reversed: the stanza must be created before check, and check must succeed before the backup. pgBackRest will indeed refuse commands that skip this sequence — but understanding why the order matters will save you from confusion when errors appear.
stanza-create registers the cluster's metadata in the repository: cluster identity (system identifier and timeline), PGDATA location, and archiving status. Without this registration, pgBackRest doesn't know which cluster it's managing — and refuses to accept backups or WAL.
sudo -u postgres pgbackrest --stanza=main stanza-createNote: we run the command as the postgres user. This is important because pgBackRest accesses the repository and database with the same user identity. A successful output is short and clean — no news is good news.
Note
All pgBackRest commands should preferably be run as the postgres user (via sudo -u postgres) when handling a local cluster. Alternatively, create a dedicated pgbackrest user — that's a practice we cover in episode 13 for remote mode. For now, sudo -u postgres is enough.
pgbackrest check is a comprehensive "health check" that validates five things at once:
pg1-host/pg1-path.Let's run it:
sudo -u postgres pgbackrest --stanza=main checkA successful output:
P00 INFO: check command end: completed successfully (72ms)The most common failure on the first try is WAL archiving not yet enabled. check runs a test archive-push that requires archive_mode=on in postgresql.conf. If it fails, enable it:
archive_mode = on
archive_command = 'pgbackrest --stanza=main archive-push %p'
archive_timeout = 60then restart: sudo systemctl restart postgresql. If the error is about permissions or cluster identity, redo the directory owner verification (episode 3) and make sure the stanza was never created for a different cluster.
Tip
Make pgbackrest check a daily ritual, not a one-off. In episode 14 we'll schedule it as part of monitoring — a check failure is the fastest early signal for WAL archiving problems.
With a healthy stanza, it's time for the first full backup:
sudo -u postgres pgbackrest --stanza=main backup --type=full--type=full copies the entire PGDATA into the repository. For a small database, this finishes in seconds. Notice the output shows per-file progress and a duration summary:
P00 INFO: backup command begin 2.59.0: ...
P01 INFO: backup file ... (100%)
P00 INFO: backup command end: completed successfully (2.1s)After the backup finishes, look at the stanza status:
sudo -u postgres pgbackrest infoThe output shows a summary per stanza — cluster version, archived WAL, and the backup list:
stanza: main
status: ok
cipher: none
db (current)
wal archive min/max (16): 000000010000000000000001/...
full backup: 20260813-090000F
timestamp start/stop: 2026-08-13 09:00:00 / 09:00:02
wal start/stop: ...
database size: 24.8MB, backup size: 24.8MBBackup labels like 20260813-090000F have meaning: the date-time the backup started, ending with a type letter (F = full, D = differential, I = incremental). This label is the identity used by the restore and expire commands later.
For a more structured view (used by monitoring scripts), there's a JSON format:
sudo -u postgres pgbackrest info --output=jsonAfter episode 4, your daily cycle can already be:
pgbackrest --stanza=main check — make sure the chain is healthy.archive_command.pgbackrest --stanza=main backup --type=full — a scheduled full snapshot.pgbackrest info — verify the newest backup shows up.There's no automation yet — that comes in episode 10. For now, focus on mastering the manual commands.
Warning
Never run your first backup without stanza-create and a successful check. The backup will fail immediately with a stanza-not-found error, and you'll waste time diagnosing something that's really about ordering. The order: stanza-create → check → backup.
Key takeaways:
stanza-create registers the cluster in the repository — required before anything else.check validates the DB connection, repository, and archive-push/get all at once.backup --type=full copies the entire PGDATA; the first backup is always full.pgbackrest info reads the stanza status and backup labels (...F, ...D, ...I).In the next episode we'll dissect the three backup types — full, differential, and incremental — with example chains, how each works and their sizes, plus the retention settings (repo1-retention-full, repo1-retention-diff) that make the combination of the three space-efficient without losing recovery guarantees. Starting this episode, your backup strategy is no longer "full every day" but a planned system!