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 before sending to cloud storage.
  • Save space with incremental backup and compression.
  • Allows you to easily restore files to a certain point in time, to the original folder or a different folder.
  • 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, iDrive 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://github.com/duplicati/duplicati/releases/download/v2.0.6.3-2.0.6.3_beta_2021-06-17/duplicati_2.0.6.3-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*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. I also recommend installing the mono-complete package to prevent errors during backup operations. mono-complete includes a complete Mono runtime, development tools and libraries for running C# programs on Linux.

sudo apt install mono-complete

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.

  • You might see the “Internal server error” message when testing the connection. In my experience, this doesn’t affect backing up files to Dropbox. You can ignore this error and proceed to the next step.
  • If you see the “Resources Not Exists” error, it’s probably because you have entered a wrong login credential for your cloud storage provider.

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

Set Up Email Notification

It’s very important that you set up email notifications so that if a scheduled backup fails, you will be notified and fix the errors. I once had a server with broken backups for over 6 months.

Go to Duplicati Settings -> Default Options. You can add advanced options here.

duplicati advanced options

Click the pick an option dropdown menu, set the following options.

  • Select send-mail-url: SMTP Url in the Send mail section. Enter smtp://127.0.0.1:25/?starttls=never as the mail URL.
  • Select send-mail-from: Email Sender in the Send mail section. Enter the sender address like [email protected].
  • Select send-mail-to: Email Recipient(s) in the Send mail section. Enter the recipient email address.
  • Select send-mail-level: The message to send in the Send mail section. Set the level to: Warning,Error,Fatal, so Duplicati will only send email notifications when something is wrong.

duplicati send email notifications

Click the Ok button to save the changes.

If Duplicati is installed on a mail server, then email notification will work without doing anything else. If Duplicati isn’t installed on a mail server, then you need to set up SMTP relay for this to work.

How to Fix Duplicati Backup Errors

Sometimes Backup can fail, and Duplicati will report the error like below.

Duplicati backup error repair

Click the Repair button and the error will be fixed. If there’s no Repair button, then you need to click the backup task dropdown menu and select Database in the Advanced section.

duplicati advaned database option

Next, click the Recreate button to recreate the local SQLite database.

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

Remove the default Nginx virtual host.

sudo rm /etc/nginx/sites-enabled/default

Restart Nginx.

sudo sysemctl restart 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 into 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

Backing Up PostgreSQL/MySQL/MariaDB Databases

You can use mysqldump and pg_dump to export databases to SQL files, then use Duplicati to automatically back up the SQL files to a remote cloud storage server.

Hint: If you run an email server with iRedMail, databases are automatically exported to SQL files by iRedMail in the /var/vmail/backup/ directory.

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

Can’t Save Settings?

duplicati failed to save forbbiden

If Duplicati can’t save your settings, it might be that you installed a web application firewall like ModSecurity on the server.

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.

Install the Latest Version of Mono on Ubuntu 18.04

Duplicati depends on the Mono runtime environment to function properly. The latest version of Duplicati requires Mono 5.1+. If you are using an old operating system like Ubuntu 18.04, you can install the latest stable version of Mono from the upstream repository.

sudo apt install gnupg ca-certificates

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF

echo "deb https://download.mono-project.com/repo/ubuntu stable-bionic main" | sudo tee /etc/apt/sources.list.d/mono-official-stable.list

sudo apt update

sudo apt upgrade

To check your Mono version, run

mono --version

If you see the following error when trying to run a backup,

Could not load file or assembly 'netstandard,

Then you need to install the mono-complete package.

sudo apt install mono-complete

Then restart Duplicati.

sudo systemctl restart duplicati

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

21 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
    4 years 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=*”

  • Antonio
    3 years ago

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

    • Xiao Guoan (Admin)
      3 years ago

      Install the update, then restart duplicati.

      sudo systemctl restart duplicati
  • Ken Wright
    3 years 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?

    • Xiao Guoan (Admin)
      3 years ago

      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

    • Xiao Guoan (Admin)
      3 years ago

      In my experience, this doesn’t affect backing up files to Dropbox. You can ignore this error and proceed to the next step.

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

    • Duplicanoob
      2 years ago

      Thank you very much!
      I have been struggling with this for a long time!

  • Hideg Istvan
    3 years 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

  • Ken Wright
    2 years ago

    I’ve forgotten my Duplicati password. Is there a way to reset it?

    • Xiao Guoan (Admin)
      2 years ago

      First, stop Duplicati.

      sudo systemctl stop duplicati

      Then start it with password disabled.

      sudo duplicati-server --webservice-password

      Next, go to Duplicati web interface to set a new password.

      After that, go back to the terminal and press Ctrl+C to stop the duplicati server. And start it with systemd.

      sudo systemctl start duplicati
  • I’ve installed Duplicati on my Pi3B+ running Buster (Linux 10). Installed as per your instructions, went flawlessly – thanks.

    I’m testing the system and want to be able to save the backups on my local network. I’m running the Duplicati GUI from Firefox on my Windows PC, working fine! I can now save them to a USB stick attached to the Duplicati Pi, but so far have not been able to save them to a share on another Pi or to my network available drive (attached and shared from my Netgear router).

    Experimenting with SFTP will be next….RDK

    • SFTP worked without issues.

      Using CIFS methods (https://tecadmin.net/mounting-samba-share-on-ubuntu/ ) I was able to mount both SAMBA shares and the NAS attached to my Netgear router. With those mounts I was able to save backups successfully.

      Happy camper….RDK

      • Xiao….I’m trying to use Dupliciti to backup the Vmail folder and its 4 domains on our email server. I’ve been using Dupliciti successfully to backup the email server SQL file/folders for several months. However, when I try to backup the Vmail folder I get warnings and zero content. I have zip files for the warnings text and Dupliciti configuration file for this operation, but can’t see how to include them….RDK

  • How do I configure Nginx reverse proxy under a sub-directory?

    • Xiao Guoan (Admin)
      1 year ago

      Add the following code snippet in your existing Nginx SSL server block.

        location ~/duplicati(.*)$ {
            proxy_pass http://127.0.0.1:8200$1;
            proxy_set_header Host $host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
        }
      

      The login URL is available at https://example.com/duplicati/login.html

    • Xiao….Here is a screen shot of the warnings…RDK

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. Drop file here