Duplicati

Duplicati is a really amazing backup solution for your local machine.  You can use Duplicati to backup locally, to storage on your own network, or to cloud hosted storage.  The front end runs in a browser window, so it essentially just runs in the background.  You setup your backup, schedule it, and forget about it.  Just let it do it's job!

Today we'll be installing Duplicati in Docker.  I'm using it to backup my Docker folder, but it can be mapped to the root level folder of your system, or to your home folder, or really in any way you see fit.  Then you can use the browser interface to setup the backup(s) you want.

What You'll Need

  • Docker-CE
  • Docker-Compose
  • A location to Backup to
  • About 20 Minutes

To install Docker-CE and Docker-Compose (along with Portainer-CE) I have a nifty littls script to help you do it quickly and easily. Check out this page for more.

Installation and Setup

Once you have Docker and Docker Compose installed, you'll want to create a folder inside your main organizational folder.  I use a folder called "docker" to keep all of my docker application folders, volume mappings, docker-compose.yml and docker-run.txt files in.  This way, I just backup the "docker" folder, and all of my docker compose, docker run commands, volume data, and various application configs are backed up with it.  I highly recommend you do something similar.

So inside the "docker" folder, we'll create  a new directory called "duplicati":

mkdir duplicati

Now we move into that directory:

cd duplicati

and we'll create a new file called "docker-compose.yml" inside this directory.

nano docker-compose.yml

You'll want to paste the following block of yaml text into that new file, and then we'll go through the spots where you'll need to make adjustments for your server.

version: "2.1"
services:
  duplicati:
    image: lscr.io/linuxserver/duplicati
    container_name: duplicati
    environment:
      - PUID=0
      - PGID=0
      - TZ=<your/timezone>
    volumes:
      - /mnt/filesync/duplicati/config:/config
      - /mnt/filesync/duplicati/backups:/backups
      - /home/brian/:/source
    ports:
      - 8270:8200
    restart: unless-stopped

In the file above, I have several comments.  You'll want to be sure and adjust the following items for your system:

  • PGID - might be good to give this the root user's ID, 0, so there are no permissions issues during backup.
  • PUID - might be good to give this the root group ID, 0, so there are no permissions issues during backup.
  • TZ (time zone) - You'll want to make this your Time Zone. Mine is America/Chicago
  • /mnt/filesync/duplicati/config:/config - use this mapping to map or create, then map a location for your backup config. Make sure this location exists before making the mapping.  Only change the left side of the colon ":".
  • /mnt/filesync/duplicati/backups:/backups - use this mapping to map or create, then map a location for your backup storage. Only change the left side of the colon ":".
  • /<your root level folder to choose backup locations from>:/source - this is the mapping of the root level.  Only change the left side of the colon ":".
  • 8270:8200 - feel free to change the left side of the colon ":" to any open port on your host machine.

Once you've made all of the necessary changes, you'll want to save the file with CTRL + O, then Enter to confirm.  Use CTRL + X to exit the nano editor.

Now run the command:

docker-compose up -d

To pull down the Duplicati image, and start it running.

Once it shows "done" in the terminal for each piece, you'll want to go to your web browser and enter the IP of your host machine, and the port you set on the left side of the colon in the port mapping.

I went to

http://192.168.10.26:8270

Your IP will likely be different.

Once you get to the Duplicati web interface, you can start setting up your backups, and adjusting settings available through the Web User Interface.

Make sure to check out the video for more details on using the Web UI to setup ans schedule your backups.