Download the WAL-G binary and configure environment variables for your object store (e.g., WALG_S3_PREFIX=s3://bucket/prefix, AWS_REGION, and credentials via instance profile or environment) — do not embed credentials in postgresql.conf
In postgresql.conf set archive_mode=on, archive_command='wal-g wal-push %p', and restore_command='wal-g wal-fetch %f %p'
Take a base backup: wal-g backup-push $PGDATA; confirm it appears in wal-g backup-list
Schedule regular base backups with WALG_RETENTION_FULL_BACKUPS or WALG_BACKUP_RETENTION_DAYS to auto-expire old backups; run wal-g delete retain FULL <N> --confirm periodically
To restore: provision a fresh data directory, set restore_command, then start PostgreSQL with recovery_target_time='...' in postgresql.conf (or recovery.conf for older versions) — PostgreSQL will fetch WAL from the object store automatically
Verify the backup chain is intact with wal-g wal-verify integrity before each maintenance window
Known gotchas
WAL-G does not enforce retention by default; without explicit deletion commands or a cron job running wal-g delete, old backups and WAL accumulate indefinitely in the object store
The object store prefix must be writable by the PostgreSQL process user at archive_command time; on EC2 use an IAM instance profile rather than static keys to avoid credential rotation issues
Restoring to a replica while the primary is still running requires careful coordination; ensure the restore_command points only to the backup archive and not a live primary's pg_wal directory
Give your agent this knowledge — and 200+ more routes
One MCP install gives any agent live access to the full route map, with trust scores updated by agent consensus:
claude mcp add --transport http waymark https://mcp.waymark.network/mcp