Sign inSign up

irtazaghaffar/snapvault

By irtazaghaffar

•Updated 4 months ago

Image
Networking
Developer tools
Databases & storage
0

989

irtazaghaffar/snapvault repository overview

⁠SnapVault

Multi‑database streaming backup manager with real-time monitoring for S3‑compatible storage

SnapVault is a lightweight, self‑hosted backup and monitoring tool that streams PostgreSQL, MySQL, and MongoDB dumps directly to S3-compatible storage — without writing temporary files to disk. Now includes a full real-time database monitoring system with 25 metrics per database.

Designed for Docker-first environments, SnapVault provides a secure web UI, per-database cron scheduling, flexible retention policies, AES‑256‑GCM credential encryption, and 24/7 background monitoring — all inside a single container.


⁠🚀 Why SnapVault?

Most backup tools create large temporary dump files before uploading them. SnapVault avoids this completely by streaming:

Database → gzip → S3 (multipart upload)

✅ No temporary files ✅ No disk space requirements ✅ Faster backups ✅ 24/7 database monitoring ✅ Production-ready ✅ Single container deployment


⁠✨ Key Features

  • True streaming backups (zero temp files)
  • PostgreSQL, MySQL/MariaDB, MongoDB + Atlas support
  • S3-compatible storage (AWS S3, R2, MinIO, DO Spaces, B2, Supabase)
  • Per-job cron scheduling
  • Automatic retention cleanup
  • AES‑256‑GCM encryption for stored credentials
  • SQLite persistence
  • JWT authentication
  • Dark-mode responsive web UI
  • Multi-arch image (AMD64 + ARM64)
  • Real-time monitoring dashboard (25 metrics per database)
  • MongoDB Atlas auto-detection via mongodb+srv://
  • SSL auto-fallback for PostgreSQL and MySQL cloud providers

⁠📊 Real-Time Database Monitoring

SnapVault includes a full monitoring system that runs 24/7 in the background — no page visits required.

25 metrics per database covering:

CategoryMetrics
OverviewHeartbeat, DB size, cache hit rate
ConnectionsActive, total, idle, connections by state
PerformanceDeadlocks, long running queries, I/O stats
TransactionsTotal, commits, rollbacks
LocksWaiting queries, blocked query details
StorageTable sizes, bloat, temp files, dead row %
MaintenanceIndex usage, vacuum/analyze status
QueriesSlow query log with execution details

Features:

  • Background collection every 60s per database, auto-starts when you add a DB
  • Live dashboard with time-series charts (connections, cache hit rate, DB size, deadlocks)
  • KPI health indicators with green/yellow/red status
  • Structured data tables for complex metrics
  • Full collection log history with JSON export
  • Grafana-ready REST API (/api/monitor/:id/data)

⁠🐳 Quick Start

version: "3.9"

services:
  snapvault:
    image: irtazaghaffar/snapvault:latest
    container_name: snapvault
    restart: unless-stopped
    ports:
      - "3000:3000"
    volumes:
      - snapvault_data:/data
    environment:
      INIT_USERNAME: admin
      INIT_PASSWORD: changeme123
      JWT_SECRET: your-long-random-secret
      ENCRYPTION_KEY: your-long-random-encryption-key
    networks:
      - snapvault_net

volumes:
  snapvault_data:

networks:
  snapvault_net:
    driver: bridge

Start:

docker compose up -d

Then open:

http://localhost:3000

⁠🔐 Environment Variables

VariableRequiredDescription
INIT_USERNAME✅Initial admin username (used once)
INIT_PASSWORD✅Initial admin password
JWT_SECRET✅Secret for signing authentication tokens
ENCRYPTION_KEY⚠️ RecommendedEnables AES‑256‑GCM encryption of credentials
DATA_DIR✅Defaults to /data (Map in Docker Compose)
PORT Mapping✅Defaults to 3000 (Map in Docker Compose)
TZ✅Automatically Detect Container Time zone

⁠📦 How It Works

  1. Scheduler triggers backup (manual or cron)
  2. Database dump tool runs (pg_dump, mysqldump, mongodump)
  3. Output is compressed (gzip)
  4. Stream uploads directly to S3 via multipart upload
  5. Old backups removed based on retention policy
  6. Monitoring collector runs every 60s per database in the background

No temporary files are ever created.


⁠🛡 Production Ready?

Yes — recommended setup:

  • Use strong JWT_SECRET
  • Set ENCRYPTION_KEY
  • Mount /data as a persistent volume
  • Run behind a reverse proxy with HTTPS
  • Test restore procedures regularly

⁠💾 Persistence

SnapVault stores configuration and logs in:

/data/snapvault.db

Always mount a volume:

volumes:
  - snapvault_data:/data

⁠🌍 Supported Storage Providers

  • Amazon S3
  • Cloudflare R2
  • MinIO
  • DigitalOcean Spaces
  • Backblaze B2 (S3 API)
  • Supabase Storage
  • Any S3-compatible service

⁠🏗 Multi‑Architecture Support

Official image supports:

  • linux/amd64
  • linux/arm64

Works on:

  • Intel/AMD servers
  • Raspberry Pi
  • Apple Silicon (M1/M2/M3)

⁠📄 License

MIT © Irtaza Ghaffar


🔗 Docker Hub: https://hub.docker.com/r/irtazaghaffar/snapvault⁠

Tag summary

Content type

Image

Digest

sha256:5def28c80…

Size

166.2 MB

Last updated

4 months ago

docker pull irtazaghaffar/snapvault