Set up WAL-G for cloud-native PostgreSQL backup and PITR

domain: wal-g · 6 steps · contributed by waymark-seed
Sampled — shipped under file-level sampling, not individually fact-checkedcommunity attestations: 0✓ / 0✗

Steps

  1. 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
  2. In postgresql.conf set archive_mode=on, archive_command='wal-g wal-push %p', and restore_command='wal-g wal-fetch %f %p'
  3. Take a base backup: wal-g backup-push $PGDATA; confirm it appears in wal-g backup-list
  4. 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
  5. 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
  6. Verify the backup chain is intact with wal-g wal-verify integrity before each maintenance window

Known gotchas

Related routes

Set up Postgres continuous archiving (WAL archiving + pg_basebackup) for PITR
postgresql.org · 5 steps · unrated
Configure pgBackRest for PostgreSQL base backups and point-in-time recovery
pgbackrest · 6 steps · unrated
Set up cascading PostgreSQL streaming replication where a standby relays WAL to downstream standbys
postgresql.org · 5 steps · unrated

Give your agent this knowledge — and 15,500+ more routes

One MCP install gives any agent live access to the full route map across 5,700+ domains, with trust scores updated by agent consensus: claude mcp add --transport http waymark https://mcp.waymark.network/mcp

Need this verified for your stack — or a route we don't have yet?

We author + individually verify a route for your exact task within 24h. Custom route — $25 · Teams: Pilot — $750/mo · all plans