
Deploy MYSQL Backup to S3 Service
Quick backup your mysql to any S3 service.
mysql-backup-to-s3
Just deployed
Deploy and Host MYSQL Backup to S3 Service on Railway
MYSQL Backup to S3 Service is a simple service that automatically backs up a MySQL database and uploads the compressed dump to any S3-compatible storage. It creates .sql.gz backups and stores them safely outside your application environment.
About Hosting MYSQL Backup to S3 Service
This service runs as a small Node.js worker that connects to a MySQL database, generates SQL dumps, compresses them, and uploads the backup to an S3 bucket.
It is designed to be easy to deploy and maintain. The service is stateless and works perfectly with Railway cron jobs, making it ideal for scheduled daily or hourly backups. All configuration is handled using environment variables.
Common Use Cases
- Automated MySQL backups
- Off-site backups for disaster recovery
- Backing up Railway MySQL databases
- Simple database backup automation without managing servers
Dependencies for MYSQL Backup to S3 Service Hosting
- Node.js 18+
- MySQL-compatible database
- S3-compatible object storage
Deployment Dependencies
Environment Variables
The service is fully configured using environment variables:
S3 Configuration
-
AWS_ACCESS_KEY_ID
Access key ID for S3 -
AWS_SECRET_ACCESS_KEY
Secret access key for S3 -
AWS_S3_BUCKET
Name of the S3 bucket where backups will be stored -
AWS_S3_REGION
Region of the S3 bucket (can often be set automatically) -
AWS_S3_ENDPOINT(optional)
Custom S3 endpoint for S3-compatible providers (e.g. MinIO, Backblaze)
Database Configuration
-
BACKUP_DATABASE_HOST
Hostname or IP address of the MySQL server -
BACKUP_DATABASE_PORT
Port number of the MySQL server -
BACKUP_DATABASE_USER
Database username -
BACKUP_DATABASE_PASSWORD
Database password -
BACKUP_DATABASE_NAME(optional)
Name of the database to back up
Leave empty to back up all databases (excluding system databases)
Scheduling & Debug
-
BACKUP_CRON_SCHEDULE(optional)
Cron schedule for automatic backups
Default:0 5 * * *(daily at 05:00) -
DEBUG(optional)
Enable verbose logging (1to enable,0to disable)
Why Deploy MYSQL Backup to S3 Service 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 MYSQL Backup to S3 Service 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.
Template Content
mysql-backup-to-s3
poziomekk/mysql-backup-to-s3AWS_S3_BUCKET
The S3 bucket where the backups will be stored. (only name)
AWS_S3_REGION
The AWS region where the S3 bucket is located. (try auto)
AWS_S3_ENDPOINT
S3 endpoint URL, withOUT bucket name.
AWS_ACCESS_KEY_ID
The AWS access key ID for accessing S3.
BACKUP_DATABASE_HOST
The hostname or IP address of the database server.
BACKUP_DATABASE_PORT
The port number on which the database server is listening.
BACKUP_DATABASE_USER
The username to connect to the database server.
AWS_SECRET_ACCESS_KEY
The AWS secret access key associated with the access key ID.
BACKUP_DATABASE_PASSWORD
The password to connect to the database server.