Stable Low Power Server for Bittorrent Downloads - How to save £500 a years in Electricity costs, and increase the lifespan of your main system

Introduction

If you are still running a large desktop or Laptop 24x7 for downloads and server processes you might want to consider some small low power computers like the Rasberry Pi or the cheaper Orange Pi Single Board Computers (SBC) these only need a few Watts peak so are much cheaper to run. I've had several, some running headless others as part of Kodi installations attached to TVs. This setup works really well and you can record off TV (Terrestrial / SAT) with no encryption and in HD.

This post is about setting up transmission on a dedicated unix server.

I'll show how to

1) add NAS and then
2) auto downloading

in the next 2 posts. But first setting up a stable download server... Quick disclainer if you want a tiny throwaway server for a few months the DietPi is fine, For a longer term setup where you setup many services then a more durable server setup like Armbian is worth considering.

Background

I've had a lot of folk ask about installing Transmission on a SBC (Like Orange Pi / Rasberry Pi, etc) I normally recommend a small Linux like DietPi for throw away installations - Where you will not uninstall but just get something running and the reinstall from scratch for changes.

More recently folk have asked for a more stable long term platform. I think Armbian is worth a look. Go for the stock SERVER version, not the desktop version. Install the image to MicroSD and boot up the unit with a screen keyboard.

Installing Transmission

Installing transmission should be simple, it never seems to be for me :)

A few things to remember

1) This installs a server process so that your downloads can run on a small low power computer even when your desktop laptop is off
2) This setup will allow you to add downloads using any laptop / PC on your home network or VPNed in to your home network. Once downloading your laptop / PC does not have to be on the network or even switched on.
3) Most of the setup guides predate the inclusion of transmission into the Ubuntu repos on which many distros like Armbian are built.

Ok let's install Transmission on this server instalation running on a low power SBC like Orange Pi / Rasberry Pi

root@orangepione:~# sudo apt-get install transmission-daemon
Reading package lists... Done
Building dependency tree
Reading state information... Done
Recommended packages:
  transmission-cli
The following NEW packages will be installed:
  transmission-daemon
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 180 kB of archives.
After this operation, 354 kB of additional disk space will be used.
Get:1 http://ports.ubuntu.com xenial/main armhf transmission-daemon armhf 2.84-3ubuntu3 [180 kB]
Fetched 180 kB in 0s (487 kB/s)
Selecting previously unselected package transmission-daemon.
(Reading database ... 57531 files and directories currently installed.)
Preparing to unpack .../transmission-daemon_2.84-3ubuntu3_armhf.deb ...
Unpacking transmission-daemon (2.84-3ubuntu3) ...
Processing triggers for man-db (2.7.5-1) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for systemd (229-4ubuntu16) ...
Setting up transmission-daemon (2.84-3ubuntu3) ...
Processing triggers for systemd (229-4ubuntu16) ...
Processing triggers for ureadahead (0.100.0-19) ...

After the install you should be able to stop / start the new service

root@orangepione:~# sudo service transmission-daemon start
root@orangepione:~# sudo service transmission-daemon stop

If you try and access the web interface it will be protected

403: Forbidden. Unauthorized IP Address. Either disable the IP address whitelist or add your address to it. If you're editing settings.json, see the 'rpc-whitelist' and 'rpc-whitelist-enabled' entries. If you're still using ACLs, use a whitelist instead. See the transmission-daemon manpage for details.

Edit the settings but remember to stop the service BEFORE editing

sudo service transmission-daemon stop
sudo nano /var/lib/transmission-daemon/info/settings.json

Enable local lan in my case and other changes you want (See the Troubleshooting - No Web Access to the Server section below for a sample working settings file)

"rpc-whitelist": "127.0.0.1,192.168.*.*",

Troubleshooting - No Web Access to the Server

These are the settings I used  on a home set up no password, no user auth, no IP lockdown so anyone on the home network has access to transmission. Edit the settings with this command



sudo nano /var/lib/transmission-daemon/info/settings.json

