---
title: "Deploy PG Back Web"
description: "Scheduled Postgres backups to S3 or a volume, with a web UI"
category: "Storage"
url: https://railway.com/deploy/pg-back-web
---

# Deploy PG Back Web

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

**[Deploy PG Back Web on Railway](https://railway.com/template/pg-back-web)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/pg-back-web/manifest.json

- **Creator:** Agaz Self-Host
- **Category:** Storage
- **Total deploys:** 2

## Template content

### Postgres https://devicons.railway.app/i/postgresql.svg

- **Image:** ghcr.io/railwayapp-templates/postgres-ssl:18

### PG Back Web https://cdn.jsdelivr.net/gh/homarr-labs/dashboard-icons/png/pgbackweb.png

- **Source:** https://github.com/aalfath/pgbackweb-railway-template
- **Health check:** /api/v1/health
- **Public domain:** Yes

## Documentation

# 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

* PG Back Web on GitHub: https://github.com/eduardolat/pgbackweb
* Release v0.5.2: https://github.com/eduardolat/pgbackweb/releases/tag/v0.5.2
* Template repo (Dockerfile, start script, changelog): https://github.com/aalfath/pgbackweb-railway-template

### 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.



## Similar templates

- [RustFS | (Just Updated) S3 Object Store, Public URL and Keys Set](https://railway.com/deploy/rustfs-or-just-updated-s3-object-store-p) — S3-compatible object store, keys and public URL preset, volume kept
- [TimescaleDB](https://railway.com/deploy/timescaledb-railway-template) — A PostgreSQL-based time-series database for analytics on Railway.
- [Neo4j 2026.10 Community](https://railway.com/deploy/neo4j-202610-community) — Neo4j graph database with APOC, Browser, Bolt TCP proxy and a volume

Open this page in a browser: https://railway.com/deploy/pg-back-web
