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.

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.

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 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

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.

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.

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.

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.

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.

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.

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

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”.

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.

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.

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.

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

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.

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

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

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

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.

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.

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.


   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

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.

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.

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]