How to access the duplicacy web-interface remotely

By default, the #web-ui is only accessible locally, i.e. on from the same computer where duplicacy_web is running (http://127.0.0.1:3875/dashboard). If you are running duplicacy on a home server or NAS, you’ll probably also want to access it from other computers in your network. But as you will notice, accessing for example <server_ip>:3875/dashboard will give you a connection refused error.

To fix this, do this:

(In my case, I had to create the ~/.duplicacy-web/settings.json from scratch, i.e. a file just containing the above code.)

If you are wondering what the difference is between listening on 127.0.0.1 and listening on 0.0.0.0 is check out this. In a nutshell: 0.0.0.0 listens on all IP addresses of your computer, not just 127.0.0.1.

Please note that I’m not an export in server- or network administration and I assume that listening on all IP addresses may not be a good idea on a server exposed to the internet, so I recommend you only use this solution in your home network or if you know what you are doing. If the latter applies to you, please feel free to edit this post with further advice. (My guess is that the safe method for headless machines is to use "listening_address": "<server_ip>:8080")

Update: scroll down to this post for full instructions.

2 Likes

For web ui 0.2.1, it seems the default port is 3875. Does that mean the code that needs to be put into settings.json is:

{
"Listening_address": "0.0.0.0:3875"
}

?

1 Like

You don’t have to use the default - that’s part of the reason for being able to specify it in the optional settings.json file - use whatever you want, so long as it doesn’t clash with another service.

But yes, 3875 is the default.

2 Likes

On my qnap device the /root folder (~) is cleaned up at every restart.
Is there a command line option to store the settings file at another place?

See the discussion at /root/.bash_profile changes aren't saved after reboot - QNAP NAS Community Forum

I haven’t tried myself, but I think the solution is to modify the autorun.sh file to recover duplicacy.json and settings.json.

this crappy linux implementation from QNAP is always causing headache :frowning:
I guess I stick to the cli version

1 Like

I’ve been using Duplicacy command-line for a year or so on my headless server and have just switched to the Web GUI version. After installing Duplicacy as a service, I setup remote access over HTTPS using Nginx as a reverse proxy. In brief, here are the steps for Ubuntu Server 18.04.2 LTS.

Install Duplicacy

wget https://acrosync.com/duplicacy-web/duplicacy_web_linux_x64_1.0.0
sudo cp duplicacy_web_linux_x64_1.0.0 /usr/local/bin/
sudo chmod 700 /usr/local/bin/duplicacy_web_linux_x64_1.0.0
sudo ln -s /usr/local/bin/duplicacy_web_linux_x64_1.0.0 /usr/local/bin/duplicacy-web

Install as a service

sudo nano /etc/systemd/system/duplicacy.service

Paste the following:

[Unit]
Description=Duplicacy backup software`

[Service]
ExecStart=/usr/local/bin/duplicacy-web
Restart=on-failure
RestartSec=30

[Install]
WantedBy=multi-user.target

Enable and start the service

sudo systemctl enable duplicacy
sudo systemctl start duplicacy

Create settings file

mkdir ~/.duplicacy-web
nano ~/.duplicacy-web/settings.json

Paste the following:

{
    "listening_address": "127.0.0.1:3875"
} 

Setup proxy bypass (I have assumed Nginx is already installed)

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

Add the following to duplicacy.conf .

server {
  listen 80;
  server_name duplicacy.yourhost.name;

  access_log /var/log/nginx/duplicacy_access.log;
  error_log /var/log/nginx/duplicacy_error.log;
  location / {
     proxy_pass http://127.0.0.1:3875;
     proxy_set_header Host $host;
     proxy_set_header X-Real-IP $remote_addr;
     proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  }
}

sudo nginx -t
sudo systemctl reload nginx

Make sure you have relevant entries in /etc/hosts plus DNS entries.

Enable HTTPS using Let’s Encrypt

sudo certbot --nginx --agree-tos --redirect --hsts --staple-ocsp --email you@yourdomain.com -d duplicacy.yourhost.name

That’s it. Simply point your browser to https://duplicacy.yourhost.name to access Duplicacy.

6 Likes

Fantastic and straight forward instructions. Thanks

I noticed a typo “nano ~./duplicacy-web/settings.json” Should be: “nano ~/.duplicacy-web/settings.json”. (period in the wrong place)

Would there happen to be an Debian 10/Apache2 version.

Radjin~

2 Likes

Thanks, super helpful!

However, it doesn’t seem to use the settings.json file. How do you tell the binary where to pull the settings from? I’m trying to use listening_address as 0.0.0.0 so i don’t need a reverse proxy.

1 Like

Thanks. Unfortunately, I don’t have edit post available to me, so can’t amend original text. These instructions should work with Debian. I rarely use Apache, so you’ll need to translate the Nginx config for Apache. See Reverse Proxy Guide - Apache HTTP Server Version 2.4.

Note the previous post. There is an error in this line:

nano ~./duplicacy-web/settings.json

It should read …

nano ~/.duplicacy-web/settings.json

However, if you don’t want to use a reverse proxy you shouldn’t be following these instructions. Using 0.0.0.0:8080 listens on all IP addresses. Take at look at the following thread.

Yeah I created the settings.json but it didn’t seem to be using it. It worked when I just ran it directly on the command line but not as a service.

I actually ended up going with a docker container but I have to decide if i want to buy the license to use it once the trial ends or just stick with the CLI version and cron jobs.

I’d highly recommend you don’t run the web interface over the WAN. You could use a VPN solution like Zerotier which is really simple to configure and works really well on NAT environments.

A post was split to a new topic: Problems with the web-ui

Is this supposed to be my own home directory or in that of root?

That is this very same thread…

It is your home directory. However, you don’t need to edit that file now. Just go to the Setting page and change 127.0.0.1 in HTTP address to the real ip address of your computer.

1 Like

What I don’t understand, then, is: how duplicacy_web find it there?

Edit: I guess the answer is: it doesn’t. See here:

A post was split to a new topic: Help with remote access