Duplicati Backups

Installing and Configuring Duplicati for Backups to Amazon S3

In this lesson, we will cover the steps to install and configure Duplicati for creating backups from a variety of sources: MariaDB on Debian, a website on Debian, a Windows File Server, Windows Desktops, and macOS Desktops. These backups will be stored in Amazon S3 for durability and scalability.

Prerequisites

  1. Amazon S3 Bucket with programmatic access (Access Key ID and Secret Access Key).
  2. Duplicati installed on all systems needing backup.
  3. Basic understanding of MariaDB, file structures, and system administration on Linux, Windows, and macOS.

1. Install Duplicati on Debian (MariaDB & Website)

Step 1: Install Duplicati

First, let’s install Duplicati on your Debian machine.

  1. Add the Duplicati repository:
   wget -O - https://updates.duplicati.com/beta/duplicati-signing.gpg | sudo apt-key add -
   echo "deb https://updates.duplicati.com/beta/ $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/duplicati.list
  1. Update package list and install Duplicati:
   sudo apt update
   sudo apt install duplicati
  1. Enable and start the Duplicati service:
   sudo systemctl enable duplicati
   sudo systemctl start duplicati

Duplicati’s web interface will now be available on http://localhost:8200.

Step 2: Configure Backup for MariaDB

  1. Dump the MariaDB Database before backup to ensure consistency: Create a script /opt/backup-mariadb.sh to dump the database:
   #!/bin/bash
   mysqldump --user=root --password=your_password --all-databases > /var/backups/mariadb_backup.sql

Make it executable:

   chmod +x /opt/backup-mariadb.sh
  1. Set up Duplicati:
  • Open Duplicati at http://localhost:8200.
  • Click “Add Backup” > Configure a new backup.
  • Choose “Local folder or cloud storage” > Select Amazon S3.
  • Enter your S3 Access Key, Secret, and bucket details.
  • For “Source Data,” choose the backup script output file /var/backups/mariadb_backup.sql.
  • Set a schedule for regular backups (e.g., daily at midnight).
  • Save the backup configuration.

Step 3: Configure Backup for the Website

  1. Your website files are likely in /var/www/html (or similar). You can add these to Duplicati:
  • Go back to Duplicati’s web interface.
  • Add another backup configuration, targeting the website files in /var/www/html.
  • Select Amazon S3 again as the destination.
  • Schedule as needed.

2. Install and Configure Duplicati on Windows File Server

Step 1: Install Duplicati

  1. Download Duplicati from the official website.
  2. Run the installer on your Windows file server.

Step 2: Configure Backup for File Server

  1. Open Duplicati from the Start menu and configure a new backup.
  2. Select the folders you wish to back up (e.g., shared folders on the file server).
  3. Choose Amazon S3 as the destination and input the Access Key ID, Secret, and S3 bucket name.
  4. Set your preferred backup schedule.

3. Install and Configure Duplicati on Windows Desktops

Step 1: Install Duplicati

  1. Follow the same installation steps as for the Windows file server.
  2. After installation, launch the Duplicati web interface.

Step 2: Configure Backup for Desktop Files

  1. Open Duplicati and create a new backup for important folders (e.g., Documents, Desktop).
  2. As with previous setups, choose Amazon S3 as the destination.
  3. Set your preferred backup schedule and save the configuration.

4. Install and Configure Duplicati on macOS Desktops

Step 1: Install Duplicati

  1. Download the macOS version of Duplicati from the official website.
  2. Open the .dmg file and install Duplicati.

Step 2: Configure Backup for macOS Files

  1. Open Duplicati and configure the backup of important directories (e.g., /Users/your_user/Documents).
  2. As in the other cases, choose Amazon S3 as the destination and enter the appropriate credentials.
  3. Set a schedule for the backups.

5. Verifying and Monitoring Backups

Once the backups are configured:

  1. Test the Backups:
  • For each backup configuration, manually run the backup once to ensure it works properly and data is successfully uploaded to Amazon S3.
  1. Monitor via Duplicati’s Web Interface:
  • You can view backup statuses, logs, and errors from Duplicati’s web UI.
  1. Automate Monitoring with Email Notifications:
  • Go to Settings in Duplicati, and set up email notifications for failed backups.
  1. Regular Maintenance:
  • Ensure that you periodically verify backups by restoring data to ensure integrity.

6. Best Practices

  1. Encryption: Always enable Duplicati’s encryption for data being sent to Amazon S3 to ensure data security.
  2. Retention Policies: Configure Duplicati to manage your backup retention, automatically deleting old backups to reduce storage costs.
  3. Backup Testing: Periodically perform test restores to ensure your backups are working as expected.

Conclusion

With Duplicati configured, you now have a robust system to back up your MariaDB databases, websites, Windows file servers, Windows desktops, and macOS desktops to Amazon S3. By automating backups and using cloud storage, you ensure that your critical data is securely stored and easily recoverable in case of failure.

Other Recent Posts