Server Backups with Duplicati
Duplicati is an easy way to back up any of your servers and even Desktops.
I’ll be using the linuxserver version of duplicati.
Linuxserver is a cool collection of community maintained images.
Read more on DockerHub, GitHub, Linuxserver.
1. Setting it up
You need Traefik set up!
Create a new subdomain and point it to your server.
Alright, as always we’ll need to create a new directory and cd into it.
mkdir duplicati && cd duplicati
Then create a docker-compose.yml
nano docker-compose.yml
Remember to replace your-domain.com with your domain and replace the Timezone (TZ) as well.
version: "2.1" services: duplicati: image: ghcr.io/linuxserver/duplicati container_name: duplicati environment: - PUID=0 - PGID=0 - TZ=Europe/Berlin volumes: - ./config:/config - /home/duplicati_backups:/backups - ./source:/source networks: - web restart: always labels: - "traefik.enable=true" - "traefik.http.routers.duplicati-web.rule=Host(`duplicati.your-domain.com`)" - "traefik.http.routers.duplicati-web.entrypoints=web" - "traefik.http.routers.duplicati-web.middlewares=bitwarden-https-redirect" - "traefik.http.routers.duplicati-web.middlewares=redirect@file" - "traefik.http.routers.duplicati-secured.rule=Host(`duplicati.your-domain.com`)" - "traefik.http.routers.duplicati-secured.tls=true" - "traefik.http.routers.duplicati-secured.tls.certresolver=web" - "traefik.http.routers.duplicati-secured.entrypoints=web-secured" - "traefik.http.routers.duplicati-secured.tls.certresolver=mytlschallenge" networks: web: external: true
2. How to Use
Now visit the domain you provided (duplicati.your-domain.com) or the IP you provided.
Your Home should look something like this.
At first, we’ll set up a password, by going to Settings and confirming our password.
Next, configure a new backup, by going to add Backup.
Now go through the steps.
Name is the name of your Backup. Passphrase is the password it’ll ask for to access the Backup, if you want to restore it.
Choose your Destination folder, to access root folders, you’ll need to give the username root and the password.
The Source Data is the folders you want to save as a Backup.
You can schedule your Backups. When should they run? How often a day/week/month?
In the Options, you can specify some things. For example, how many Backups to keep. I like to keep 10.
Then click Save and we’re done.