Skip to content
PG Horizon
pgpipe v7.0.0

Cheatsheet

The commands you'll actually use to run pgpipe — install, log in, set up the source, verify, troubleshoot, tear down. Copy-paste friendly. For the full feature description, see the product page.

Install

Static binary with no runtime dependencies. The package installs a hardened systemd unit that runs as a dedicated pgpipe system user.

Upgrading from v6 or earlier? v7 requires fresh destination safety storage and configuration/state. Preserve the old installation and read the breaking-upgrade guidance before installing.

1. Install the package

Debian / Ubuntu (.deb)

# arm64: swap amd64 → arm64
wget https://www.pghorizon.com/downloads/pgpipe/v7.0.0/pgpipe_7.0.0_amd64.deb
sudo apt install ./pgpipe_7.0.0_amd64.deb

RHEL / Rocky / Fedora (.rpm)

# aarch64: swap x86_64 → aarch64
wget https://www.pghorizon.com/downloads/pgpipe/v7.0.0/pgpipe-7.0.0-1.x86_64.rpm
sudo dnf install ./pgpipe-7.0.0-1.x86_64.rpm

The package's postinst script creates the pgpipe system user, sets ownership on the config + state directories, and enables the systemd unit. You do not need to run systemctl enable by hand.

2. What got installed

Path Purpose
/usr/bin/pgpipe The static binary.
/lib/systemd/system/pgpipe.service systemd unit. User=pgpipe, ProtectSystem=strict, restart on failure.
/etc/pgpipe/ Config directory (mode 0750). The setup wizard saves pgpipe.yaml here on first run.
/var/lib/pgpipe/ Runtime state (mode 0750) — BoltDB checkpoints, JWT secret, TLS cert/key, admin password hash.
user/group pgpipe Dedicated system user — no shell, no home outside /var/lib/pgpipe.

3. Initialize, then start

# On a fresh installation, complete initialization first
sudo -u pgpipe -- /usr/bin/pgpipe init -c /etc/pgpipe/pgpipe.yaml

# Open the exact printed URL and paste the separate setup token.
# Complete the wizard, then start the service explicitly.
sudo systemctl start pgpipe
sudo systemctl status pgpipe
sudo journalctl -u pgpipe -f

The wizard binds only to loopback. On a remote host, use its printed SSH-tunnel command and exact random URL. After source/destination review, a temporary destination administrator credential prepares protected storage; it is discarded before the runtime starts. Repair stays disabled.

A fresh service stays inactive until both configuration and the completed-init receipt exist. Existing configuration without a valid receipt is unsupported and is never silently adopted. Packages never start/restart the service or connect to a database.

After the first successful start, follow Dashboard login to generate your password and restart the service.

More options? .deb / .rpm packages + Docker quickstart →

Docker quickstart

Spin up two Postgres databases plus pgpipe in one go — fastest way to see replication.

BASE="https://www.pghorizon.com/downloads/pgpipe/v7.0.0"
mkdir pgpipe-v7.0.0-demo &&
cd pgpipe-v7.0.0-demo &&
curl -fSL --retry 5 --retry-delay 2 --connect-timeout 20 --max-time 120 -C - -o pgpipe-7.0.0-docker.tar.gz "$BASE/pgpipe-7.0.0-docker.tar.gz" &&
curl -fsSL --retry 5 -o checksums.txt "$BASE/checksums.txt" &&
awk '$2 == "pgpipe-7.0.0-docker.tar.gz"' checksums.txt | shasum -a 256 -c - &&
tar -xzf pgpipe-7.0.0-docker.tar.gz &&
cd docker &&

# Prepare protected storage and start the isolated demo
docker compose up -d --build --wait --wait-timeout 180

# Generate a dashboard password; save it before continuing
docker compose exec pgpipe pgpipe admin reset-password --generate -c /etc/pgpipe/data/pgpipe.yaml &&
docker compose restart pgpipe &&
docker compose up -d --wait --wait-timeout 180

# Open http://localhost:8086 and sign in as admin
docker compose logs -f pgpipe

Requires only Docker with Compose v2. Supports Intel/AMD64 and ARM64. This disposable local demo uses public database passwords on its private network and exposes the dashboard only at localhost:8086. Use docker compose down to stop while preserving data. docker compose down --volumes explicitly deletes this demo's databases, configuration, and state.

Dashboard login

v7 stores an Argon2id password hash, not a readable password. After starting pgpipe, generate a password using the service user and restart to apply it. Save the displayed password in a password manager; it cannot be recovered from the hash file or service logs.

