Setting up Deluge on the Raspberry Pi

Firstly, we will be using the latest Raspbian operating system anything else you might run into problems.

1. Before we install the Deluge torrent client on to the Raspberry Pi, we should first ensure all our packages are up to date. You can do this by running the following two commands.

2. In this step, we will now install the Deluge torrent client to the Raspberry Pi.

The version of the Deluge torrent client that we will be installing contains its web interface. The Deluge web interface will allow you to manage your torrents from any web browser easily.

To install Deluge, deluges web interface module and the python module the web interface requires we run the command below.

3. If you want to store your downloaded torrents in a different location, then you can now go ahead and create the required folder.

In our example, we will be creating a folder within a drive we mounted to our “ /media/NASHDD” folder called “ torrent-downloads”.

This folder is a Samba share, and our pi user already has the privileges to write to this directory.

We can create this folder by running the following command.

4. Let’s now start-up and then shutdown the Deluged daemon by running the following two commands. This process will make the Deluge torrent software create the config files we need on our Raspberry Pi.

We will modify two config files so that we can allow remote access to Deluge and create a user to login to the Deluge daemon.

5. We can easily insert a user into Deluges auth file by running the command below.

Make sure you swap out certain parts of this command such as “ <USERNAME>” with the username you want to set and “ <PASSWORD>” with the password that you want to give the user.

6. With the authentication now modified we need to go ahead and fire up the Deluge software again.

Without the software running we won’t be able to make the next configuration change.

7. Now we can go ahead and change Deluge’s config file so that the “ allow_remote” variable is set to “ True”.

We can do this by making use of the “ deluge-console” package and running the command below.

8. With all the required configuration changes done, we can now go ahead and fire up the Deluge web interface.

Run the following command to launch the web interface. We use “ -f” on “ deluge-web” to launch it as a daemon.

9. Lastly, let’s grab the Raspberry Pi’s local IP address with the command below. We will need this IP so that we can access the Raspberry Pi Deluge web interface.

The Deluge Web Interface

1. With the Deluge web interface up and running on the Raspberry Pi, we can now access it by going to the Pi’s IP address followed by the “8112” port.

Enter the following web address, make sure you swap out “ <IPADDRESS>” with your Pi’s IP address.

2. Upon going to the web address, you will be greeted by Deluge’s web interface.

To access the interface, you will be first asked to enter a password (1.). The web interface password by default is “deluge“. We will update this password later on in the tutorial.

Raspberry Pi Deluge Web Login Screen

Once you have entered the password for Deluge, click the “Login” button (2.).

3. After logging into the Deluge web interface, you will then be shown the “Connection Manager” (1.).

Click the available host and then click the “Connect” button (2.).

Deluge Connection Manager

4. Once you have selected a connection in the “Connection Manager” box, you will now be brought to the main Deluge web interface screen.

If you want to change the download location or the default password, you can now do this by opening up the preferences dialog box by clickingPreferences” in the toolbar.

Deluge Preferences Location

5. The first screen within the Deluge preferences interface is the “Downloads” screen. This screen lets you set things such as the download folder (1.)

Within this interface, you can specify the general download folder. You can also pick more specific options such as a location you want the completed torrents kept.

If you want to change the default password for the Deluge web interface, then you will need to go to the “Interface” screen (2.).

Deluge Web Download Settings

6. Now within the “Interface” screen, you can set the password (1.).

First, you will need to specify the original password in the “Old password” textbox, which in a first-run case, this will be “deluge“.

Next, specify your desired password in both the “New Password:” and “Confirm Password:” text fields.

Once you are all set, click the “Change” button (2.)

Deluge Web Change Password

Setting up Deluge as a service

1.  Now we need to make a service file for the Deluge daemon. This service file is what systemd will read from so that it knows how to manage the daemon.

Run the following command to begin writing our “ deluged.service” file.

2. Within this file, enter the following text.

These settings will set it up so that Deluged daemon will be started after the network has come online.

Make sure that you replace “ pi” with the name of your user. This is the user that will be used to run Deluge and helps prevent potential permission issues.

3. Once done, you can go ahead and save the Deluged service file by pressing CTRL + X then Y followed by ENTER.

4. Now that we have created our Deluged service file let’s go ahead and enable it. Enabling the service means that on the next boot, it will start automatically.

Enable the service by running the following command.

We won’t be running the service straight away because the “ deluged” daemon will be running already from the previous sections of this tutorial.

5. Next, we will need to create another service that will manage running the deluge web interface for us.

We will be calling this service file “ deluge-web.service“, we can begin writing this file by running the following command on the Raspberry Pi

6. Within this file, enter the following text.

This text defines our Deluge web interface service. This service will only start up after both the network has come online and the deluged service is active.

Before saving this file, ensure that you have replaced “ pi” with the name of your user.

Once written you can save and quit by pressing CTRL + X, followed by Y then the ENTER key.

7. With our “ deluge-web.service” now created, let’s go ahead and enable it by running the command below.

8. Finally, we need to restart our Raspberry Pi Deluge setup by running the following command.

Restarting our Raspberry Pi will allow us to test that our services are running as they should be.

9. Once your Raspberry Pi has finished rebooting you can now check to ensure that both Deluged and the Deluge web service is up and running.

Run the following two commands to retrieve the current status of the two services.

If the status returns as “ Active: active (running)” then you have successfully set up the Deluge torrent client on your Raspberry Pi.

(Visited 14 times, 1 visits today)