Deploy PG Back Web

Scheduled Postgres backups to S3 or a volume, with a web UI

Deploy PG Back Web

/var/lib/postgresql/data

Just deployed

/backups

Deploy and Host PG Back Web on Railway

PG Back Web is an open-source (AGPL-3.0) web app for scheduled PostgreSQL backups. It runs pg_dump on a cron schedule for PostgreSQL 13 to 18, stores the dumps on a local volume or in S3-compatible storage, applies retention, shows execution logs, sends webhooks and lets you download or restore a backup from the browser.

About Hosting PG Back Web

PG Back Web is a single Go service with a web UI. It needs a PostgreSQL database for its own settings and history, an encryption key for the database and storage credentials it saves, and a disk for local backups. This template builds PG Back Web v0.5.2 from a GitHub repo that pins the official image by digest, adds a Railway Postgres for its metadata, generates the encryption key, mounts a volume on /backups, gives the service a public domain and checks /api/v1/health. The first visit creates the single admin account. You then add the databases to back up and, optionally, an S3 bucket.

Common Use Cases

  • Nightly backups of a Railway Postgres to S3, Cloudflare R2, Backblaze B2 or MinIO, with retention
  • One web UI for backups of several Postgres databases, with health checks and webhook alerts
  • Downloading a dump or restoring a backup into a database before a risky migration

Dependencies for PG Back Web Hosting

  • PostgreSQL (Railway Postgres, included) for PG Back Web's own metadata
  • Optional: an S3-compatible bucket for off-site backups

Deployment Dependencies

Implementation Details

Add it to your existing stack. Deploy the template into the Railway project that already runs your database (in that project: Create, then Template, then PG Back Web), so both services share the private network. Open the PG Back Web URL, create the admin account, then go to Databases and create a database with:

  • Connection string: your Postgres service's private DATABASE_URL, for example postgresql://postgres:YOUR-PASSWORD@postgres.railway.internal:5432/railway (copy it from your Postgres service's Variables tab)
  • Version: your server's PostgreSQL major version (Railway's current Postgres is 18)

Then add a destination (S3 endpoint, bucket, keys) or use the local /backups volume, and create a backup with a cron expression such as 0 3 * * *.

If your database runs in another Railway project, use its DATABASE_PUBLIC_URL (TCP proxy) instead, because *.railway.internal names only resolve inside one project.

Variables. PBW_ENCRYPTION_KEY is generated (32 characters). Keep it: if it changes, the saved connection strings and S3 keys can't be decrypted. PBW_POSTGRES_CONN_STRING points at the included Postgres (${{Postgres.DATABASE_URL}}), which holds PG Back Web's own data, not your backups. Optional: set TZ (default UTC) for log times and backup file names.

Updates. The service builds from aalfath/pgbackweb-railway-template. When a new version is pinned there, Railway shows deployers an update notice. Read the repo's CHANGELOG.md before applying it.

Why Deploy PG Back Web on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying PG Back Web on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


Template Content

More templates in this category

View Template
RustFS | (Just Updated) S3 Object Store, Public URL and Keys Set
S3-compatible object store, keys and public URL preset, volume kept

SuperSlowSloth
0
View Template
TimescaleDB
A PostgreSQL-based time-series database for analytics on Railway.

Rakit
1
View Template
NEW
Neo4j 2026.10 Community
Neo4j graph database with APOC, Browser, Bolt TCP proxy and a volume

My Projects
0