Docker quickstart

docker compose exec pgpipe pgpipe admin reset-password --generate -c /etc/pgpipe/data/pgpipe.yaml &&
docker compose restart pgpipe &&
docker compose up -d --wait --wait-timeout 180

Open http://localhost:8086 and sign in as admin. Do not add --user root. A normal restart preserves the password; repeat the reset only when needed.

Native Linux package

sudo -u pgpipe -- /usr/bin/pgpipe admin reset-password --generate -c /etc/pgpipe/pgpipe.yaml &&
sudo systemctl restart pgpipe

Externally managed passwords follow their configured source. Prefer a protected file through server.auth.password_file or PGPIPE_DASHBOARD_PASSWORD_FILE. Do not put passwords in shell command arguments or committed YAML.

Minimum config (pgpipe.yaml)

Configuration shape for reference, not a replacement for initialization. Run pgpipe init to create the complete configuration and protected destination storage. Native packages also require the completed-init receipt.

config_version: 6
pipeline:
  name: "prod-replica"

source:
  host: "source.example.com"
  database: "app"
  user: "pgpipe_repl"
  password: "${PGPIPE_SOURCE_PASSWORD}"
  ssl_mode: "verify-full"
  replication:
    slot_name: "pgpipe_prod"
    publication_name: "pgpipe_prod"
  tables:
    - { schema: "public", name: "orders" }
    - { schema: "public", name: "customers" }

destination:
  host: "replica.example.com"
  database: "app_replica"
  user: "pgpipe_writer"
  password: "${PGPIPE_DEST_PASSWORD}"
  ssl_mode: "verify-full"

repair:
  execution_enabled: false

state:
  backend: "boltdb"
  boltdb:
    path: "/var/lib/pgpipe/state.db"

Full reference: annotated pgpipe.example.yaml →

Database prerequisites

Use PostgreSQL 14–18 for the source (15+ for wildcard tables), and PostgreSQL 15–18 for the destination. The destination must use the same or a newer major version than the source. PostgreSQL 14 is source-only. Reserve two steady-state WAL senders per pipeline and a third for repair proof scans.

A destination DBA must prepare the application schemas and grant the runtime role the required DML and, when pgpipe manages table creation, schema-scoped CREATE. The runtime must not be a superuser, database owner, or have database-level CREATE/CREATEROLE. The wizard prepares pgpipe_safety separately; do not grant runtime ownership of it.

Run these on the source PostgreSQL before pointing pgpipe at it.

-- 1. postgresql.conf (requires restart for wal_level)
wal_level             = logical
max_replication_slots = 10
max_wal_senders       = 10

-- 2. pg_hba.conf — allow replication from pgpipe's IP
host  all  pgpipe_repl  10.0.0.0/8  scram-sha-256

-- 3. Replication role with least privilege
CREATE ROLE pgpipe_repl WITH LOGIN REPLICATION PASSWORD 'redacted';
GRANT USAGE ON SCHEMA public TO pgpipe_repl;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO pgpipe_repl;
ALTER DEFAULT PRIVILEGES IN SCHEMA public
    GRANT SELECT ON TABLES TO pgpipe_repl;

Walking through this end-to-end: PostgreSQL Logical Replication, Step by Step →

Start / stop / restart

# Foreground raw binary, after pgpipe init (non-root)
pgpipe start -c pgpipe.yaml

# Validate config without starting
pgpipe validate -c pgpipe.yaml

# Source setup after initialization (mutates source objects; not a dry-run)
pgpipe setup -c pgpipe.yaml

# Under systemd (.deb / .rpm install)
sudo systemctl start pgpipe
sudo systemctl status pgpipe
sudo journalctl -u pgpipe -f

# Under Docker Compose
docker compose restart --no-deps pgpipe
docker compose logs -f pgpipe

Verify replication

-- On the source: slot health + lag
SELECT slot_name, active, wal_status,
       pg_size_pretty(pg_wal_lsn_diff(
         pg_current_wal_lsn(), confirmed_flush_lsn)) AS lag_bytes
FROM   pg_replication_slots;

-- On the source: tables in the publication
SELECT schemaname, tablename
FROM   pg_publication_tables
WHERE  pubname = 'pgpipe_pub';

-- Compare row counts source vs destination
SELECT count(*) FROM public.orders;

