Thanks to visit codestin.com
Credit goes to github.com

Skip to content

🐘 Effortless PostgreSQL backups with a user-friendly web interface! πŸŒπŸ’Ύ

License

Notifications You must be signed in to change notification settings

QuoteSystemX/pgbackweb

Β 
Β 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

645 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

PG Back Web

🐘 Effortless database backups (PostgreSQL, ClickHouse) with a user-friendly web interface! πŸŒπŸ’Ύ

CI Status Go Report Card Release Version Docker Pulls License

Note

We're growing! New name, bigger future

PG Back Web is becoming UFO Backup! The new name reflects a future where the project expands beyond PostgreSQL, making powerful backups simple and accessible for everyone

Curious about the roadmap or want to shape the project's future? Join the community to discuss ideas and influence decisions, everyone's input is welcome!

Why PG Back Web?

PG Back Web isn't just another backup tool. It's your trusted ally in ensuring the security and availability of your database data:

  • 🎯 Designed for everyone: From individual developers to teams.
  • ⏱️ Save time: Automate your backups and forget about manual tasks.
  • ⚑ Plug and play: Don't waste time with complex configurations.
  • πŸ”„ Multi-database support: Not just PostgreSQL - also supports ClickHouse and more coming soon!

Features

Core Capabilities

  • πŸ“¦ Intuitive web interface: Manage your backups with ease, no database expertise required.
  • πŸ“… Scheduled backups: Set it and forget it with cron-based scheduling. PG Back Web takes care of the rest.
  • πŸ“ˆ Backup monitoring: Visualize the status of your backups with detailed execution logs, file sizes, and execution history.
  • πŸ“€ Instant download & restore: Restore and download your backups when you need them, directly from the web interface. Supports restoring to any configured database with automatic version detection.
  • πŸ”„ Backup duplication: Easily duplicate existing backup configurations to create new ones quickly.
  • πŸ‘₯ Multi-user support: Manage multiple users with session-based authentication.

Database Support

  • 🐘 PostgreSQL: Full support for PostgreSQL 13, 14, 15, 16, 17, and 18.
  • πŸš€ ClickHouse: Support for ClickHouse versions 22.8, 23.8, 24.1, and 24.3.
  • πŸ”Œ Extensible architecture: Easy to add support for additional database types.

Storage Options

  • πŸ“ Local storage: Store backups directly on the server filesystem.
  • ☁️ S3-compatible storage: Support for AWS S3 and any S3-compatible storage (MinIO, DigitalOcean Spaces, etc.).
  • πŸ”€ Flexible destinations: Configure multiple S3 destinations and choose per backup.
  • πŸ”— Presigned URLs: Secure, time-limited download links for S3-stored backups.

Monitoring & Notifications

  • β€οΈβ€πŸ©Ή Health checks: Automatically check the health of your databases and destinations.
  • πŸ”” Webhooks: Get notified via webhooks for:
    • Database health status changes (healthy/unhealthy)
    • Destination health status changes (healthy/unhealthy)
    • Backup execution success
    • Backup execution failures
  • πŸ“Š Execution tracking: Detailed logs for every backup execution with timestamps, file sizes, and status.

Security & Reliability

  • πŸ”’ PGP encryption: All sensitive data (connection strings, credentials) encrypted at rest using PostgreSQL PGP encryption.
  • πŸ” Password security: Bcrypt hashing for user passwords.
  • πŸ›‘οΈ Session management: Secure session-based authentication with IP and user agent tracking.
  • πŸ”‘ Encryption key: Centralized encryption key management for all sensitive data.

User Experience

  • 🌚 Dark mode: Beautiful dark mode interface.
  • πŸ“± Responsive design: Works seamlessly on desktop and mobile devices.
  • ⚑ Fast & lightweight: Built with Go for performance and efficiency.
  • 🎨 Modern UI: Clean, intuitive interface built with TailwindCSS and DaisyUI.

Open Source

  • πŸ›‘οΈ Open-source trust: Open-source code under AGPL v3 license, backed by robust database tools (pg_dump, clickhouse-backup).
  • πŸ” Transparent: Full source code available for review and contribution.

Installation

PG Back Web is available as a Docker image. You just need to set 3 environment variables and you're good to go!

Here's an example of how you can run PG Back Web with Docker Compose, feel free to adapt it to your needs:

services:
  pgbackweb:
    image: eduardolat/pgbackweb:latest
    ports:
      - "8085:8085" # Access the web interface at http://localhost:8085
    volumes:
      - ./backups:/backups # If you only use S3 destinations, you don't need this volume
    environment:
      # Optional environment variables are ignored, see the configuration section below for more details
      PBW_ENCRYPTION_KEY: "my_secret_key" # Change this to a strong key
      PBW_POSTGRES_CONN_STRING: "postgresql://postgres:password@postgres:5432/pgbackweb?sslmode=disable"
    depends_on:
      postgres:
        condition: service_healthy

  postgres:
    image: postgres:18
    environment:
      POSTGRES_USER: postgres
      POSTGRES_DB: pgbackweb
      POSTGRES_PASSWORD: password
    ports:
      - "5432:5432"
    volumes:
      - ./data:/var/lib/postgresql/data
    healthcheck:
      test: ["CMD-SHELL", "pg_isready -U postgres"]
      interval: 5s
      timeout: 5s
      retries: 5

