Use Duplicati to Back Up Files on Debian, Ubuntu, Linux Mint

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, Storadera, BlackBlaze, Telegram Cloud, Rclone, Tencent Cloud Object Storage, Tardigrade, 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-backup-ubuntu-linux

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

wget https://updates.duplicati.com/beta/duplicati_2.0.5.1-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-20.04

If your context menu doesn’t provide this option, you can install this .deb file from the 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.5.1-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-ubuntu

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

Hint: If the above command doesn’t quit immediately, you can press the 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 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 computer has multiple accounts or a single account.

start duplicati server

Then click the Add backup button 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 to keep all backups. If your Dropbox doesn’t have enough space, you probably want to delete backups that are older than 30 days. 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 can 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

Troubleshooting Tips

If you can’t save your settings in the Duplicati web interface, you can check the web server log (/var/log/apache2/duplicati_error.log or /var/log/nginx/duplicati_error.log).

Backing Up the Entire Disk

Duplicati is designed to back up individual files and directories. If you want to back up the entire disk, you can use Clonezilla.

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: 7 Average: 5]

9 Responses to “Use Duplicati to Back Up Files on Debian, Ubuntu, Linux Mint

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

  • Owe Bernt Robertsen
    6 months ago

    # /etc/default/duplicati
    # Access web GUI also from any host external – not just localhost:8200
    DAEMON_OPTS=”–webservice-interface=any –webservice-port=8200 –webservice-allowed-hostnames=*”

  • Hi,
    Duplicati informs me of an update. Do you recommend installing it ?
    Thanx

  • Ken Wright
    3 months ago

    I’m following your instructions, but when I try to connect to Dropbox I get an error message saying Internal Server Error. Any suggestions?

    • Are you running Duplicati behind Apache or Nginx reverse proxy? If so, you can check the error log.
      Apache: /var/log/apache2/duplicati_error.log
      Nginx: /var/log/nginx/duplicati_error.log

  • Thanks for another great article! I ran into a roadblock trying to access Duplicati on my headless Ubuntu Server 20.04 where I couldn’t access the webUI via http://:8200 as I’m not running a reverse proxy server. Even an SSH tunnel doesn’t make this accessible.

    After digging around a I found a solution in one of the posts here: https://forum.duplicati.com/t/new-headless-install-duplicati-2-0-2-21-1-how-to-access-in-remote-web-browser/2898/12

    Basically, you edit /etc/systemd/system/multi-user.target.wants/duplicati.service and change the below line:

    ExecStart=/usr/bin/duplicati-server $DAEMON_OPTS

    To:

    ExecStart=/usr/bin/duplicati-server --webservice-interface=any $DAEMON_OPTS

    After that, just reload and restart the units by:

    sudo systemctl daemon-reload
    sudo systemctl restart duplicati

    .. And Duplicati webUI should be accessible via http://:8200. Posting this here so it helps someone in need.

  • Hideg Istvan
    1 week ago

    First of all, thank You for this very helpful article. I successfuly installed duplicati on my homeserver (Debian10) and it works as intended.
    When trying to restore files however I receive an error message “internal server error”. I googled the issue and found in a forum that a single line needs to be attached to the .conf file, namely “AllowEncodedSlashes On” and the problem solved immediately.
    Please consider adjusting your article (regarding the .conf file part) with this information.
    Best wishes and friendly regards, Istvan

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.

The maximum upload file size: 2 MB. You can upload: image. Links to YouTube, Facebook, Twitter and other services inserted in the comment text will be automatically embedded.