---
title: "Deploy pgbr"
description: "Postgres backup & restore"
category: "Automation"
url: https://railway.com/deploy/pgbr
---

# Deploy pgbr

Postgres backup & restore

**[Deploy pgbr on Railway](https://railway.com/template/pgbr)**

- **Creator:** darseen
- **Category:** Automation

## Template content

### worker https://vaze.up.railway.app/api/hosting/pgbr.png

- **Image:** ghcr.io/darseen/pgbr-worker:latest

### Redis https://cdn.sanity.io/images/sy1jschh/production/0ce0bfdcfbdbf69662b1116671f97c2dd788b655-157x157.svg

- **Image:** redis:8.2.1
- **Start command:** `/bin/sh -c "rm -rf $RAILWAY_VOLUME_MOUNT_PATH/lost+found/ && exec docker-entrypoint.sh redis-server --requirepass $REDIS_PASSWORD --save 60 1 --dir $RAILWAY_VOLUME_MOUNT_PATH"`

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

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

### dashboard https://vaze.up.railway.app/api/hosting/pgbr.png

- **Image:** ghcr.io/darseen/pgbr-dashboard:latest
- **Health check:** /api/health
- **Public domain:** Yes

## Buckets

- **Bucket**

## Documentation

# Deploy and Host pgbr on Railway

pgbr (PostgreSQL Backup & Restore) is a self-hosted tool designed for developers to easily manage reliable database backups. It provides a clean, secure web interface to create, restore, schedule, and migrate PostgreSQL databases using native `pg_dump` and `pg_restore` operations, all without needing to write complex command-line scripts.

## About Hosting pgbr

Hosting pgbr on Railway involves deploying its lightweight Docker container. Once deployed, pgbr securely stores encrypted database connections and allows you to configure automated, cron-based backup schedules. By hosting it in the cloud alongside your actual PostgreSQL databases, you drastically reduce latency during data transfers, making scheduled backups, data restoration, and one-click migrations significantly faster and more dependable.

## Common Use Cases

- **Automated Backup Scheduling:** Setting up customizable cron jobs to ensure your mission-critical databases are backed up automatically without manual intervention.
- **Database Migrations:** Seamlessly migrating data from one PostgreSQL instance to another using built-in, one-click data transfer tools.
- **Visual Interface for CLI Tools:** Empowering developers and team members to utilize powerful native flags for `pg_dump` and `pg_restore` through an intuitive dashboard instead of a terminal.

## Dependencies for pgbr Hosting

- **Persistent Volume:** A storage volume must be attached to retain backup files and configuration data across container restarts.

### Deployment Dependencies

- [pgbr Docker Hub Repository](https://hub.docker.com/r/darseen/pgbr)

### Implementation Details

When configuring your Railway service, ensure you map the following environment variables to successfully initialize the application:


- A secure, random string used to sign user sessions
AUTH_SECRET=your_secure_random_string

- The public URL of your pgbr instance (use Railway's provided domain)
BASE_URL=RAILWAY_PUBLIC_DOMAIN

- The path to your data directory (map your Railway volume here)
PGBR_DATA=/var/lib/pgbr/data

## Why Deploy pgbr 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 pgbr 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

- [N8N Main + Worker](https://railway.com/deploy/n8n-main-worker) — Deploy and Host N8N with Inactive worker.
- [Evolution API with n8n](https://railway.com/deploy/evolution-api-with-n8n) — [Jul'26] WhatsApp automation platform using Evolution API, n8n & PostgreSQL
- [Postgres Backup](https://railway.com/deploy/postgres-s3-backups) — Cron-based PostgreSQL backup to bucket storage

Open this page in a browser: https://railway.com/deploy/pgbr
