WALD (WAL-G + Docker) is a user-friendly command-line interface for managing PostgreSQL backups using WAL-G in Docker containers. It provides simple commands for backup, restore, and monitoring operations.
WALD is designed to work with PostgreSQL containers that have WAL-G pre-configured for automated backups to S3-compatible storage. It simplifies complex WAL-G operations into easy-to-use commands.
WALD = WAL-G + Docker - A management CLI for PostgreSQL backup operations in containerized environments.
- Simple Backup & Restore - One-command backup and restore operations
- Status Monitoring - Real-time backup system status and health checks
- Log Management - Easy access to backup, archive, and recovery logs
- Backup Verification - Validate backup integrity and S3 connectivity
- Automated Cleanup - Manage backup retention policies
- Docker Native - Designed specifically for containerized PostgreSQL + WAL-G setups
WALD works with Docker containers running the WALD Image - a specialized PostgreSQL container with:
- PostgreSQL 16.x
- WAL-G backup tool
- Automated backup scheduling
- S3-compatible storage integration
- Recovery automation
- Ubuntu 20.04+
- Docker and Docker Compose
- S3-compatible storage (AWS S3, MinIO, etc.)
- WALD PostgreSQL Image (PostgreSQL + WAL-G container)
curl -fsSL https://raw.githubusercontent.com/lafayettegabe/wald-cli/main/install.sh | sudo bash
wget https://github.com/lafayettegabe/wald-cli/archive/main.zip
unzip main.zip
cd wald-cli-main
sudo ./install.sh
wald --version
wald config
This will prompt you to:
- Set your PostgreSQL container name
- Configure encryption key (optional)
Create a docker-compose.yml
for your PostgreSQL + WAL-G container:
version: '3.8'
services:
db:
image: lafayettegabe/wald:latest
container_name: db
environment:
POSTGRES_DB: myapp
POSTGRES_USER: postgres
POSTGRES_PASSWORD: secure_password
AWS_ACCESS_KEY_ID: your_access_key
AWS_SECRET_ACCESS_KEY: your_secret_key
AWS_REGION: us-east-1
WALG_S3_PREFIX: s3://your-bucket/backups/myapp
WALG_LIBSODIUM_KEY: your_hex_encryption_key
WALG_RETENTION_DAYS: 30
volumes:
- postgres_data:/var/lib/postgresql/data
- backup_logs:/var/log/wal-g
ports:
- "5432:5432"
restart: unless-stopped
volumes:
postgres_data:
backup_logs:
docker-compose up -d
wald config
wald list
wald backup
wald restore
wald status
wald logs
wald verify
wald cleanup
Interactive configuration for container name and encryption settings.
Shows all available backups with timestamps and details.
Creates an immediate backup and shows progress.
Interactive restore process with safety confirmations.
Comprehensive system status including container status, PostgreSQL health, archive mode, backup count, and latest backup info.
Access different log types:
- Archive logs (WAL archiving)
- Backup logs (automated backups)
- Container logs
- Recovery logs (WAL restore)
- All WAL-G logs
Health check for the entire backup system including S3 connectivity, backup availability, PostgreSQL status, and WAL-G configuration.
Always use encryption for production backups:
openssl rand -hex 32
- Store S3 credentials securely
- Use IAM roles when possible
- Restrict S3 bucket access
- Regular key rotation
The WALD image includes automatic backup scheduling:
- Incremental backups: Every 2 hours
- Full backups: Daily at 4 AM UTC
- Cleanup: Daily at 5 AM UTC
- Retention: 30 days (configurable)
Monitor automated backups:
wald logs
Container not found:
wald config
docker ps
Backup failures:
wald verify
wald logs
Restore issues:
wald logs
docker logs -f your_container_name
S3 connectivity:
docker exec your_container_name envdir /etc/wal-g/env /usr/local/bin/wal-g backup-list
Inside the container:
- Archive logs:
/var/log/wal-g/archive.log
- Backup logs:
/var/log/wal-g/backup-cron.log
- Recovery logs:
/var/log/wal-g/restore-wal.log
- Cleanup logs:
/var/log/wal-g/cleanup-cron.log
POSTGRES_DB: myapp
POSTGRES_USER: postgres
POSTGRES_PASSWORD: secure_password
AWS_ACCESS_KEY_ID: your_access_key
AWS_SECRET_ACCESS_KEY: your_secret_key
AWS_REGION: us-east-1
AWS_ENDPOINT: https://s3.amazonaws.com
WALG_S3_PREFIX: s3://bucket/path/
WALG_LIBSODIUM_KEY: hex_encryption_key
WALG_COMPRESSION_METHOD: lz4
WALG_RETENTION_DAYS: 30
WALG_DELTA_MAX_STEPS: 6
WALG_UPLOAD_CONCURRENCY: 16
WALG_DOWNLOAD_CONCURRENCY: 10
WALG_NOTIFICATION_EMAIL: admin@example.com
docker exec db_container /scripts/backup-cron.sh incremental
0 */6 * * * /usr/local/bin/wald backup >/dev/null 2>&1
wald <command> [options]
Command | Aliases | Description |
---|---|---|
config |
- | Configure container and settings |
list |
l |
List all available backups |
backup |
b |
Create manual backup |
restore |
- | Restore from backup |
status |
- | Show system status |
logs |
- | View various log files |
cleanup |
- | Run manual cleanup |
verify |
- | Verify system health |
help |
-h , --help |
Show help information |
version |
--version |
Show version |
We welcome contributions! Please see our Contributing Guide for details.
This project is licensed under the MIT License - see the LICENSE file for details.
- Issues: GitHub Issues
- Documentation: Wiki
- Discussions: GitHub Discussions
- v1.0.0 - Initial release with core backup/restore functionality
WALD CLI - Making PostgreSQL backup management simple and reliable in Docker environments.