Skip to content
tarn
Get started

Restore any Postgres database to any second.

Tarn keeps continuous snapshots of your database in your own storage and brings it back to the exact second you name, with one command.

Install to restore in three commands

Tarn runs beside your database, streams its write-ahead log to your bucket, and rebuilds any moment on demand.

  1. Install

    One binary for macOS and Linux. Nothing runs on the database host.

    brew install tarn
    ✓ tarn 2.4.0 installedRun tarn connect to attach your first database.
  2. Connect

    Point Tarn at a database and a bucket. It takes a base snapshot, then follows every write.

    tarn connect postgres://app@db.example.com/orders --store s3://acme-backups/orders
    ✓ Connected to orders (Postgres 17.2, 182 GB)✓ Base snapshot written in 3m 12s✓ Following the write-ahead log
  3. Restore

    Name a database and a moment. Tarn restores into a new database, so production is never touched.

    tarn restore orders --to "2026-11-02 09:14:07"
    · Nearest snapshot 09:00:00· Replaying 14m 07s of log✓ Restored to orders_0914 in 41s

Eight commands, one job

Each one prints what it did and what to run next. Add --help to any of them for every flag.

tarn --help

Usage: tarn <command> [flags]

connect
Attach a database and a storage bucket.
restore
Rebuild any second into a new database.
snapshot
Take a base snapshot now, off schedule.
branch
Make a writable copy of any moment.
verify
Restore in the background and check it.
list
Show snapshots, log coverage, and gaps.
prune
Remove what falls outside your keep rule.
status
Report lag, storage, and the last check.

Restore time grows with the log, not the database

Tarn starts from the nearest snapshot, so a terabyte comes back in minutes.

SizeRestoreRelative time
10 GB9s
50 GB18s
100 GB41s
500 GB2m 48s
1 TB5m 31s

Median of 20 restores per size, each replaying 15 minutes of log, on a 16-core host with Postgres 17.2. November 2026.

One file, checked in beside your code

Tarn reads tarn.toml from the working directory. Three keys do most of the work.

  • every = "15m"A base snapshot every 15 minutes. The log covers each second in between.
  • keep = "30d"Anything older than 30 days is pruned on the next run.
  • encrypt = trueData is encrypted with your key before it leaves the host.
tarn.toml
[database]url = "postgres://app@db.example.com/orders"[snapshots]every = "15m"keep = "30d"[storage]store = "s3://acme-backups/orders"encrypt = true

Changelog

A release every few weeks. Every one is signed and backwards compatible.

  1. v2.4.0Restore to a second inside a long-running transaction.
  2. v2.3.2Faster replay for tables with large JSON columns.
  3. v2.3.0New tarn branch command makes a writable copy of any moment.
  4. v2.2.0tarn verify now runs on a schedule.
Full changelog

Start with one line

curl -fsSL https://tarn.example/install.sh | sh