The Deluge Bit Torrent Client

Deluge-1

Deluge is an extremely customizable Bit Torrent Client, that has a lot of features that play very nicely with a server situation:

  • It’s modular, which means the actual daemon is entirely separate from the client which controls it. This is awesome because we can choose from several different client types: A WebGUI, which will be available to any computer on our network via the browser. An installable GUI, which is available for all three major OS’s. And a console version which can be controlled from the command line. I’ll show you how to use all three.
  • It allows us to download files to one location, and then move them to another immediately. This way we can make sure files don’t show up in the File Share or various media servers until they finish downloading.
  • It will allow us to dynamically change the bandwidth provided to torrents depending on the time of day, so we don’t slow down the whole network during peak hours.
  • It can accept proxies, so we can use the wonderful BTGuard proxy, which anatomizes our downloading (Though I certainly would never advise you to do anything illegal. Please check the laws for your state and country before you download anything.)
  • It accepts plug-ins, which means we can add any additional functionality we may find lacking.

Installing Deluge Headless

At the time of writing, Deluge 1.3.x was the release available in the Ubuntu repositories. If a newer version has been released, these instructions may or may not still work.

Before downloading deluge, we need to create a user to run it as:

sudo adduser --disabled-password --system --home /home/deluge --group deluge

Then we can go ahead and download the Deluge:

sudo apt-get update && sudo apt-get install deluged deluge-webui

Configuring the Daemon to run at boot

To start deluge and the webui at boot, we need to have an init.d script set-up to start it during the boot process. Luckily for us, someone else has already written an init.d script, all we need to do is configure it, and copy it into our init.d directory. The first thing we need to do is create the /etc/default/deluge-daemon file. this is what passes the configuration to the OS.

sudo nano /etc/default/deluge-daemon

Inside it, we’ll paste the following:

# Configuration for /etc/init.d/deluge-daemon
# The init.d script will only run if this variable non-empty.
DELUGED_USER="deluge"
# Should we run at startup?
RUN_AT_STARTUP="YES"

Save off the file (Ctrl+X, then Y), and create the actual init.d script:

sudo nano /etc/init.d/deluge-daemon

Paste into it this init script, copied from here, and originally hosted here.

Now we need to make it executable, and update the boot process to reflect that we added it:

sudo chmod a+x /etc/init.d/deluge-daemon && sudo update-rc.d deluge-daemon defaults

From here, you should be able to reboot the server, and access the web interface from [hostnameofMediaServer]:8112. It will look like this:

Deluge Log-in Screen

The default password is “deluge”, though the WebUI will ask you to change it as soon as you log in.

Using an Installable Client

My favorite way to control deluge is from a client installed on my computer. This is because the WebGUI has only basic functionality, as it’s still in development. To control any plugins, such as the scheduler, the automatic torrent adder, etc., we need the full client. It’s also easier to navigate the settings page with scroll bars available, and you can associate .torrent files with the client, so you can just click on torrent files to open them on the server. That being said, it takes a few steps to get this “Thin Client” set-up working correctly.

Configuring the server for use with the Thin Client

First we need to download the console version of deluge so that we can configure a few settings:

sudo apt-get install deluge-console

Once it has finished installing go ahead and boot up deluge-console by typing:

sudo -H -u deluge deluge-console

in the console, allow remote connections to the daemon:

config -s allow_remote True

and exit:

exit

now we need to go ahead and shutdown the daemon

sudo /etc/init.d/deluge-daemon stop

and add a username and password for the daemon to the auth file:

sudo chmod -R 777 /home/deluge && sudo -H -u deluge echo username:password:10 >> /home/deluge/.config/deluge/auth

now we can go ahead and start the daemon back up:

sudo /etc/init.d/deluge-daemon start

Installing the Client

  • To install the client in Ubuntu, simply run sudo apt-get install deluge-gtk
  • To install the client in Arch Linux, simply run sudo pacman -Sy deluge
  • To install the client In Windows or Mac, just grab the installer from here.

Configuring the Client

Open the client and navigate to the interface tab in settings [Edit → Preferences → Interface]. Uncheck Enabled under Classic Mode. Go ahead and [File → Exit] When you start the client back up, you’ll see a screen that looks like this:

Deluge Connection Manager

Click Add and fill in the hostname of your media server, and the username and password you put in the auth file earlier. It should look like this:

Add Server

Once you add the server, you should be able to click connect, and log-in to the server. Now you can treat the deluge client as if it were hosted on your computer.

