Tutorial Beginner By Samson Tanimawo, PhD Published Oct 7, 2026 10 min read

Postgres Streaming Replication: 30-Minute Tutorial

Replication is the foundation of Postgres HA. Setup is fewer steps than people expect.

Step 1: Configure primary

Edit primary’s postgresql.conf: wal_level = replica, max_wal_senders = 10.

Restart primary.

Step 2: Take base backup

Step 3: Start replica

Replica’s postgresql.conf set as standby (recovery.conf or signal file in PG12+).

Start replica; it streams from primary.

Step 4: Verify replication

On primary: SELECT * FROM pg_stat_replication; shows the replica.

On replica: read-only queries; cannot write.

Antipatterns

What to do this week

Three moves. (1) Run the tutorial end-to-end on your own laptop / sandbox. (2) Apply the pattern to one production workload. (3) Document the variations you needed; share with the team.