---
title: "Deploy bun-pg-s3-backup"
description: "A simple Bun cron job to backup PostgreSQL databases to an S3 bucket"
category: "Automation"
url: https://railway.com/deploy/bun-pg-s3-backup
---

# Deploy bun-pg-s3-backup

A simple Bun cron job to backup PostgreSQL databases to an S3 bucket

**[Deploy bun-pg-s3-backup on Railway](https://railway.com/template/bun-pg-s3-backup)**

- **Creator:** Henry Lin's Projects
- **Category:** Automation

## Template content

### postgres-backups-cron https://devicons.railway.com/i/bun.svg

- **Source:** https://github.com/logic-pad/postgres-s3-backups

## Buckets

- **postgres-backups**

## Documentation

# Deploy and Host bun-pg-s3-backup on Railway

A simple Bun script with a Railway bucket to enable blazingly fast automatic backups for your Postgres databases. Run this with a Railway cron schedule and configure the backup retention duration for a fast, easy and cost-efficient backup solution.

This is a fork of Railway's [postgres-s3-backups](https://github.com/railwayapp-templates/postgres-s3-backups) repository which replaces Node with Bun and interacts with the Railway bucket using Bun's native S3 bindings for the best performance.

## About Hosting bun-pg-s3-backup

Set up your Postgres database in your Railway project, then deploy this template into your project with the internal database URL set. Finally, set a cron schedule on the Bun service and let the cron job takes care of everything by itself.

The service has a default backup retention duration of 7 days. Customize this in the variables section.

## Common Use Cases

- Fast and cost-effective database backups for small to medium projects

## Dependencies for bun-pg-s3-backup Hosting

- Bring your own Postgres database

### Deployment Dependencies

None

## Why Deploy bun-pg-s3-backup 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 bun-pg-s3-backup 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) — Automate WhatsApp workflows with Evolution API, n8n, and Postgres.
- [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/bun-pg-s3-backup