{
    "alt-speed-down": 50,
    "alt-speed-enabled": false,
    "alt-speed-time-begin": 540,
    "alt-speed-time-day": 127,
    "alt-speed-time-enabled": false,
    "alt-speed-time-end": 1020,
    "alt-speed-up": 50,
    "bind-address-ipv4": "192.168.0.99",
    "bind-address-ipv6": "::",
    "blocklist-enabled": false,
    "blocklist-url": "http://www.example.com/blocklist",
    "cache-size-mb": 4,
    "dht-enabled": true,
    "download-dir": "/var/lib/transmission-daemon/downloads",
    "download-limit": 100,
    "download-limit-enabled": 0,
    "download-queue-enabled": true,
    "download-queue-size": 5,
    "encryption": 1,
    "idle-seeding-limit": 30,
    "idle-seeding-limit-enabled": false,
    "incomplete-dir": "/var/lib/transmission-daemon/Downloads",
    "incomplete-dir-enabled": false,
    "lpd-enabled": false,
    "max-peers-global": 200,
    "message-level": 1,
    "peer-congestion-algorithm": "",
    "peer-id-ttl-hours": 6,
    "peer-limit-global": 200,
    "peer-limit-per-torrent": 50,
    "peer-port": 51413,
    "peer-port-random-high": 65535,
    "peer-port-random-low": 49152,
    "peer-port-random-on-start": false,
    "peer-socket-tos": "default",
    "pex-enabled": true,
    "port-forwarding-enabled": false,
    "preallocation": 1,
    "prefetch-enabled": 1,
    "queue-stalled-enabled": true,
    "queue-stalled-minutes": 30,
    "ratio-limit": 2,
    "ratio-limit-enabled": false,
    "rename-partial-files": true,
    "rpc-authentication-required": false,
    "rpc-bind-address": "0.0.0.0",
    "rpc-enabled": true,
    "rpc-password": "",
    "rpc-port": 9091,
    "rpc-url": "/transmission/",
    "rpc-username": "",
    "rpc-whitelist": "127.0.0.1,192.168.*.*",
    "rpc-whitelist-enabled": true,
    "scrape-paused-torrents-enabled": true,
    "script-torrent-done-enabled": false,
    "script-torrent-done-filename": "",
    "seed-queue-enabled": false,
    "seed-queue-size": 10,
    "speed-limit-down": 100,
    "speed-limit-down-enabled": false,
    "speed-limit-up": 100,
    "speed-limit-up-enabled": false,
    "start-added-torrents": true,
    "trash-original-torrent-files": false,
    "umask": 0,
    "upload-limit": 100,
    "upload-limit-enabled": 0,
    "upload-slots-per-torrent": 14,
    "utp-enabled": true
}

Troubleshooting - Broken Packages

If you have followed the instructions on transmission you DO NOT need all the streps to for Armibian as transmission is now supported. ASep 1 below removes the old repo in case you added. If you are installing on a clean new build you can skip to step 2). I took this example from https://ubuntuforums.org/showthread.php?t=2233469 The post was dated July 8th, 2014 and in March 2017 the SAME situation still applies! This is a useful primer https://help.ubuntu.com/community/TransmissionHowTo#Configure

What to do if you have installed code from non ubunti repos and now have broken dependencies. You can reflash a new SD card with Armbian Server or you know you have only added the non ubuntu repo and the transmission-common package:

1) Uninstall Transmission. All of it. Every package.
Code:
sudo apt-get autoremove transmission-common
2) Disable all non-Ubuntu Transmission sources
Code:
software-properties-gtk
3) Delete every transmission* package in /var/cache/apt/archives
Code:
sudo rm /var/cache/apt/archives/transmission*
4) Check if your package manager is working properly. If not, post the entire output here.
Code:
sudo apt-get upgrade && sudo apt-get update
5) If no errors in step 4, your package manager is fixed. Reinstall Transmission from the Ubuntu Repositories.
Code:
sudo apt-get install transmission-gtk