Acrosync’s Duplicacy is a powerful backup program that I’m using extensively on a variety of devices, including the Synology Diskstation in the docker container.

Docker on Synology however suffers from annoying issues, including but not limited to incorrect resource usage reporting and while the overhead of managing user IDs and configuration data is worthwhile for applications that benefit from dependencies isolation docker provides duplicacy does not require nor benefits from it: both Web UI and command-line engine are written in Golang and are self-contained executables.

Furthermore, some Synology devices do not run docker – and yet duplicacy would work just fine on them.


In this article I describe the simple script to download and install duplicacy_web as a service on a Synology Diskstation natively, without the aid of docker. It can be used as-is, or to be used as a starting point for your customizations and to illustrate various techniques.

Synology DSM 6.xx uses upstart to manage services. The script below downloads the specified duplicacy executable and configures it to run when the network and storage are up.


  1. Create the limited user duplicacy for the daemon to run under. Modify the script accordingly if a different username is desired.
  2. Give that user permissions to read the folders intended to be backed up.
  3. Enable Users Home service. Duplicacy configuration will be stored in the home folder of the user defined in step 1. It is trivial to modify the script to store data elsewhere if homes service is undesirable.
  4. Read through and run the script to install and start the daemon.

To upgrade or downgrade duplicacy version modify the DUPLICACY_WEB_VERSION environment variable in the beginning and run the script again.

Important notes

Listening address

By default, Duplicacy Web is listening on a loopback interface so that only local users can connect. It can be configured to listen on your LAN adapter instead but this is undesirable due to this issue.

The secure enough workaround, until that is fixed, is to keep it accessible on a loopback only and reach the UI via SSH port tunneling. By default port tunneling is disabled, so the script enables it and restarts sshd daemon at the very end.

To log in, you would start a tunnel in the background like so:

ssh -N -L 3875: [email protected] &

and then connect to http://localhost:3875.

However, if you want to avoid tunneling you can change the listening port. Place the code below right before “Launching service”: If the configuration file does not exist it will be created with the listening_address set to listen on all interfaces; otherwise the change will be edited into the existing file.


if [ ! -f ${CONFIGPATH}/settings.json ]; then

echo "Configuration file does not exist."
echo "Creating default one enabling listening on all interfaces"

mkdir -p ${CONFIGPATH}

cat > ${CONFIGPATH}/settings.json << EOF
    "listening_address"     : ""


echo "Setting listening_address to"
sed -i "s/\"listening_address\"\s*:\s*\".*\"/\"listening_address\" : \"0\.0\.0\.0:3875\"/g" ${CONFIGPATH}/settings.json


# Setting the correct owner to entire folder
chown -R ${USERNAME}:${GROUPNAME} ${CONFIGPATH} || exit 7

Memory consumption

Duplicacy can be fairly memory-hungry on large datasets. To mitigate this somewhat we set DUPLICACY_ATTRIBUTE_THRESHOLD=1 to prevent it from caching metadata in memory and we adjust oom tolerance for the service to reduce the chances for the child process to get killed.

ARM devices

I haven’t tested it on ARM devices due to a lack of access to hardware.


With DSM 7 Synology switched from upstart to systemd to manage services. See the comment section below where cntrl shared the proposed adaptation.

The script


# Duplicacy version. Modify and re-run the script when new version is released

# Username for the daemon to run on behalf of. Give this user permission to read stuff that needs to be backed up.

if [[ $(id -u) != 0 ]]; then
    sudo -p 'Restarting as root, password: ' bash $0 "[email protected]"
    exit $?

# Figuring out correct download suffix
MACHINE_ARCH=$(uname -m)

case ${MACHINE_ARCH} in
    echo Unknown or unsupported architecture ${MACHINE_ARCH}
    exit 2


echo "Using duplicacy_web version ${DUPLICACY_WEB_VERSION} arch ${ARCH}"
echo "Service ${SERVICENAME} will run as a user ${USERNAME}:${GROUPNAME}"

# Target application filename.

# Download URL

echo "Stopping the service ${SERVICENAME}"

# Check if specified user exists
if [[ 0 != $(id -u ${USERNAME} > /dev/null 2>&1; echo $?) ]] ; then
    echo "User ${USERNAME} does not exist. Create the user and enable user home service (Control Panel, User, Advanced)"
    exit 3

# Check if the user has a home folder
HOMEDIR="$(eval echo ~"${USERNAME}")"
if [ ! -d ${HOMEDIR} ] ; then
    echo "Home directory for the user ${USERNAME} does not exist. Make sure Homes service is running"
    exit 4

# If application executable hasn't been downloaded yet -- do it now

if [ ! -f ${APPFILEPATH} ]; then
    echo "Downloading executable from ${URL}"

    wget -O ${APPFILEPATH} ${URL}

    if [[ $? != 0 ]]; then
        echo "Download failed"
        rm -f ${APPFILEPATH}
        exit 5
    chmod +x ${APPFILEPATH}  || exit 6

# Write out upstart daemon configuration
echo "Creating upstart daemon ${SERVICENAME} in /etc/init"
cat > /etc/init/${SERVICENAME}.conf << EOF
description "${SERVICENAME} daemon"
author "Arrogant Rabbit"
start on and syno.share.ready
stop on runlevel [06]
setuid ${USERNAME}
setgid ${GROUPNAME}
respawn limit 5 10
oom score -999
console log

echo "Launching service ${SERVICENAME}"
start ${SERVICENAME} || exit 7

echo "Duplicacy has been installed and started successfully"
echo "By default duplicacy_web is listening on port 3875 on a loopback interface for security."
echo "To establish connection start TCP tunnel first: ssh -L 3875: $(hostname)"
echo "Then navigate to http://localhost:3875"

# Enable SSH TcpForwarding
sed -i "s/.*AllowTcpForwarding.*/AllowTcpForwarding yes/g" /etc/ssh/sshd_config
restart sshd


Mar 03, 2020 Initial publication
Dec 16, 2021 Clarified applicability of upstart configuration to DSM6 and refered to helpful comment below for DSM7 specifics