SnapShooter Learning Center

Install and Use Duplicati to Back Up Files on Ubuntu 20.04

Install and Use Duplicati to Back Up Files on Ubuntu 20.04

Simon Bennett]
Simon Bennett
Last Updated: Sep 28, 2021
Table of Contents

# Introduction

Duplicati is a free, open-source, and powerful utility for Linux and Windows operating systems. It comes with a web-based user interface that allows you to create and restore a backup from the web browser. It supports FTP, SSH, WebDAV, and also supports cloud storage providers like Microsoft OneDrive, Amazon Cloud Drive, Google Drive, Dropbox, and more.

Features

  • Supports incremental backup and compression.
  • Supports local backup including, USB, Samba shared folder, and NAS.
  • Provides both GUI and Command-line interface.
  • Can detect and notify broken backups.
  • Provides backup scheduler and auto-updater.

In this guide, we will show you how to install and use Duplicati to backup and restore a file.


# Requirements

  • A server running Ubuntu operating system.
  • A root password is setup on your server.

# Install Duplicati

By default, Duplicati is not included in the Ubuntu default repository. So you will need to download it from the Duplicati official download page.

You can also download it from the command-line interface using the following command:

wget https://updates.duplicati.com/beta/duplicati_2.0.6.3-1_all.deb

Once the download is completed, you can install it using the following command:

apt install ./duplicati_2.0.6.3-1_all.deb

After the successful installation, you will also need to install the mono-complete package to prevent errors during backup operations.

apt install mono-complete -y

Next, start the Duplicati service and enable it to start at system reboot:

systemctl start duplicati
systemctl enable duplicati

You can also verify the status of the Duplicati using the following command:

systemctl status duplicati

Output:

โ— duplicati.service - Duplicati web-server
 Loaded: loaded (/lib/systemd/system/duplicati.service; disabled; vendor preset: enabled)
 Active: active (running) since Sat 2021-09-11 07:26:54 UTC; 6s ago
 Main PID: 8158 (mono)
  Tasks: 16 (limit: 2353)
 Memory: 34.9M
 CGroup: /system.slice/duplicati.service
         โ”œโ”€8158 DuplicatiServer /usr/lib/duplicati/Duplicati.Server.exe
         โ””โ”€8173 /usr/bin/mono-sgen /usr/lib/duplicati/Duplicati.Server.exe
 Sep 11 07:26:54 duplicati systemd[1]: Started Duplicati web-server.

By default, Duplicati listens on localhost on port 8200. You can check it using the following command:

ss -antpl | grep 8200

Output:

LISTEN    0         50               127.0.0.1:8200             0.0.0.0:*        users:(("mono-sgen",pid=8173,fd=9)) 

# Configure Nginx as a Reverse Proxy for Duplicati

By default, Duplicati can be accessed only from the localhost. So you will need to install and configure Nginx as a reverse proxy to access the Duplicati from the remote location.

First, install the Nginx server with the following command:

apt install nginx -y

Once the Nginx is installed, create an Nginx virtual host configuration file for Duplicati:

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

Add the following lines:

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 the file then verify the Nginx configuration file using the following command:

nginx -t

Sample output:

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

Finally, reload the Nginx service to apply the changes.

systemctl reload nginx

# Access Duplicati Web UI

Now, open your web browser and access the Duplicati web interface using the URL http://duplicati.example.com. You will be redirected to the following page:

Duplicati set password

Click on the Yes button to set a password to the Web interface. You should see the following page.

Duplicati define password

Provide your password and click on the OK button to set the password. You will be redirected to the Duplicati login page:

Duplicati login page

Provide your password and click on the Sign in button. You should see the Duplicati web interface:

Duplicati dashboard


# Create a Backup Using Duplicati

In this section, we will create a backup of /etc directory and store it on Dropbox.

On the Duplicati Dashboard, click on the Add backup in the left pane. You should see the following page:

Duplicati create a new backup

Select "Configure a new backup" and click on the Next button. You should see the following page:

Duplicati define your backup

Here, define your backup name, description, encryption type, password and click on the Next button. You should see the following page:

Duplicati define storage provider

Select Dropbox for storage, define the path on the server and click the AuthID link to get Dropbox auth id and grant Duplicati permissions to send the data to your Dropbox account. Then, click on the Next button. You should see the following page:

Duplicati define backup directory

Select the directory path that you want to make a backup of and click on the Next button. You should see the following page:

Duplicati schedule backup

Here, you can set the schedule for the backup and click on the Next button. You should see the following page:

Duplicati define volume size

Set the volume size, backup retention, and click on the Save button. You should see the following page:

Duplicati backup created


# Run Your First Backup

Now, click on the Run now button to run your first backup. Once the backup has been completed, you should see the following page:

Duplicati run a backup

Click on the data-backup. You should see the following page:

Duplicati backup information

From here, you can export the configuration so that you can easily restore the backup on another Duplicati instance.


# Restore a Backup Using Duplicati

Duplicati allows you to restore a backup to the same computer or on another computer running Duplicati.

Here, we will restore a backup on the same computer where Duplicati is installed.

On the Duplicati dashboard, click on the Restore button. You should see your last backup in the following page:

Duplicati restore a backup

Select your backup and click on the Next button. You should see the following page:

Duplicati highlight all files

Click on the Continue button. You will be asked to select the location where you want to restore a backup as shown below:

Duplicati define restore location

Select the Original location, Overwrite and click on the Restore button. Once the backup is restored successfully, you should see the following page:

Duplicati restore success


# Conclusion

In this post, we explained how to install and use Duplicati to backup and restore files on Ubuntu 20.04. You can now use Duplicati in the production environment to backup your data to a local drive, Dropbox, or other cloud storage providers.


Did you find this article helpful?