Deluge

Base Deluge Setup

Install Deluge:

sudo apt install deluged deluge-web

Create a service specific user:

sudo adduser --system --gecos "Deluge Service" --disabled-password --group --home /var/lib/deluge deluge

usermod -u 2114 deluge

groupmod -g 2122 deluge

chown -R deluge:deluge /var/lib/deluge

Create a log directory for Deluge and give the service user (e.g. deluge), full access:

sudo mkdir -p /var/log/deluge

sudo chown -R deluge:deluge /var/log/deluge

sudo chmod -R 750 /var/log/deluge

Create the file /etc/systemd/system/deluged.service containing the following:

[Unit]

Description=Deluge Bittorrent Client Daemon

Documentation=man:deluged

#After=network-online.target

After=network.target


[Service]

#Type=simple

User=deluge

Group=deluge

UMask=007


ExecStart=/usr/bin/deluged -d -l /var/log/deluge/daemon.log -L warning


Restart=on-failure


# Time to wait before forcefully stopped.

TimeoutStopSec=300


[Install]

WantedBy=multi-user.target

Now enable it to start up on boot, start the service and verify it is running:

sudo systemctl daemon-reload

sudo systemctl enable /etc/systemd/system/deluged.service

sudo systemctl start deluged

sudo systemctl status deluged

Create the file /etc/systemd/system/deluge-web.service containing the following:

[Unit]

Description=Deluge Bittorrent Client Web Interface

Documentation=man:deluge-web

After=deluged.service

Wants=deluged.service


[Service]

#Type=simple

User=deluge

Group=deluge

UMask=027


ExecStart=/usr/bin/deluge-web -d -l /var/log/deluge/web.log -L warning


Restart=on-failure


[Install]

WantedBy=multi-user.target

Now enable it to start up on boot, start the service and verify it is running:

sudo systemctl daemon-reload

sudo systemctl enable /etc/systemd/system/deluge-web.service

sudo systemctl start deluge-web

sudo systemctl status deluge-web


https://deluge.readthedocs.io/en/latest/how-to/systemd-service.html

Configuration

Map share to fileserver:

NFS link: https://thegnome.nchar.com/linux-links/nfs

Open a web browser to http://[hostname]:8112 to configure the web interface:

Under downloads:

Update the folder locations to the NFS locations

Under network:

Uncheck use random ports set own values such as 6881-6891

configure outgoing interface - tun0

configure Peer TOS Byte: 0x10

Under Bandwidth:

Adjust values as desired

Under Interface:

Update password from the default of deluge

Enable SSL and change port to 8443

Under Queue:

Adjust values as desired

VPN Setup

Move files to where they belong:

Move files /etc/openvpn-client

move /etc/openvpn-client/VPNRules.service to /etc/systemd/system/

move /etc/openvpn-client/VPNTorGuard.service to /etc/systemd/system/

Register the services:

systemctl daemon-reload

systemctl enable /etc/systemd/system/VPNTorGuard.service

systemctl start VPNTorGuard.service

systemctl status VPNTorGuard.service

systemctl enable /etc/systemd/system/VPNRules.service

systemctl start VPNRules.service

systemctl status VPNRules.service