pgpipe also exposes everything as Prometheus metrics at http://<host>:8080/metrics. The endpoint requires a bearer token by default. Daemon logs show the protected token-file path, not its contents. Read that file as the service user to configure your scraper, or supply your own token through PGPIPE_METRICS_TOKEN. Keep metrics.public: false unless unauthenticated scraping is explicitly intended on a trusted network.

# Scrape with the token (v2.0.0+ default)
curl -H "Authorization: Bearer $PGPIPE_METRICS_TOKEN" http://localhost:8080/metrics

# prometheus.yml — scrape job with the bearer token
scrape_configs:
  - job_name: "pgpipe"
    authorization:
      credentials: "<your-token>"
    static_configs:
      - targets: ["pgpipe-host:8080"]

Add / remove tables

Use the dashboard's table picker, or hit the REST API while pgpipe is running.

# Add a table to an active pipeline
curl -u admin:$PASSWORD -X POST http://localhost:8080/api/tables \
  -H 'Content-Type: application/json' \
  -d '{"schema":"public","name":"new_table"}'

# Remove a table
curl -u admin:$PASSWORD -X DELETE \
  'http://localhost:8080/api/tables/public/new_table'

# List configured tables
curl -u admin:$PASSWORD http://localhost:8080/api/tables | jq

Diagnose common issues

Symptom Likely cause Fix
wal_status = 'lost' Slot WAL retention exceeded max_slot_wal_keep_size Slot is gone — full re-snapshot needed. Raise the limit and resume.
UPDATE/DELETE not replicating Table has no PRIMARY KEY and no REPLICA IDENTITY ALTER TABLE … REPLICA IDENTITY FULL (or add a PK).
DDL event blocked or quarantined The source change is unsupported, ambiguous, or waiting behind a table-level barrier Review the event in the dashboard, then resolve it manually or through the approved quarantine workflow.
Lag growing monotonically Destination can't keep up (slow disk / locks / network) Switch write.ordering: parallel, increase batch_size, or scale destination.
Source disk filling fast WAL retained for a slot that isn't catching up Bring pgpipe back online, or drop the slot if you're decommissioning.
Events stuck in DLQ Constraint violation, type mismatch, or destination row missing Inspect on the dashboard, fix the destination row, click Retry.
opening state store: ... read-only file system right after the setup wizard v1.1.4 wizard wrote a relative state-DB path; ProtectSystem=strict made cwd / read-only Upgrade to v1.1.4+. On v1.1.4 see the callout below.

"read-only file system" on first start (fixed in v1.1.4)

If a wizard-saved config on an older systemd install fails on first start with opening boltdb ... read-only file system, it's the relative state-DB path bug. v1.1.4 fixes it; the one-line workaround for older installs is in the release notes.

See the v1.1.4 changelog entry → upgrade notes

Moving to v7.0.0

This is a breaking release, not an in-place upgrade from v6 or earlier. There is no migration of old pgpipe.* safety tables, repair history, ledger evidence, or runtime ownership. Mixed old/new runtimes are unsupported. Parsing an older YAML file does not make its destination or state compatible.

  1. Plan a maintenance window. Preserve database backups/PITR, the matching old package, configuration, TLS material, and a consistent state backup. Stop the old pipeline before cutover and monitor its retained source WAL.
  2. Provision a fresh destination database and empty v7 configuration/state paths, preferably on a separate host. Keep the old installation intact. Reusing a destination requires a separately reviewed DBA reset, never an automatic package action.
  3. Prepare source permissions and destination application-schema grants. Choose new source object names for the new pipeline; do not share ownership evidence between versions.
  4. Install the v7 package, complete pgpipe init, and explicitly start through systemd. Generate a dashboard password using the service-user reset command. Re-snapshot and verify the new destination before routing consumers to it.
  5. Retire the old pipeline deliberately using its matching binary and reviewed decommission workflow. Do not leave an abandoned replication slot retaining WAL.

Compatibility checks

  • Configuration schema is version 6. Pipeline names and enabled dashboard usernames must be 1–256 UTF-8 bytes, with no surrounding whitespace or unsafe control/formatting characters.
  • The protected destination contract requires PostgreSQL 15–18 and a restricted runtime login. Existing safety objects are not automatically adopted.
  • Unversioned repair endpoints have been removed. Clients must use /api/v2/repair. Repair execution stays default-off and is not yet GA.
  • For HTTPS-terminating reverse proxies, set server.csrf.trusted_origins to the exact public HTTPS origin without a trailing slash; otherwise browser mutations return HTTP 403.