You can watch this youtube video to see how easy it is to set up PG Back Web.

Use Cases

PG Back Web is perfect for:

  • Development teams: Centralized backup management for multiple databases
  • DevOps engineers: Automated backup scheduling with monitoring and notifications
  • Small businesses: Simple, reliable database backups without complex infrastructure
  • Multi-database environments: Manage backups for PostgreSQL and ClickHouse from one interface
  • Compliance requirements: Track all backup executions with detailed logs and history
  • Disaster recovery: Quick restore capabilities with version-aware restoration

Architecture

PG Back Web is built with a modular, extensible architecture:

  • Service layer: Clean separation of concerns with domain-specific services (backups, databases, destinations, executions, restorations, webhooks, users, auth)
  • Database integration: Pluggable database clients supporting multiple database types (PostgreSQL, ClickHouse)
  • Storage abstraction: Unified storage interface supporting local filesystem and S3-compatible storage
  • Code generation: SQLC-based query generation for type-safe database operations
  • Migration-first: Database schema managed with Goose migrations
  • Cron scheduling: Built-in cron scheduler for automated backup execution
  • Web framework: Echo-based web framework with Alpine.js for interactive UI

Configuration

You only need to configure the following environment variables:

  • PBW_ENCRYPTION_KEY: Your encryption key. Generate a strong random one and store it in a safe place, as PG Back Web uses it to encrypt sensitive data.

  • PBW_POSTGRES_CONN_STRING: The connection string for the PostgreSQL database that will store PG Back Web data.

  • PBW_LISTEN_HOST: Optional. Host for the server to listen on, default 0.0.0.0

  • PBW_LISTEN_PORT: Optional. Port for the server to listen on, default 8085

  • PBW_PATH_PREFIX: Optional. Path prefix for the application URL. Use this when you want to serve the application under a subpath (e.g., /pgbackweb). Must start with / and not end with /. Default is empty.

  • TZ: Optional. Your timezone. Default is UTC. This impacts logging, backup filenames and default timezone in the web interface.

Screenshot

Key Features Explained

Backup Management

  • Scheduled backups: Configure backups with cron expressions for flexible scheduling (e.g., daily at 2 AM, weekly on Sundays)
  • Manual backups: Trigger backups on-demand from the web interface
  • Backup duplication: Clone existing backup configurations to quickly create similar backups
  • Backup activation: Enable/disable backups without deleting them
  • Execution history: View all backup executions with status, timestamps, file sizes, and download links

Restoration

  • One-click restore: Restore any backup to any configured database with a single click
  • Version-aware: Automatically detects and uses the correct database version for restoration
  • Local and remote: Restore from both local storage and S3-compatible storage
  • Restoration tracking: Monitor restoration progress and view restoration history

Webhooks

Configure webhooks to receive notifications for various events:

  • Database health events: Get notified when databases become healthy or unhealthy
  • Destination health events: Monitor storage destination availability
  • Execution events: Receive notifications for successful or failed backup executions
  • Custom configuration: Configure webhook URLs, HTTP methods (GET/POST), custom headers, and request bodies
  • Execution history: View all webhook execution attempts with response details

Health Checks

  • Automatic monitoring: Regular health checks for all configured databases and destinations
  • Status tracking: Visual indicators for healthy/unhealthy status
  • Test on demand: Manually test database and destination connections
  • Bulk testing: Test all databases or destinations at once

Reset password

You can reset your PG Back Web password by running the following command in the server where PG Back Web is running:

docker exec -it <container_name_or_id> sh -c change-password

You should replace <container_name_or_id> with the name or ID of the PG Back Web container, then just follow the instructions.

Next steps

In this link you can see a list of features that have been confirmed for future updates:

Next steps ⏭️

Sponsors

πŸ™ Thank you to the incredible sponsors for supporting this project! Your contributions help keep PG Back Web running and growing. If you'd like to join and become a sponsor, please visit the sponsorship page and be part of something great! πŸš€

πŸ₯‡ Gold Sponsors

Become a gold sponsor
Become a gold sponsor

πŸ₯ˆ Silver Sponsors

FetchGoat - Simplifying Logistics
FetchGoat - Simplifying Logistics
Become a silver sponsor
Become a silver sponsor

πŸ₯‰ Bronze Sponsors

Become a bronze sponsor
Become a bronze sponsor

Join the Community

Got ideas to improve PG Back Web? Contribute to the project! Every suggestion and pull request is welcome.

License

This project is 100% open source and is licensed under the AGPL v3 License - see the LICENSE file for details.


πŸ’– Love PG Back Web? Give us a ⭐ on GitHub and share the project with your colleagues. Together, we can make PostgreSQL backups more accessible to everyone!

About

🐘 Effortless PostgreSQL backups with a user-friendly web interface! πŸŒπŸ’Ύ

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Go 92.1%
  • JavaScript 5.3%
  • Dockerfile 0.9%
  • Shell 0.9%
  • CSS 0.5%
  • TypeScript 0.2%
  • PLpgSQL 0.1%