Skip to main content
Ardent works with self-managed Postgres 13 or newer. This page prepares your server; the connect-and-branch walkthrough is the Quickstart. Setup is a loop: run preflight, apply the SQL it prints, run preflight again until it passes.
Preflight is fast and non-destructive — it stores no credentials and creates nothing. It prints a pass/fail checklist and a Grant script with the exact SQL for your database and schemas.
With the ardent-cli skill installed, a short ask is enough — the skill fetches this page and runs the checks:
Without the skill, paste the full directions:
1

Allow inbound from Ardent

Ardent connects from a static outbound IP for your environment. If your network restricts inbound traffic, allow that IP on the Postgres port, usually 5432. Ask your Ardent contact for the current outbound IP if you don’t have it.Make sure ssl = on and pg_hba.conf accepts both regular SQL sessions and logical replication sessions from Ardent. Postgres treats them as different connection types, so both lines matter:
After editing pg_hba.conf, reload Postgres — a reload is enough, no restart needed:
Or from the shell: pg_ctl reload -D <datadir> (or sudo systemctl reload postgresql on systemd installs).Hostnames must resolve to an IPv4 address. IPv6-only hosts are not supported today.
2

Enable logical replication

Check the current values first:
Ardent needs wal_level = logical, at least one free replication slot, and enough WAL sender capacity for Ardent plus anything else already replicating from your database. If your existing values are higher than Ardent’s minimums, keep the higher values.ALTER SYSTEM SET only accepts a literal value, not an expression — so ALTER SYSTEM SET max_wal_senders = 10 on a server that already has 20 (say, for existing standbys) would lower it on the next restart and could start refusing those standbys. This block raises each setting only when it’s below Ardent’s minimum:
Prefer doing it by hand? Run the SHOW queries above and only change the settings whose values are below 10.
These changes need a Postgres restart. Plan a maintenance window before continuing.
Be careful with max_slot_wal_keep_size. A finite value protects your disk, but if a logical slot falls behind past that limit, Postgres can invalidate the slot — which forces a connector rebuild, not a graceful catch-up. For high-write databases, leave enough headroom and monitor retained WAL.
Long idle transactions hold back WAL cleanup. Consider idle_in_transaction_session_timeout on roles that might leave transactions open, for example ALTER ROLE app_user SET idle_in_transaction_session_timeout = '5min';.
3

Install the wal2json output plugin

Ardent reads changes through the wal2json logical-decoding plugin. Install the package matching your Postgres major version:
  • Debian and Ubuntu: postgresql-<major>-wal2json
  • RHEL family: wal2json_<major>
Restart Postgres if the plugin wasn’t already loaded.To test it manually, create and immediately drop a temporary slot:
If your session is interrupted after the create statement, run the drop manually before continuing — an unconsumed logical slot retains WAL indefinitely and can fill the disk. Verify cleanup:
No rows should come back.
4

Create the Ardent role

Today, vanilla self-hosted Postgres requires the Ardent role to create event triggers, which is restricted to SUPERUSER. That’s a broad permission — a Postgres superuser can read and modify anything on the cluster. Use a dedicated role, restrict network access to Ardent’s outbound IP, rotate the password deliberately, and prefer a dedicated source cluster or database if your security model requires stricter isolation.
The grants below are still worth running. They don’t limit a superuser — they document the intended read footprint and make the setup ready for the future narrower Ardent role.For each database you want to replicate:
GRANT CREATE ON DATABASE lets Ardent create its own pgstream bookkeeping schema and publication. It does not grant write access to your application schemas.For each schema you want replicated, run inside the matching database:
The ALTER DEFAULT PRIVILEGES lines keep future tables and sequences visible to replication. They only apply to objects created by the role that ran the ALTER — if your application creates tables as another role, repeat them with FOR ROLE:
Find table-owner roles in a schema with:
You usually don’t need to assemble this by hand — preflight prints the generated grant script for your schemas.
5

Run preflight until it passes

Common failures:
  • is writer fails — the URL points at a read replica. Use the writable primary.
  • wal level fails — enable logical replication and restart Postgres.
  • wal2json unverified or failed — install the plugin, or ask Ardent to confirm provider support.
  • can read tables fails — run the generated grant script.
  • duplicate source fails — this database is already connected. Run ardent connector list.
When preflight passes, continue with the Quickstart: create the connector and your first branch. One heads-up for that step: tables without a primary key or valid unique index need a replica identity decision. The CLI walks you through it, and Ardent never runs DDL on your source.