Rollback and demos

Rollback is a coordinated recovery of the matching binary, configuration, state, and destination. Never point an older binary at v7 safety storage or state. Keep the original environment available until the new destination has been validated.

The v7 Docker bundle uses its own project name and fresh volumes. Do not attach old volumes to the new bundle. Only when an old demo is disposable, run docker compose down --volumes from that old demo's directory to permanently remove its data. Never run a demo reset against real data.

v7.0.0 changelog · Repair operator runbook · Destination safety contract

Remove pgpipe safely

pgpipe separates Decommission pipeline, Remove software, and Erase local data. They affect different systems and never silently perform one another. If this host ran a pipeline, decommission it first so an abandoned slot cannot retain WAL.

  1. 1

    Preview the database decommission

    sudo systemctl stop pgpipe
    sudo -u pgpipe -- /usr/bin/pgpipe teardown \
      -c /etc/pgpipe/pgpipe.yaml

    The preview is read-only. It reports the exact source identity, slot, publication, owned objects, preserved objects, and a plan digest without printing credentials.

  2. 2

    Confirm the exact reviewed plan

    If the preview says it is ready, use the exact digest and slot name it printed. Omit --confirm-slot only when the preview does not request it.

    sudo -u pgpipe -- /usr/bin/pgpipe teardown \
      -c /etc/pgpipe/pgpipe.yaml \
      --execute \
      --yes \
      --operator "admin@example.com" \
      --reason "pipeline retired; CHG-1234" \
      --confirm-slot pgpipe_orders_slot \
      --plan-digest <64-lowercase-hex-characters>

    Execution rechecks the plan, refuses an active or changed slot, drops the exact inactive slot first, and removes only proven pgpipe-owned source objects. It never terminates PostgreSQL sessions, uses broad CASCADE deletion, or changes destination data and safety records.

  3. 3

    Choose what happens locally

    Keep local data: Remove software

    Remove only the package when configuration and state should remain available for recovery or a future reinstall.

    # Debian / Ubuntu
    sudo apt remove pgpipe
    # RHEL / Rocky / Fedora
    sudo dnf remove pgpipe

    Both commands retain /etc/pgpipe, /var/lib/pgpipe, external TLS paths, and the stable pgpipe account.

    Discard local data: Erase local data

    This is permanent. Back up anything that must survive and complete the database decommission first. Debian has a guarded package purge; RPM requires a digest-bound local preview while the binary is still installed.

    # Debian / Ubuntu
    sudo apt purge pgpipe
    # RHEL / Rocky / Fedora: preview first
    sudo systemctl stop pgpipe
    sudo /usr/bin/pgpipe local-purge
    
    # Review the plan, then use its exact digest
    sudo /usr/bin/pgpipe local-purge \
      --execute --yes \
      --confirm-database-teardown \
      --operator "admin@example.com" \
      --reason "pipeline retired; CHG-1234" \
      --plan-digest <64-lowercase-hex-characters>
    sudo dnf remove pgpipe

    Guarded erasure refuses unknown paths, links, mounts, unsafe metadata, and live service processes. It preserves /etc/pgpipe-tls, configured external paths, and the stable service account. Do not replace it with broad rm -rf or account deletion.

  4. 4

    Treat a refusal as a safe stop

    Do not bypass a guard. Correct only the named condition, rerun the read-only preview, and use the new digest. Shared, uncertain, conflicting, or legacy source ownership requires PostgreSQL administrator review; there is no safe automatic execution command for it.

    # Service running, slot active, or database plan changed
    sudo systemctl stop pgpipe
    sudo -u pgpipe -- /usr/bin/pgpipe teardown \
      -c /etc/pgpipe/pgpipe.yaml
    
    # RPM local-data plan changed
    sudo /usr/bin/pgpipe local-purge

Preserved by design

Source application data and uncertain source objects remain. Every destination business table, row, checkpoint, fencing record, and lineage record remains. External TLS paths and the stable pgpipe account remain. Package scripts and local-purge never connect to PostgreSQL.

Docker Compose teardown

Run this only from the unchanged disposable quickstart directory, after confirming its demo data may be permanently deleted:

# Stop containers and delete the data volumes
docker compose down --volumes

If the container used an external source, complete steps 1 and 2 with the matching installed binary and its real configuration before deleting the container. Do not abandon an external replication slot.

Need a hand?

If something here doesn't behave as documented, or you'd rather have us run pgpipe for you, get in touch.