A modern, web-based database backup management system built with Next.js 14+, TypeScript, and Prisma. Simple Backup allows you to configure database connections, schedule automated backups, manage backup files, and integrate with external systems via API keys and webhooks.
- MySQL - Full support for MySQL/MariaDB databases
- PostgreSQL - Complete PostgreSQL backup capabilities
- MongoDB - MongoDB database backup support
- Redis - RDB snapshot backup support
- Cassandra - Snapshot backup support
- Elasticsearch - Snapshot backup via REST API
- InfluxDB - Influx backup support
- Neo4j - Database dump support
- SQLite - File-based backup support
- H2 - Script/export backup support
- Multiple Datasources - Manage multiple database connections
- Automated Scheduling - Cron-based job scheduling for regular backups
- Manual Triggers - Run backups on-demand via UI or API
- Backup Management - View, download, and manage backup files
- Connection Testing - Test database connections before creating jobs
- User Authentication - JWT-based authentication with HTTP-only cookies
- Password Encryption - AES-256-GCM encryption for database passwords
- API Key Management - Generate and manage API keys for programmatic access
- Role-Based Access - Admin and User roles
- Webhooks - Configure webhooks for job success/failure events
- REST API - Complete REST API for all operations
- API Documentation - Built-in API documentation page
- Modern UI - Built with Shadcn/UI and Tailwind CSS
- Dark/Light Mode - Theme support
- Responsive Design - Works on desktop and mobile devices
- Real-time Updates - Live status updates for jobs and backups
- Docker Support - Ready-to-use Dockerfile and docker-compose.yml
- Docker Secrets - Secure secret management with Docker secrets
- Production Ready - Optimized for production deployments
-
Node.js 20+ or Bun
-
Database client tools installed (depending on which databases you want to backup):
- MySQL:
mysqlandmysqldump - PostgreSQL:
psqlandpg_dump - MongoDB:
mongoshandmongodump - Redis:
redis-cli - Cassandra:
cqlshandnodetool - Elasticsearch:
curl(REST API) - InfluxDB:
influxCLI - Neo4j:
cypher-shellandneo4j-admin - SQLite:
sqlite3 - H2:
h2.jar(Java required)
- MySQL:
-
Clone the repository
git clone https://github.com/yourusername/simple-backup.git cd simple-backup -
Install dependencies
bun install # or npm install -
Set up environment variables
cp .env.example .env
Edit
.envand set:DATABASE_URL="file:./prisma/system.db" JWT_SECRET="your-super-secret-jwt-key-min-32-chars" ENCRYPTION_KEY="your-super-secret-encryption-key-32-chars" BACKUP_BASE_PATH="./backups"
-
Initialize the database
bun run prisma:generate bun run prisma:migrate bun run prisma:seed
-
Start the development server
bun run dev
-
Access the application
- Open http://localhost:3001
- Login with default credentials:
admin/admin - Important: Change the default password after first login!
-
Create secret files
mkdir -p secrets echo "file:/data/system.db" > secrets/DATABASE_URL echo "your-jwt-secret" > secrets/JWT_SECRET echo "your-encryption-key" > secrets/ENCRYPTION_KEY echo "/data/backups" > secrets/BACKUP_BASE_PATH
-
Start with Docker Compose
docker-compose up -d
-
Access the application
- Open http://localhost
- Login with default credentials:
admin/admin
Note: You can also use *_FILE environment variables to specify custom file paths for secrets:
DATABASE_URL_FILE=/custom/path/db-urlJWT_SECRET_FILE=/custom/path/jwt-secretENCRYPTION_KEY_FILE=/custom/path/encryption-keyBACKUP_BASE_PATH_FILE=/custom/path/backup-path
The priority order is: *_FILE env var > /run/secrets/* > direct env var > default.
For detailed Docker setup instructions, see Docker Documentation.
-
Navigate to Datasources in the sidebar
-
Click Create Datasource
-
Fill in the connection details:
- Name: A friendly name for this connection
- Database Type: Select from MySQL, PostgreSQL, MongoDB, Redis, Cassandra, Elasticsearch, InfluxDB, Neo4j, SQLite, or H2
- Host: Database server hostname or IP (not required for SQLite)
- Port: Database server port (defaults provided, not required for SQLite)
- Username: Database username (optional for Redis, not required for SQLite)
- Password: Database password (optional for Redis, not required for SQLite)
- Database Name/Path: Target database name, file path (for SQLite/H2), or JDBC URL (for H2)
-
Click Test Connection to verify the connection
-
Click Create to save
-
Navigate to Jobs in the sidebar
-
Click Create Job
-
Configure the job:
- Title: A descriptive name for the job
- Datasource: Select a configured datasource
- Cron Expression: Schedule using cron syntax (helper available)
- Destination Path: Where to save backups
- Active: Enable/disable the job
-
Click Create to save
-
Go to Jobs page
-
Find the job you want to run
-
Click the Run button (play icon)
-
Monitor the status in the Backups page
-
Navigate to Backups in the sidebar
-
View all backup files with their status
-
Download backups using the download button
-
Delete old backups as needed
-
Navigate to API Keys in the sidebar
-
Click Create API Key
-
Copy the generated API key (shown only once!)
-
Use the API key in the
X-API-Keyheader for API requests
See the built-in API Docs page for complete API documentation.
The application includes a comprehensive API documentation page accessible at /api-docs when logged in.
- Login via
/api/auth/loginwith username and password - Session stored in HTTP-only cookie
- Include
X-API-Keyheader in API requests - API keys can be created in the UI
# Create a MySQL datasource
curl -X POST http://localhost:3001/api/datasources \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"name": "Production MySQL",
"type": "MYSQL",
"host": "localhost",
"port": 3306,
"username": "root",
"password": "password",
"databaseName": "mydb"
}'
# Create a Redis datasource (username/password optional)
curl -X POST http://localhost:3001/api/datasources \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"name": "Redis Cache",
"type": "REDIS",
"host": "localhost",
"port": 6379,
"databaseName": "0"
}'
# Create a SQLite datasource (host/port not required)
curl -X POST http://localhost:3001/api/datasources \
-H "X-API-Key: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"name": "Local SQLite",
"type": "SQLITE",
"databaseName": "/path/to/database.db"
}'
# Trigger a backup job
curl -X POST http://localhost:3001/api/trigger/job-id \
-H "X-API-Key: your-api-key"
# List backups
curl http://localhost:3001/api/backups \
-H "X-API-Key: your-api-key"- Framework: Next.js 14+ (App Router)
- Language: TypeScript
- Database: SQLite (via Prisma)
- ORM: Prisma
- Styling: Tailwind CSS
- UI Components: Shadcn/UI
- Authentication: JWT (jose) + Argon2
- Scheduling: node-schedule
- Validation: Zod
simple-backup/
βββ app/ # Next.js app directory
β βββ (dashboard)/ # Dashboard routes
β βββ api/ # API routes
β βββ login/ # Login page
β βββ layout.tsx # Root layout
βββ components/ # React components
β βββ ui/ # Shadcn/UI components
β βββ ... # Feature components
βββ lib/ # Utility libraries
β βββ auth.ts # Authentication
β βββ backup-service.ts # Backup execution
β βββ scheduler.ts # Job scheduling
β βββ database-commands.ts # DB command builders
β βββ ... # Other utilities
βββ prisma/ # Prisma schema and migrations
βββ public/ # Static assets
βββ secrets/ # Docker secrets (gitignored)
-
Backup Service: Executes database backups using native tools
-
Scheduler: Manages cron job scheduling
-
API Routes: RESTful API endpoints
-
Middleware: Authentication and authorization
-
UI Components: Reusable React components
-
Database passwords are encrypted using AES-256-GCM
-
Each encryption uses a unique salt
-
Encryption key stored securely (use Docker secrets in production)
-
JWT tokens with 7-day expiration
-
HTTP-only cookies for web sessions
-
API keys with prefix-based validation
-
Always use strong secrets in production
-
Rotate API keys regularly
-
Use HTTPS in production
-
Keep database client tools updated
# Development
bun run dev # Start development server (port 3001)
# Production
bun run build # Build for production
bun run start # Start production server
# Database
bun run prisma:generate # Generate Prisma Client
bun run prisma:migrate # Run migrations
bun run prisma:seed # Seed database
# Linting
bun run lint # Run ESLint| Variable | Description | Default |
|---|---|---|
DATABASE_URL |
SQLite database path | file:./prisma/system.db |
JWT_SECRET |
JWT signing secret | (required in production) |
ENCRYPTION_KEY |
Encryption key for passwords | (required in production) |
BACKUP_BASE_PATH |
Base path for backup files | ./backups (local), /data/backups (Docker) |
NEXT_PUBLIC_APP_URL |
Public app URL | http://localhost:80 (Docker), http://localhost:3001 (local dev) |
This project is licensed under the MIT License - see the LICENSE file for details.
- Docker Deployment Guide - Complete Docker setup and deployment instructions
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
If you encounter any issues or have feature requests, please open an issue on GitHub.
For support, please open an issue on GitHub or contact the maintainers.
Note: This is a self-hosted solution. Make sure to:
- Use strong secrets in production
- Set up proper backups for the application database
- Configure firewall rules appropriately
- Keep all dependencies updated
- Monitor disk space for backup storage

