Skip to content
Rowsafe
Docs

Quickstart

Protect your first PostgreSQL database in about 10 minutes, from sign-up to the first backup and restore drill.

This guide protects one PostgreSQL server. You'll install a small agent on it, review a plan, apply it, and restart PostgreSQL once, when it suits you.

You need:

  • A Linux server running PostgreSQL 13 to 18 on Debian 12/13 or Ubuntu 22.04/24.04, with sudo. (PostgreSQL in Docker? See Run the agent in Docker.)
  • A storage bucket for the backups: Cloudflare R2 (10 GB free), Backblaze B2, Amazon S3, Wasabi, DigitalOcean Spaces or any S3-compatible storage.
  • A few seconds of downtime for one PostgreSQL restart, at a time you choose.

Production database?

This is the short version. For a server that matters, follow Adopt an existing database: it adds the preflight checks, secret handling and rollback plan.

Create an account

Sign up. The Free plan protects one server with up to three databases, with every feature.

Install the CLI and log in

Run this on your own computer, not on the database server. The CLI is a single binary for macOS and Linux:

curl -fsSLo rowsafe https://github.com/rowsafe/rowsafe/releases/latest/download/rowsafe-darwin-arm64
chmod +x rowsafe && sudo mv rowsafe /usr/local/bin/

Then log in. This opens the dashboard in your browser, where you confirm a code:

rowsafe login

Over SSH, or with --no-browser, open the printed link on any device.

Create a bucket

Create a private, empty bucket, for example app-rowsafe, and an access key that can read, write and delete only in that bucket. Set up backup storage has click-by-click steps for each provider.

Keep the page with the access key ID and secret open: you'll paste them into the installer in the next step.

Install the agent

Create a one-time enrollment token. It is valid for one hour:

rowsafe hosts enroll-token

It prints the install command with the token. Run it on the database server:

curl -fsSL https://rowsafe.sh | sudo sh -s rse_...

The installer checks the agent's signature and installs it with the backup tool it needs. Then it asks, in your terminal:

  1. Where to keep backups: pick your provider, then paste the bucket name and access key.
  2. It tests the bucket: writes, reads back and deletes a small file. If something is wrong, it tells you what and lets you fix it.
  3. The encryption passphrase: it generates a strong one and shows it once. Then it starts the agent.

Save the passphrase before you continue

Put the passphrase in your password manager before the first backup. Without it, no backup can ever be restored, and nobody can recover it, Rowsafe included. The installer asks you to type its last 4 characters to confirm.

Your keys and passphrase stay on the server, in /etc/rowsafe/agent.env. Rowsafe never sees them.

Back on your computer, check that the server shows up:

rowsafe hosts list

You can also do this step from the dashboard: Hosts, then Add host.

Adopt the database

Give the database a name in Rowsafe, for example app. The name covers the whole PostgreSQL server (all its databases). It uses lowercase letters, digits and dashes.

rowsafe adopt app

This only reads. It prints a plan: the backup configuration Rowsafe will write, and the database settings it will change.

If you have more than one server, add --host HOST. If the plan warns that another tool already archives your database, stop and find out what it is first. See Adopt an existing database.

Apply the plan

rowsafe apply app

Rowsafe writes the backup configuration, prepares the bucket, and changes the settings. There is no downtime. It never restarts your database.

Restart PostgreSQL in your maintenance window

Turning on archiving needs one restart. Pick a quiet moment. Clients see a few seconds of refused connections:

sudo systemctl restart postgresql

On Debian and Ubuntu you can restart one cluster with its own unit, for example postgresql@18-main.

Verify

rowsafe verify app

Rowsafe proves that your database's changes reach your bucket. Then:

app is protected. The first full backup is queued; follow it with `rowsafe tasks app`.

Run your first restore drill

When the first backup has finished (rowsafe backups app), prove that it restores:

rowsafe drill app
rowsafe status app

rowsafe status app says app is PROTECTED. once there is a recent backup and a passing drill.

What happens next

Rowsafe now runs on its own. By default, in UTC:

WhenWhat
ContinuouslyEvery change is archived to your bucket, at most 5 minutes behind
Sundays 01:00Full backup
Monday to Saturday 01:00Differential backup
Sundays 21:15Restore drill

It keeps two full backups, so you can restore to any point in about the last two weeks. You can change the schedules and retention with rowsafe db set.

Set up alerts so you hear about problems. For example, to get warnings and critical alerts in Slack:

rowsafe channels add --type slack --name team --url https://hooks.slack.com/services/...

See Monitoring and alerts for email, Discord and webhooks.

Edit on GitHub