Use Duplicati to Backup Debian, Ubuntu, Linux Mint Desktop & Server

Duplicati is full-featured, open source backup software, which can run on Linux, MacOS, Windows and Synology. It allows you to back up local files and directories to the cloud (such as Amazon S3, Dropbox, Google Drive, OneDrive, etc) in encrypted form and schedule automated backups. This tutorial is going to show you how to install and use Duplicati on Debian, Ubuntu and Linux Mint.

You can also apply this tutorial on Linux distros that are based on Debian/Ubuntu, such as MX Linux, Linux Lite, Elementary OS, etc.

Duplicati Features

  • Free and open source (licensed in GPL)
  • Cross-platform: runs on Linux, MacOS, Windows and Synology.
  • Can compress and encrypt the backup.
  • Save space with incremental backup.
  • Supports multiple cloud storage services such as Dropbox, Google Drive, OneDrive, box.com, Mega, Amazon S3, BlackBlaze, Rclone and the Sia decentralized storage network.
  • Works with SSH/SFTP, WebDAV, FTP.
  • Supports local backup such as external USB devices, NAS (network attached storage) and Samba shared folder.
  • Duplicati uses standard components such as rdiff, zip, AESCrypt and GnuPG. This allows users to recover backup files even if Duplicati is not available.
  • Duplicati has both a graphical user interface and a command line interface, so you can use it on both desktops and servers.
  • Built-in backup scheduler and auto-updater.
  • Interrupted backups can be resumed.
  • It can detect broken backups.
  • The responsive web interface allows you to access Duplicati from anywhere, including a mobile phone.

Duplicati is a C# re-implementation of the Duplicity backup software.

How to Install Duplicati on Debian, Ubuntu, Linux Mint Desktop or Server

Duplicati isn’t included in the software repository, so we need to go the Duplicati official website and download the .deb file. Although v2.0 is still in beta, it is safe and reliable to use since 2017.

duplicati ubuntu

If you use a headless server, use following command to download Duplicati in the terminal.

wget https://github.com/duplicati/duplicati/releases/download/v2.0.4.23-2.0.4.23_beta_2019-07-14/duplicati_2.0.4.23-1_all.deb

Once downloaded, open file manager and go to the download destination directory. To install this software, simply right click on the .deb file and select Open With Software Install from the context menu.

install duplicati on ubuntu

It your context menu doesn’t provide this option, you can install this .deb file from command line. Open a terminal window and go to the download destination directory. For example, I downloaded the file in the Downloads folder under my home directory, so I run the following command. The tilde (~) represents the home directory.

cd ~/Downloads/

Then use the APT package manager to install it like below. The ./ represents the current directory.

sudo apt install ./duplicati_2.0.4.23-1_all.deb

Hint: Here’s a trick I’d like to show to Linux beginners. After you type in sudo apt install ./duplicati, you can press the Tab key. Linux will automatically complete the file name for you.

duplicati server

Duplicati is written mostly in C#, so APT package manager will automatically install Mono, which is a .NET compliant framework, in order to run Duplicati on Linux.

Duplicati is installed as a service, meaning it runs in the background. However, duplicati won’t automatically start after installation. You can start it by issuing the following command in terminal.

sudo systemctl start duplicati

Run the following command to enable auto-start at boot time.

sudo systemctl enable duplicati

Now you can check its status with:

systemctl status duplicati

duplicati ubuntu headless

Hint: If the above command doesn’t quit immediately, you can press Q key to gain back control of the terminal.

How to Use Duplicati

After duplicati is started, it listens on port 8200 of the localhost interface, so you can access the Duplicati web interface by typing in 127.0.0.1:8200 in the web browser address bar. (If you use a remote headless server, please see how to set up Apache/Nginx reverse proxy and enable HTTPS at the end of this article.)

First, choose whether your machines has multiple accounts or single account.

start duplicati server

The click the Add backup to create your first backup and choose how to add the backup. If you have not used Duplicati before, you will want to choose the default option: Configure a new backup.

duplicati configure a new backup

On the next page, give the backup a name. You can use any name you like, such the folder name plus the backup date. It’s recommended to enable encryption if you are going to send the backup to a cloud storage provider. You can use the default encryption method: AES-256. Click the Generate button to create a strong passphrase, which is used to encrypt the backup. You also need to use this passphrase when you want to decrypt the backup.

duplicati AES 256 encryption

So it’s very important that you store this passphrase in a safe place, such as in a password manager. If you lose this passphrase, there is no way to restore backup.

The next step is to choose where to store data. In this tutorial, I choose Dropbox. Then name the path in Dropbox that are going to store the data.

duplicati backup destination dropbox

Next, click the AuthID link. You will be taken to Dropbox’s website to grant permissions, so Duplicati can send the data to your Dropbox account.

