---
title: "Deploy MongoDB Backup's S3"
description: "Automated MongoDB database backups and uploading them to S3"
category: "Automation"
url: https://railway.com/deploy/rEtmVZ
---

# Deploy MongoDB Backup's S3

Automated MongoDB database backups and uploading them to S3

**[Deploy MongoDB Backup's S3 on Railway](https://railway.com/template/rEtmVZ)**

- **Creator:** Team Lasse
- **Category:** Automation
- **Total deploys:** 1

## Template content

### MongoDB Backups

- **Source:** lassejlv/mongodb-backup-s3

## Documentation

# MongoDB Backup to S3

Automated MongoDB backup solution that creates regular database backups and uploads them to S3-compatible storage.

## Features

- Automatic MongoDB database backups using native `mongodump`
- Direct upload to S3-compatible storage (AWS S3, Cloudflare R2, etc.)
- Configurable backup schedule via cron expressions
- Automatic cleanup of old local backups
- Proper error handling and logging



## Example Configuration

```env
# MongoDB Configuration
DB_HOST=
DB_PORT=
DB_USER=
DB_PASS=
DB_AUTH_SOURCE=
DB_NAME=

# S3 Configuration (Cloudflare R2)
S3_BUCKET=
S3_ENDPOINT=
S3_ACCESS_KEY_ID=
S3_SECRET_ACCESS_KEY=
S3_REGION=

# Backup Settings
BACKUP_CRON=0 */6 * * *  # Run every 6 hours
BACKUP_RETENTION_DAYS=30  # Keep local backups for 30 days
```


## 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/rEtmVZ
