1 Headless installation on Debian or Ubuntu
ElRico edited this page 2017-10-15 10:43:11 +02:00

Introduction

The .deb file on the download page depends on a whole raft of packages for graphical user interfaces, due to the inclusion of the Duplicati tray icon. On a headless system, these packes introduce unnecessary bloat. There are two open issues which request a .deb file with minimal dependencies for this use case, but in the meantime you can find instructions for a workaround below on this page.

Installation instructions

Install dependencies

  • aptitude install unzip mono-devel

Setup directories and grab a copy of Duplicati

If you want to use LVM, additionally run the following:

  • chmod u+x /usr/lib/duplicati/lvm-scripts/*.sh

Set up command line tools

  • Add the following as /usr/bin/duplicati-cli
#!/bin/bash
INSTALLDIR=/usr/lib/duplicati
export LD_LIBRARY_PATH="${INSTALLDIR}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
export MONO_PATH=$MONO_PATH:${INSTALLDIR}
 
EXE_FILE=${INSTALLDIR}/Duplicati.CommandLine.exe
APP_NAME=Duplicati.CommandLine
 
exec -a "$APP_NAME" mono "$EXE_FILE" "$@"
  • Add the following as /usr/bin/duplicati-server
#!/bin/bash
INSTALLDIR=/usr/lib/duplicati
export LD_LIBRARY_PATH="${INSTALLDIR}${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}"
export MONO_PATH=$MONO_PATH:${INSTALLDIR}
 
EXE_FILE=${INSTALLDIR}/Duplicati.Server.exe
APP_NAME=DuplicatiServer
 
exec -a "$APP_NAME" mono "$EXE_FILE" "$@"
  • chmod 755 /usr/bin/duplicati-cli
  • chmod 755 /usr/bin/duplicati-server

Set up config files

  • Add the following as /etc/default/duplicati
# Defaults for duplicati initscript
# sourced by /etc/init.d/duplicati
 
#
# This is a POSIX shell fragment
#
 
# Additional options that are passed to the Daemon.
DAEMON_OPTS="--webservice-port=8200 --webservice-interface=any"

The configuration given above will have Duplicati accept connections to the webinterface from anywhere. If you want to run a more restrictive setup, edit the --webservice-interface setting accordingly.

Add Duplicati to systemd for automatic startup on system boot

You have two choices below, one for running Duplicati as root (which is required if you want to use LVM) and one for running as an unprivileged user for enhanced security.

systemd setup for root

  • Add the following as /etc/systemd/system/duplicati.service
[Unit]
Description=Duplicati web-server
After=network.target
 
[Service]
EnvironmentFile=-/etc/default/duplicati
ExecStart=/usr/bin/duplicati-server $DAEMON_OPTS
 
[Install]
WantedBy=multi-user.target
  • systemctl enable duplicati

systemd setup for non privileged users

  • Add the following as /etc/systemd/system/duplicati@.service
[Unit]
Description=Duplicati web-server
After=network.target

[Service]
User=%I
EnvironmentFile=-/etc/default/duplicati
ExecStart=/usr/bin/duplicati-server $DAEMON_OPTS

[Install]
WantedBy=multi-user.target
  • systemctl enable duplicati@user

Note: In the last command above, you should substitute user for the actual username you want to be running Duplicati as.