duplicati dropbox Oauth

After you allow Duplicati to access your Dropbox account, the AuthID credential will be automatically put in the AuthID field in the Duplicati web interface. You can now click the Test connection button to make sure Duplicati can access the backup destination and create the folder.

In the next step, choose which folder on your computer to make a backup of. I choose to back up my home folder.

duplicati source data

You can exclude hidden files, system files and temporary files in the Exclude section, which is just what I need for my home folder.

duplicati exlude sub-directory filters

You can also click the Add filter link to exclude specific file or sub-folders. For example, I don’t want to have my VirtualBox machines backup to Dropbox, so I created a filter to exclude directories whose name contains “VirtualBox”.

duplicati exlude directories whose name contains

On the schedule page, you can set how frequent the backup runs. If you disable the scheduler, then you will meed to manually run the backup each time, which is not what I recommend. I just use the default settings. If you use Duplicati on a server, you probably want to run the backup when there’s less activity on the server.

duplicati schedule

If you use a desktop or laptop, then Duplicati will run the backup when you turn on your computer if it missed a scheduled backup. For servers that are always online, Duplicati runs the backup at scheduled time.

In the final step, you can leave the value of volume size to the default. Then you can choose the backup retention policy. I choose keeping all backups. Don’t forget to save your configurations.

duplicati volume size

Manually Run a Backup

You can wait for Duplicati to run the backup at the scheduled time, or click the “Run now” link and have the backup run immediately.

duplicati run backup

You can also export the configuration so you will be able to restore the backup on another Duplicati instance.

duplicati export configuration

How to Restore Backup

I also installed Duplicati on another computer and I will restore backup on my second computer. On the Duplicati main screen, click the Restore button on the left and choose Restore from configuration.

duplicati restore

On the next page, upload the configuration file and enter the passphrase. Click Import.

Restore from backup configuration

Next, it will show you the backup configuration. You can click the test connection button to see if it works.

duplicati restore backup

On the next page, you can see the encryption options. Click Next.

duplicati passphrase

If you see the “not found” error on the next page, don’t panic. You need to enter the folder path in the search field, then click the Search button and you will be able select the folder in the big rectangle. Click the Continue button.

duplicati restore files

Finally, configure the restore options. I chose to restore the files to the original location and prefer to overwrite existing files. Let me explains what this means.

  • Let’s say my second computer has two folders named /home/linuxbabe/film/ and /home/linuxbabe/videos/.
  • The backup only contains the /home/linuxbabe/videos/ folder.
  • If I there’s new video in the /home/linuxbabe/videos/ folder on my second computer, the restore process will delete that new video.
  • The /home/linuxbabe/film/ folder on my second computer will be intact.

duplicati restore options

Once you have configured the restore options, click the Restore button.

How to Set Up Apache/Nginx Reverse Proxy for Duplicati

If you install Duplicati on a remote headless server, you probably want to access the web interface from a domain name and enable HTTPS. We will set up a reverse proxy with Apache or Nginx web server.

Apache

If you prefer to use Apache web server, then install the apache2 package from software repository.

sudo apt install apache2

Start Apache and enable auto start.

sudo systemctl start apache2

sudo systemctl enable apache2

To use Apache as a reverse proxy, we need to enable the proxy modules and the header module.

sudo a2enmod proxy proxy_http headers proxy_wstunnel

Now create a virtual host file for Duplicati with a command line text editor such as Nano.

sudo nano /etc/apache2/sites-available/duplicati.conf

Copy and paste the following lines in to the file. Replace duplicati.example.com with your real domain name. You should also add a DNS A record for this sub-domain in your DNS manager.

<VirtualHost *:80>
   ServerName duplicati.example.com
   ErrorDocument 404 /404.html

   ProxyPass / http://127.0.0.1:8200/
   ProxyPassReverse / http://127.0.0.1:8200/

   ErrorLog ${APACHE_LOG_DIR}/duplicati_error.log
   CustomLog ${APACHE_LOG_DIR}/duplicati_access.log combined

</VirtualHost>

Save and close the file. Then enable this virtual host.

sudo a2ensite duplicati.conf

Restart Apache

sudo systemctl restart apache2

Now you can access the Web interface via duplicati.example.com. Before doing anything in the web interface, we should enable HTTPS.

Nginx

Nginx becomes more and more popular these days as a web server and reverse proxy. Install Nginx on Debian, Ubuntu or Linux Mint with the following command.

sudo apt install nginx

Start Nginx and enable auto start.

sudo systemctl start nginx

sudo systemctl enable nginx

Now create a virtual host file for Duplicati with a command line text editor such as Nano.

sudo nano /etc/nginx/conf.d/duplicati.conf

Copy and paste the following lines in to the file. Replace duplicati.example.com with your real domain name. You should also add a DNS A record for this sub-domain in your DNS manager.

