Skip to main content

Installing Duplicati to Backup your Data

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

Install Docker-CE and Docker-Compose

Installation via a Simple Script

You can easily install Docker-CE, Docker-Compose, Portainer-CE, and NGinX Proxy manager by using this quick install script I created and maintain on Github.  Just use the command:

wget https://gitlab.com/bmcgonag/docker_installs/-/raw/main/install_docker_nproxyman.sh

To download the script to your desired host.

Change the permissions to make the script executable:

chmod +x ./install_docker_nproxyman.sh

and then run the script with the command:

./install_docker_nproxyman.sh

When run, the script will prompt you to select your host operating system, then will ask you which bits of software you want to install.

Simply enter 'y' for each thing you want to install.

At some point, you may be asked for your super user (sudo) password as well.

Allow the script to complete installation.

At this point, you might want to log out and back in, as this will allow you to use the docker and docker-compose commands without the need of sudo in front of them.

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.

Support my Channel and Content

Support my Channel and ongoing efforts through Patreon:
https://www.patreon.com/bePatron?u=234177