1. Home
  2. Docs
  3. Connect
  4. Self-managed Postgres
DOCS

Self-managed Postgres.

A server you run yourself — on a VM, in Docker, or on bare metal. Three settings, one user, one firewall rule.

Waltail needs three things from your server: wal_level = logical, a user that is allowed to replicate, and a way to reach the database over the network. Set them up in the steps below. When you paste the connection string in Waltail, the console runs six checks and tells you if anything is still missing.

1. Turn on logical replication

Connect as a superuser and run:

ALTER SYSTEM SET wal_level = 'logical';
-- the defaults of 10 are fine unless other tools already use slots:
ALTER SYSTEM SET max_replication_slots = 10;
ALTER SYSTEM SET max_wal_senders = 10;

Then restart Postgres — wal_level only takes effect on restart. Check with show wal_level;; it should say logical.

2. Create a user for Waltail

CREATE ROLE waltail WITH LOGIN REPLICATION PASSWORD '…';
GRANT CONNECT ON DATABASE app TO waltail;
-- a publication can only be created by the table owner, so either make
-- waltail a member of the owning role, or create the pipeline as that role:
GRANT app_owner TO waltail;

3. Allow the connection

Add a line to pg_hba.conf for the user and database from the addresses Waltail connects from (or your allowlist), for example hostssl app waltail 0.0.0.0/0 scram-sha-256, then reload Postgres. Open the port on the host firewall too.

Then, in Waltail

  1. Paste the connection string

    Use the direct database host. A transaction-mode pooler (PgBouncer and similar) cannot carry a replication connection, so the reachable check would fail there.

  2. Pick tables

    Choose the tables to stream. A table needs a primary key — or REPLICA IDENTITY FULL or an index identity — for updates and deletes to replicate. The console marks any table that does not qualify and says why.

  3. Add a destination

    Waltail creates a publication and a replication slot on your database (both named pgcdc_<pipeline>) and starts streaming. The quickstart walks through the rest.

Start streaming in minutes.