server {
  listen 80;
  server_name duplicati.example.com;

  access_log /var/log/nginx/duplicati_access.log;
  error_log /var/log/nginx/duplicati_error.log;
  location / {
     proxy_pass http://127.0.0.1:8200;
     proxy_set_header X-Real-IP $remote_addr;
     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  }
}

Save and close this file. Then test Nginx configuations.

sudo nginx -t

If the test is successful, reload Nginx.

sudo systemctl reload nginx

Now in your browser’s address bar type in duplicati.example.com and you should be able to access the Duplicati web interface. Before doing anything in the web interface, we should enable HTTPS.

How to Enable HTTPS (For Headless Servers)

To encrypt the HTTP traffic when you visit Duplicati web interface via a domain name, we can enable HTTPS by installing a free TLS certificate issued from Let’s Encrypt. Run the following command to install Let’s Encrypt client (certbot) on Debian, Ubuntu or Linux Mint.

sudo apt install certbot

If you use Apache, you also need to install the Certbot Apache plugin.

sudo apt install python3-certbot-apache

And run this command to obtain and install TLS certificate.

sudo certbot --apache --agree-tos --redirect --hsts --staple-ocsp --email [email protected] -d duplicati.example.com

If you use Nginx, then install the Certbot Nginx plugin.

sudo apt install python3-certbot-nginx

Next, run the following command to obtain and install TLS certificate.

sudo certbot --nginx --agree-tos --redirect --hsts --staple-ocsp --email [email protected] -d duplicati.example.com

Where

  • --nginx: Use the nginx plugin.
  • --apache: Use the Apache plugin.
  • --agree-tos: Agree to terms of service.
  • --redirect: Force HTTPS by 301 redirect.
  • --hsts: Add the Strict-Transport-Security header to every HTTP response. Forcing browser to always use TLS for the domain. Defends against SSL/TLS Stripping.
  • --staple-ocsp: Enables OCSP Stapling. A valid OCSP response is stapled to the certificate that the server offers during TLS.

The certificate should now be obtained and automatically installed.

duplicati https

And you can access Duplicati Web interface via HTTPS (https://duplicati.example.com). You should immediately set a password for the web interface in the Settings menu.

duplicati web interface password authentication

 

Wrapping Up

I hope this tutorial helped you install and use Duplicati to back up your Debian, Ubuntu or Linux Mint system. As always, if you found this post useful, then subscribe to our free newsletter to get more tips and tricks. Take care 🙂

Rate this tutorial
[Total: 6 Average: 5]

4 Responses to “Use Duplicati to Backup Debian, Ubuntu, Linux Mint Desktop & Server

  • Hi,

    Thanks for your tutorial!
    I’m running Duplicati on my RPi-3 with attached USB-HDD to add daily-snapshot feature and redundancy to single-drive NAS which doesn’t have it. It works well for small amounts of data but for volumes >20GB it reports warning:

    ...
    ParsedResult: Warning
    Version: 2.0.4.5 (2.0.4.5_beta_2018-11-28)
    EndTime: 06/09/2019 09:23:13 (1567754593)
    BeginTime: 06/09/2019 09:15:00 (1567754100)
    Duration: 00:08:13.4882630
    Log data:
    2019-09-06 09:17:33 +02 - [Warning-Duplicati.Library.Main.Operation.FilelistProcessor-MissingRemoteHash]: remote file duplicati-i869aaffa333046d598a84a685c872452.dindex.zip is listed as Uploaded with size 0 but should be 120666, please verify the sha256 hash "DGwOrmg+uo6669Le8gAgPilZqKN1rPUHEkt1CiHmmzg="
    2019-09-06 09:23:10 +02 - [Warning-Duplicati.Library.Main.Operation.FilelistProcessor-MissingRemoteHash]: remote file duplicati-i869aaffa333046d598a84a685c872452.dindex.zip is listed as Uploaded with size 0 but should be 120666, please verify the sha256 hash "DGwOrmg+uo6669Le8gAgPilZqKN1rPUHEkt1CiHmmzg="

    Do you have similar experience?
    I’m holding also config files and Duplicati-temporary files on HDD, not to stress SD card – just as a hint to potential other users…

    Jiri

  • Thanks for this. I haven’t found a lot of instructions for installing duplicati on my headless server. This worked well and was super easy. I appreciate it.

  • Super tutorial, I love ‘hints’ in the article 😂😂

Leave a Comment

  • Comments with links are moderated by admin before published.
  • Your email address will not be published.
  • Use <pre> ... </pre> HTML tag to quote the output from your terminal/console.
  • Please use the community (https://community.linuxbabe.com) for questions unrelated to this article.
  • I don't have time to answer every question. Making a donation would incentivize me to spend more time answering questions.