---
title: "Deploy MySQL With Backups"
description: "The standard MySQL database plus backups to Cloudflare R2"
category: "Storage"
url: https://railway.com/deploy/xNTYS8
---

# Deploy MySQL With Backups

The standard MySQL database plus backups to Cloudflare R2

**[Deploy MySQL With Backups on Railway](https://railway.com/template/xNTYS8)**

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

- **Creator:** Dylan Anthony's Projects
- **Category:** Storage
- **Total deploys:** 18

## Template content

### MySQL https://devicons.railway.app/i/mysql.svg

- **Image:** mysql
- **Start command:** `docker-entrypoint.sh mysqld --innodb-use-native-aio=0 --disable-log-bin --performance_schema=0`

### Backup MySQL to R2

- **Source:** dbanty/rclone-mysql-backup

## Documentation

Deploys the standard [Railway MySQL](https://docs.railway.app/guides/mysql) plus a container which backs up that database to [Cloudflare R2](https://developers.cloudflare.com/r2/).

To set up properly, modify the backups service to:

- Disable restarts
- Set a Cron schedule to back up as often as you'd like in settings

Internally, this uses [mydumper](https://github.com/mydumper/mydumper) to dump the database quickly (saving you compute cost over mysqldump) and [rclone](https://rclone.org/) to sync the data with a folder in an R2 bucket.

You can modify the [generated rclone config](https://github.com/dbanty/rclone-mysql-backup/blob/06174cac3204c2e1e7b992d8f4ff112aa801561c/entrypoint.sh#L7-L16) to support virtually any other target for the backup.

## 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.
- [Garage S3 Storage](https://railway.com/deploy/garage-s3-storage) — Ultra-light S3 server: fast, open-source, plug-and-play.

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