Restivra restores an existing PostgreSQL backup into a disposable container, runs your SQL checks against the restored data, and keeps the result in a local web dashboard. It is free, open source under MIT, and runs with Docker Compose.

Watch the 51-second walkthrough

Watch Restivra: create a project, restore a backup, inspect a report and catch stale data

Click the preview to watch the video in your browser. It has sound and uses synthetic data. The current pilot also adds retained-history filters and CSV exports.

View the project on GitHub · Try the pinned pilot

Below is the restore workflow, two recovery edge cases from testing, and a runnable setup.

From an archive to a result

Restivra starts with a completed PostgreSQL 17 custom-format archive produced by pg_dump 17 with -Fc. It does not connect to your production database to create a backup.

A Go worker takes a private snapshot of the archive, calculates its SHA-256, and restores it into a temporary PostgreSQL container. The restore container has no external network or published ports. It runs under resource limits, and the worker removes it after verification.

You can add application-specific SQL checks. Each check must return exactly one non-null boolean. For example, if the application should have orders:

SELECT count(*) > 0 FROM public.orders 

That check would be wrong for a legitimately empty application. The checks need to express your own invariants. A successful restore with no meaningful checks provides less evidence about whether the data is useful.

Checks run in read-only transactions using a restricted role, with a ten-second statement timeout. The UI records restore and check outcomes, cleanup, archive fingerprint and attempt history. It defaults to English and also supports Turkish.

Restivra retained run history with synthetic projects

Two recovery details worth testing

The queue and attempt history live in PostgreSQL. A database advisory lock restricts an installation to one restore worker at a time.

One cleanup edge case is a Docker create operation that finishes after its caller has stopped waiting. An initial absence check can succeed before that late container appears. Startup cleanup alone would leave it around until another restart. The worker now reconciles installation-owned resources before the next restore and roughly every 30 idle seconds. Unknown cleanup stops new work; another installation's resources must be preserved.

Another edge case is a delayed completion from an older worker attempt. It must not overwrite a newer running attempt. Completion checks the expected attempt number under the job's row lock. Earlier failures remain in attempt history even when a fresh retry passes.

Transient infrastructure failures have bounded retries. A failed application check or invalid archive stays a failure. Retrying those automatically would not make the underlying evidence better.

Try the pinned pilot

The primary handoff is Windows with Git, PowerShell 7.2+ and Docker Desktop using Linux containers. Go, Node and a host PostgreSQL installation are not required; the application builds inside Docker.

Start Docker, then run in PowerShell:

git clone --branch v0.1.0-pilot.1 --depth 1 https://github.com/lazypanic999/restivra.git restivra-pilot cd restivra-pilot ./scripts/setup.ps1 docker pull postgres:17-bookworm docker compose up --build -d --wait --wait-timeout 180 ./scripts/pilot-check.ps1 ./scripts/pilot-smoke.ps1 

Open http://127.0.0.1:7474 and sign in with RESTIVRA_AUTH_TOKEN from your private .env file. Do not share that file.

The smoke script creates a real PostgreSQL archive containing two synthetic customers. It then creates two Pilot projects: one checks the expected customer count; the other intentionally runs SELECT false. The second project should fail its SQL check while restore and cleanup succeed. Schedules stay disabled until you configure them.

After inspecting those reports, you can archive the sample projects and add your own authorized archive. Daily schedules, history filters and CSV exports are included. A sleeping computer cannot run scheduled checks; after returning, an overdue daily schedule queues one run rather than a backlog for every missed day.

Current limits and feedback

This is an early localhost pilot for trusted PostgreSQL 17 archives. Defaults are a 256 MiB archive, 512 MiB RAM-backed restored data, and 1536 MiB restore-container memory. A small compressed archive can expand past the data limit.

Custom extensions, other major versions, PITR, public uploads and hosted multi-tenancy are outside the validated profile. Containers are not a hostile-dump sandbox. A pass also does not prove original permissions, full application recovery or backup freshness. Keep your existing backup and independent recovery procedure.

Fresh setup and the synthetic restore checks passed locally on Windows and in Linux CI using PowerShell. The external seven-day developer pilot is still pending. Engineering tests are not a substitute for that pilot.

You can start with the synthetic demo before using any real archive. Feedback on installation, report clarity and useful SQL checks is welcome. No real dumps or credentials are needed for feedback.

If Restivra is useful to you, consider starring the repository to follow its development or sharing it with someone who maintains PostgreSQL backups.

AI disclosure: substantial implementation, tests, documentation and this post were created with OpenAI Codex. Automated tests have been run; independent review and real-user feedback remain necessary.