{{Article summary text|Deluge is a lightweight, BitTorrent client written in python that offers users a powerful client/server architecture. Once a headless daemon has been setup, user can interact with it in three ways including a WebUI, GTK-UI, and console interface.}}

[http://deluge-torrent.org/ Deluge] is a lightweight but full-featured BitTorrent application written in python2. It has a variety of features, including but not limited to: a client/server model, DHT support, magnet links, a plugin system, UPnP support, full-stream encryption, proxy support, and three different client applications. When the server daemon is running, users can connect to it via a console client, a gtk-based GUI, or a Web-based UI. A full list of features can be viewed [http://dev.deluge-torrent.org/wiki/About here].

==Installation==

==Installation==

Line 16:

Line 22:

# pacman -S deluge

# pacman -S deluge

−

The gtk UI requires additional dependencies as does the webui. Inspect the pacman output to determine which are right for the intended application.

+

The gtk UI requires additional dependencies as does the Web UI. Inspect the pacman output to determine which are right for the intended application.

python2-notify: libnotify notifications

python2-notify: libnotify notifications

pygtk: needed for gtk ui

pygtk: needed for gtk ui

Line 22:

Line 28:

python2-mako: needed for web ui

python2-mako: needed for web ui

−

==Daemon Setup==

+

==Daemon Setup==

−

Deluge can run as a system daemon which is accessible to any system user or it can run in a non-daemon mode. The focus of this article is on the daemon mode of operation. Users wishing a more simplistic setup, i.e. running {{ic|/usr/bin/deluged}} as them-self should be able to read on and simply substitute the systemctl commands for the live files on the system.

+

{{Warning|If multiple users are running a daemon, the default port (58846) will need to be changed for each user.}}

+

Deluge comes with a daemon called {{ic|deluged}}. If it is not running when one of the clients is run, it will be started. It is useful, however, to have it started with systemd to allow torrents to run without starting a client and/or Xorg. This can be accomplished in one of two ways: a system service or a user service.

+

+

===System Service===

+

A system service will allow {{ic|deluged}} to run at boot without the need to start Xorg or a client. Deluge comes with a system service called {{ic|deluged.service}}, which can be started and enabled without change:

+

# systemctl start deluged

+

# systemctl enable deluged

+

This will run the deluge daemon as the '''deluge''' user, which is created by the deluge package. If you wish to run the daemon as another user, copy {{ic|/usr/lib/systemd/system/deluged.service}} to {{ic|/etc/systemd/system/deluged.service}} and change the User parameter within the file, such as the '''torrent''' user:

+

User='''torrent'''

+

In that case, you will have to create a user called '''torrent'''.

+

+

===User Service===

+

A user service will allow {{ic|deluged}} to run when {{ic|systemd --user}} is started. This is accomplished by creating a user service file:

+

{{hc|/etc/systemd/user/deluged.service|<nowiki>

+

[Unit]

+

Description=Deluge Daemon

+

After=network.target

+

+

[Service]

+

Exec=/usr/bin/deluged -d -P %h/.config/deluge/deluge.pid

+

+

[Install]

+

WantedBy=default.target

+

</nowiki>}}

+

The deluge user service can now be started and enabled by the user:

+

$ systemctl --user start deluged

+

$ systemctl --user enable deluged

+

+

The {{ic|deluged}} user service can also be placed in {{ic|$HOME/.config/systemd/user/}}. See [[systemd/User]] for more information on user services.

+

+

==Configuration==

+

Deluge can be configured through any of the clients as well as by simply editting the JSON-formatted configuration files located in {{ic|$HOME/.config/deluge/}}. '''$HOME''' refers to the home directory of the user that {{ic|deluged}} is running as. This means that if the daemon is running as the '''deluge''' user, the default home directory is {{ic|/srv/deluge/}}.

+

+

===Firewall===

+

Deluge requires at least one port open for TCP and UDP to allow incoming connections for seeding. If deluge is informing you that it cannot open a port for incoming connections, you must open ports you wish to use. In this example, ports 56881 through 56889 are opened for TCP and UDP:

+

# iptables -A INPUT -p tcp --dport 56881:56889 -j ACCEPT

+

# iptables -A INPUT -p udp --dport 56881:56889 -j ACCEPT

+

If you are behind a NAT router/firewall, port forwards are also required there. UPnP may also be used, but that will not work with the local firewall on the system that the daemon is running on because it requires predefined ports.

+

{{Note|You can limit this to just one port, but you must open any ports for both TCP and UDP.}}

+

+

==Clients==

+

===Console===

+

The console client can be run with:

+

$ deluge-console

+

Enter the {{ic|help}} command for a list of available commands.

+

+

===Gtk===

+

{{Note|If you plan on using the daemon (server) functionality, it is wise to disable Classic Mode in '''Edit -> Preferences -> Interface'''. '''''This requires a restart of the client.'''''}}

{{Warning|If multiple users are running a daemon, the default port (8112) will need to be changed for each user.}}

+

{{Note|It is recommended that you use '''https''' for the Web client.}}

+

{{Warning|The deluge Web client comes with a default password. See the Setup section.}}

+

The Web UI can be started by running {{ic|deluge-web}}, through a plugin in the gtk UI, or via systemd. It has many of the same features of the gtk UI, including the plugin system.

+

+

====System Service====

+

Deluge comes with a system service file called {{ic|deluge-web.service}}. The process for this is the same as starting {{ic|deluged.service}}, except with {{ic|deluge-web}} instead of {{ic|deluged}}. This service will also run as the '''deluge''' user unless the service file is modified in the same way as {{ic|deluged.service}}.

+

+

====User Service====

+

A user service will allow {{ic|deluge-web}} to run when {{ic|systemd --user}} is started. This is accomplished by creating a user service file:

+

{{hc|/etc/systemd/user/deluge-web.service|<nowiki>

+

[Unit]

+

Description=Deluge Web UI

+

After=deluged.service

+

+

[Service]

+

Exec=/usr/bin/deluge-web --ssl

+

+

[Install]

+

WantedBy=default.target

+

</nowiki>}}

+

The deluge user service can now be started and enabled by the user:

+

$ systemctl --user start deluge-web

+

$ systemctl --user enable deluge-web

+

+

The {{ic|deluge-web}} user service can also be placed in {{ic|$HOME/.config/systemd/user/}}. See [[systemd/User]] for more information on user services.

+

+

====Setup====

+

When {{ic|deluge-web}} is initially started, it will create {{ic|$HOME/.config/deluge/web.conf}}. The password in this file is hashed with SHA1 and salted. The default password is '''deluge'''. On the first visit, you will be advised to change the password.

−

{{Note|Advanced users are free to edit the configuration files in the deluge daemon home directory {{ic|/srv/deluge/.config/}} manually or from {{ic|/usr/bin/deluge-console}}. The rest of this guide is written using the gtk client to do this from convenience of a GUI.}}

+

You will also be greeted by a warning from your browser that the SSL certificate is untrusted. You must add an exception to this in your browser to continue on. See the [[OpenSSL]] page for information on creating your own certificate.

−

Start the deluge backend daemon like any other systemd service:

+

==Headless Setup==

−

# systemctl start deluged

+

Deluge is quite useful on a headless system, often referred to as a seed box, because of its client/server model. To set up deluge on a headless system, set up the daemon as shown above.

−

=== Create a User ===

+

===Create a User===

−

To allow interaction with the daemon, create a user:password:level in {{ic|/srv/deluge/.config/deluge/auth}}.

+

To allow interaction with the server remotely, create a user in {{ic|$HOME/.config/deluge/auth}}. For example:

−

For example:

+

$ echo "delugeuser:p422WoRd:10" >> $HOME/.config/deluge/auth

−

# echo "delugeuser:p422WoRd:10" >> /srv/deluge/.config/deluge/auth

+

{{Note|The user/password created does not have to match any system users, and to maintain good security practices it should NOT!}}

−

{{Note|The user/password created does not have to match any system users... and to maintain good security practices it should NOT!}}

+

{{Note|The user/password in this file are not hashed or salted like in the web client config.}}

−

The number '''10''' corresponds to a level of 'Admin.' Refer to the following table for additional values:

+

The number '''10''' corresponds to a level of '''Admin'''. Refer to the following table for additional values:

{| class="wikitable" align="center"

{| class="wikitable" align="center"

Line 53:

Line 151:

{{Note|In Deluge 1.35, these values have no effect, but multiuser options are under development.}}

{{Note|In Deluge 1.35, these values have no effect, but multiuser options are under development.}}

−

=== Define Options ===

+

===Allow Remote===

−

#Load the gtk client {{ic|/usr/bin/deluge-gtk}}

−

#Disable '''classic mode''' from the Edit>Preferences>Interface.

−

−

A restart of the client is required for these changes to take effect. Exit the client and reload it.

−

−

#Setup the client to point to the daemon from Edit>Connection Manager.

−

#Delete the dummy server by hightlighting it and clicking the "Remove" button.

−

#Create an entry to the daemon via the "Add" button populating the resulting dialog with either the IP address or the word "localhost" as the hostname. Populate the "Username" and "Password" fields with the username and password used in the daemons setup. and then click the "+ Add" button.

−

−

Hostname: localhost

−

Username: delugeuser

−

Password: p422WoRd:10

−

−

If the correct credentials were populated, a green light should appear options for interaction adjacent to the name of the server. To connect, hit the "Connect" button.

−

−

Users can now configure their server from the GUI. Most of the options are self explanatory and intuitive. More details are available on the official [http://dev.deluge-torrent.org/wiki/UserGuide/BandwidthTweaking Deluge wiki] for details.

−

−

{{Note|When defining paths under Preferences>Downloads make sure that the the '''deluge''' user has read/write access to whatever is defined. Remember that the daemon is running as system user '''deluge''' in system group '''deluge'''!}}

−

{{Note|If the expectation exists to allow access from other machines, be sure to enable Preferences>Daemon>Connections>Allow Remote Connections.}}

−

−

== Interacting with the Daemon ==

−

As previously mentioned, users have three options to connect to the daemon:

−

#Deluge-GTK

−

#Deluge-Web

−

#Deluge-console

−

−

=== Deluge-Gtk ===

−

The gtk client has already been covered in the previous section. Users should now have a fully functional client.

−

−

===Deluge-Web (Optional) ===

−

{{Warning|Running the web client without encryption can be a bad idea. It is therefore recommended that users enable https.}}

−

To enable encrypted connections to/from the daemon, simply edit the '''https''' variable in {{ic|/srv/deluge/.config/deluge/web.conf}} changing the default value of '''false''' to '''true''' as shown:

−

"https": true,

−

−

Take note of the doublequotes and the trailing comma!

−

−

Users wishing to regenerate self-signed certificates can refer to [http://httpd.apache.org/docs/2.0/ssl/ssl_faq.html#selfcert this link].

−

−

To run the web ui, simply start the web-daemon:

−

# systemctl start deluge-web

−

Point a browser to {{ic|https://localhost:8112}}. Substitute the word '''localhost''' with an IP address if the server is elsewhere.

When asked for a password, enter "deluge" as it is the default password.

+

"allow_remote": true,

−

The preferences in the web UI is ''highly'' similar to the gtk UI. As explained in the previous section, edit the connection manager and define an entry to the daemon using the same credentials used in the setup step. Once finished, users are free to remove the dummy server entry.

+

===Firewall===

+

You will need to open the port for remote access. The following example uses the default daemon port (58846):

+

# iptables -A INPUT -p tcp --dport 58846 -j ACCEPT

+

See [[iptables]] for more information on firewall rules.

−

Hostname: localhost

+

If you are behind a NAT router/firewall, a port forward is also required there to access the daemon from outside the network.

−

Username: delugeuser

−

Password: p422WoRd:10

−

=== Deluge-Console (Optional) ===

+

===Connect===

−

The CLI client {{ic|/usr/bin/deluge-console}} can also be used to connect to a running daemon. Invoke it from a shell. To connect, simply type:

Deluge is a lightweight but full-featured BitTorrent application written in python2. It has a variety of features, including but not limited to: a client/server model, DHT support, magnet links, a plugin system, UPnP support, full-stream encryption, proxy support, and three different client applications. When the server daemon is running, users can connect to it via a console client, a gtk-based GUI, or a Web-based UI. A full list of features can be viewed here.

Daemon Setup

Warning: If multiple users are running a daemon, the default port (58846) will need to be changed for each user.

Deluge comes with a daemon called deluged. If it is not running when one of the clients is run, it will be started. It is useful, however, to have it started with systemd to allow torrents to run without starting a client and/or Xorg. This can be accomplished in one of two ways: a system service or a user service.

System Service

A system service will allow deluged to run at boot without the need to start Xorg or a client. Deluge comes with a system service called deluged.service, which can be started and enabled without change:

# systemctl start deluged
# systemctl enable deluged

This will run the deluge daemon as the deluge user, which is created by the deluge package. If you wish to run the daemon as another user, copy /usr/lib/systemd/system/deluged.service to /etc/systemd/system/deluged.service and change the User parameter within the file, such as the torrent user:

User=torrent

In that case, you will have to create a user called torrent.

User Service

A user service will allow deluged to run when systemd --user is started. This is accomplished by creating a user service file:

The deluged user service can also be placed in $HOME/.config/systemd/user/. See systemd/User for more information on user services.

Configuration

Deluge can be configured through any of the clients as well as by simply editting the JSON-formatted configuration files located in $HOME/.config/deluge/. $HOME refers to the home directory of the user that deluged is running as. This means that if the daemon is running as the deluge user, the default home directory is /srv/deluge/.

Firewall

Deluge requires at least one port open for TCP and UDP to allow incoming connections for seeding. If deluge is informing you that it cannot open a port for incoming connections, you must open ports you wish to use. In this example, ports 56881 through 56889 are opened for TCP and UDP:

If you are behind a NAT router/firewall, port forwards are also required there. UPnP may also be used, but that will not work with the local firewall on the system that the daemon is running on because it requires predefined ports.

Note: You can limit this to just one port, but you must open any ports for both TCP and UDP.

Clients

Console

The console client can be run with:

$ deluge-console

Enter the help command for a list of available commands.

Gtk

Note: If you plan on using the daemon (server) functionality, it is wise to disable Classic Mode in Edit -> Preferences -> Interface. This requires a restart of the client.

Label - Allows labels to be assigned to torrents, as well as state, tracker, and keyword filters

Notifications - Provides notifications (email, pop-up, blink, sound) for events as well as other plugins

Scheduler - Limits active torrents and their speed on a per-hour, per-day basis

WebUi - Allows the Web UI to be started via the gtk client

Web

Warning: If multiple users are running a daemon, the default port (8112) will need to be changed for each user.

Note: It is recommended that you use https for the Web client.

Warning: The deluge Web client comes with a default password. See the Setup section.

The Web UI can be started by running deluge-web, through a plugin in the gtk UI, or via systemd. It has many of the same features of the gtk UI, including the plugin system.

System Service

Deluge comes with a system service file called deluge-web.service. The process for this is the same as starting deluged.service, except with deluge-web instead of deluged. This service will also run as the deluge user unless the service file is modified in the same way as deluged.service.

User Service

A user service will allow deluge-web to run when systemd --user is started. This is accomplished by creating a user service file:

The deluge-web user service can also be placed in $HOME/.config/systemd/user/. See systemd/User for more information on user services.

Setup

When deluge-web is initially started, it will create $HOME/.config/deluge/web.conf. The password in this file is hashed with SHA1 and salted. The default password is deluge. On the first visit, you will be advised to change the password.

You will also be greeted by a warning from your browser that the SSL certificate is untrusted. You must add an exception to this in your browser to continue on. See the OpenSSL page for information on creating your own certificate.

Headless Setup

Deluge is quite useful on a headless system, often referred to as a seed box, because of its client/server model. To set up deluge on a headless system, set up the daemon as shown above.

Create a User

To allow interaction with the server remotely, create a user in $HOME/.config/deluge/auth. For example:

$ echo "delugeuser:p422WoRd:10" >> $HOME/.config/deluge/auth

Note: The user/password created does not have to match any system users, and to maintain good security practices it should NOT!

Note: The user/password in this file are not hashed or salted like in the web client config.

The number 10 corresponds to a level of Admin. Refer to the following table for additional values:

Level Name

Level Value

None

0

Read Only

1

Normal

5

Admin

10

Note: In Deluge 1.35, these values have no effect, but multiuser options are under development.