Configuration·PostgreSQL
PostgreSQL Replication Prerequisites
Four things before a standby exists: the right `wal_level` (already the default), a role with REPLICATION, a pg_hba rule for the special `replication` database, and a slot so the primary keeps the WAL the standby will need.
Replication Guide 26 of 47 Intermediate
- OSUbuntu 26.04 LTS (resolute)
- PostgreSQL18.6-0ubuntu0.26.04.1
- ReplicationPhysical streaming, async, with slots
- TimeAbout 14 min
- Reviewed27 August 2026
Written against the versions above. `wal_level = replica` and `max_wal_senders = 10` are defaults, so a stock PostgreSQL is already able to feed a standby - unlike older versions where this section was mostly about turning things on.
| Server Name | IP Address | OS | Roles | CPU | RAM | HDD |
|---|---|---|---|---|---|---|
| db-a01 | 192.168.0.81 | Ubuntu 26.04 LTS | Primary / Source / Replica Set Member 1 | 2 Core | 4 GB | 50 GB |
Before you start
- A running primary, reachable on the network.
-
Check what is already true
-
Create a role that can replicate and nothing else
-
Add a pg_hba rule for the replication pseudo-database
-
Create a slot so the primary keeps what the standby needs