Deluge is an extremely customizable Bit Torrent Client, that has a lot of features that play very nicely with our server situation:

  • It’s modular, which means the actual daemon is entirely separate from the client which controls it. This is awesome because we can choose from several different client types: A WebGUI, which will be available to any computer on our network via the browser. An installable GUI, which is available for all three major OS’s. And a console version which can be controlled from the command line. I’ll show you how to use all three.
  • It allows us to download files to one location, and then move them to another immediately. This way we can make sure files don’t show up in the File Share or various media servers until they finish downloading.
  • It will allow us to dynamically change the bandwidth provided to torrents depending on the time of day, so we don’t slow down the whole network during peak hours.
  • It can accept proxies, so we can use the wonderful BTGuard proxy, which anatomizes our downloading (Though I certainly would never advise you to do anything illegal. Please check the laws for your state and country before you download anything.)
  • It accepts plug-ins, which means we can add any additional functionality we may find lacking.

Installing Deluge Headless

At the time of writing, Deluge 1.3.x was the release available in the Ubuntu repositories. If a newer version has been released, these instructions may or may not still work.

Before downloading deluge, we need to create a user to run it as:

sudo adduser --disabled-password --system --home /home/deluge --group deluge

Then we can go ahead and download the Deluge:

sudo apt-get update && sudo apt-get install deluged deluge-webui

Configuring the Daemon to run at boot

To start deluge and the webui at boot, we need to have an init.d script set-up to start it during the boot process. Luckily for us, someone else has already written an init.d script, all we need to do is configure it, and copy it into our init.d directory. The first thing we need to do is create the /etc/default/deluge-daemon file. this is what passes the configuration to the OS.

sudo nano /etc/default/deluge-daemon

Inside it, we’ll paste the following:

# Configuration for /etc/init.d/deluge-daemon
# The init.d script will only run if this variable non-empty.
DELUGED_USER="deluge"
# Should we run at startup?
RUN_AT_STARTUP="YES"

Save off the file (Ctrl+X, then Y), and create the actual init.d script:

sudo nano /etc/init.d/deluge-daemon

Paste into it this init script, copied from here, and originally hosted here.

Now we need to make it executable, and update the boot process to reflect that we added it:

sudo chmod a+x /etc/init.d/deluge-daemon && sudo update-rc.d deluge-daemon defaults

From here, you should be able to reboot the server, and access the web interface from [hostnameofMediaServer]:8112. It will look like this:

Deluge Log-in Screen

The default password is “deluge”, though the WebUI will ask you to change it as soon as you log in.

Using an Installable Client

My favorite way to control deluge is from a client installed on my computer. This is because the WebGUI has only basic functionality, as it’s still in development. To control any plugins, such as the scheduler, the automatic torrent adder, etc., we need the full client. It’s also easier to navigate the settings page with scroll bars available, and you can associate .torrent files with the client, so you can just click on torrent files to open them on the server. That being said, it takes a few steps to get this “Thin Client” set-up working correctly.

Configuring the server for use with the Thin Client

First we need to download the console version of deluge so that we can configure a few settings:

sudo apt-get install deluge-console

Once it has finished installing go ahead and boot up deluge-console by typing:

sudo -H -u deluge deluge-console

in the console, allow remote connections to the daemon:

config -s allow_remote True

and exit:

exit

now we need to go ahead and shutdown the daemon

sudo /etc/init.d/deluge-daemon stop

and add a username and password for the daemon to the auth file:

sudo chmod -R 777 /home/deluge && sudo -H -u deluge echo username:password:10 >> /home/deluge/.config/deluge/auth

now we can go ahead and start the daemon back up:

sudo /etc/init.d/deluge-daemon start

Installing the Client

  • To install the client in Ubuntu, simply run sudo apt-get install deluge-gtk
  • To install the client in Arch Linux, simply run sudo pacman -Sy deluge
  • To install the client In Windows or Mac, just grab the installer from here.

Configuring the Client

Open the client and navigate to the interface tab in settings [Edit → Preferences → Interface]. Uncheck Enabled under Classic Mode. Go ahead and [File → Exit] When you start the client back up, you’ll see a screen that looks like this:

Deluge Connection Manager

Click Add and fill in the hostname of your media server, and the username and password you put in the auth file earlier. It should look like this:

Add Server

Once you add the server, you should be able to click connect, and log-in to the server. Now you can treat the deluge client as if it were hosted on your computer.