Difference between revisions of "Transmission"

From ArchWiki
Jump to navigation Jump to search
(Run only while connected to network: use systemd instead of launching crap directly)
m (no more plus in gtk)
 
(43 intermediate revisions by 20 users not shown)
Line 1: Line 1:
[[Category:Internet applications]]
+
[[Category:BitTorrent]]
 
[[de:Transmission]]
 
[[de:Transmission]]
 
[[fr:Transmission]]
 
[[fr:Transmission]]
 
[[it:Transmission]]
 
[[it:Transmission]]
 
[[ja:Transmission]]
 
[[ja:Transmission]]
[[zh-CN:Transmission]]
+
[[zh-hans:Transmission]]
[http://www.transmissionbt.com/ Transmission] is a light-weight and cross-platform BitTorrent client. It is the default BitTorrent client in many Linux distributions.
+
[http://www.transmissionbt.com/ Transmission] is a light-weight and cross-platform BitTorrent client.
  
 
== Installation ==
 
== Installation ==
There are several options in [[official repositories]]:
 
* {{Pkg|transmission-cli}} - daemon, with [[Wikipedia:Command-line interface|CLI]], and web client (http://localhost:9091) interfaces.
 
* {{Pkg|transmission-remote-cli}} - Curses interface for the daemon.
 
* {{Pkg|transmission-gtk}} - GTK3 package.
 
* {{Pkg|transmission-qt}} - Qt5 package.
 
  
{{Note|
+
There are several packages available to [[install]] Transmission with:
* The GTK client cannot connect to the daemon, so users wishing to use the daemon will need to consider using the Qt package for a GUI or the remote-cli package for a curses-based GUI.
+
 
* You cannot connect to the daemon over IPv6.[https://trac.transmissionbt.com/ticket/2236]
+
* {{Pkg|transmission-cli}} – daemon, with CLI, and [[#Web Interface]].
}}
+
* {{Pkg|transmission-gtk}} – [[GTK]] 3 graphical interface.
 +
* {{Pkg|transmission-qt}} – [[Qt]] 5 graphical interface.
 +
* {{AUR|tremc}} or {{AUR|tremc-git}} – Curses interface for the daemon.
 +
* {{Pkg|transmission-remote-gtk}} – [[GTK]] 3 graphical interface for the daemon.
  
 
== Configuring the GUI version ==
 
== Configuring the GUI version ==
 +
 
Both GUI versions, ''transmission-gtk'' and ''transmission-qt'', can function autonomously without a formal back-end daemon.  
 
Both GUI versions, ''transmission-gtk'' and ''transmission-qt'', can function autonomously without a formal back-end daemon.  
  
 
GUI versions are configured to work out-of-the-box, but the user may wish to change some of the settings. The default path to the GUI configuration files is {{ic|~/.config/transmission}}.
 
GUI versions are configured to work out-of-the-box, but the user may wish to change some of the settings. The default path to the GUI configuration files is {{ic|~/.config/transmission}}.
  
A guide to configuration options can be found on the Transmission web site: https://trac.transmissionbt.com/wiki/EditConfigFiles#Options.
+
A guide to configuration options can be found on Transmission's [https://github.com/transmission/transmission/wiki/Editing-Configuration-Files Github].
 
 
=== GTK+ temporary cosmetic fix ===
 
 
 
With GTK+ 3.18, transmission-gtk shows black borders in random places; these can be hidden via {{ic|gtk.css}}:
 
 
 
{{hc|~/.config/gtk-3.0/gtk.css|
 
.tr-workarea .overshoot,
 
.tr-workarea .undershoot { border: none; }
 
}}
 
  
== Transmission-daemon and CLI ==
+
== Transmission daemon and CLI ==
  
 
The commands for ''transmission-cli'' are:
 
The commands for ''transmission-cli'' are:
 
:''transmission-daemon'': starts the daemon.
 
:''transmission-daemon'': starts the daemon.
 
:''transmission-remote'': invokes the [[Wikipedia:Command-line interface|CLI]] for the daemon, whether local or remote, followed by the command you want the daemon to execute.
 
:''transmission-remote'': invokes the [[Wikipedia:Command-line interface|CLI]] for the daemon, whether local or remote, followed by the command you want the daemon to execute.
:''transmission-remote-cli'': (requires {{Pkg|transmission-remote-cli}}) starts the [[Wikipedia:curses (programming library)|curses]] interface for the daemon, whether local or remote.
 
:''transmission-cli'': starts a non-daemonized local instance of ''transmission'', for manually downloading a torrent.
 
 
:''transmission-show'': returns information on a given torrent file.
 
:''transmission-show'': returns information on a given torrent file.
 
:''transmission-create'': creates a new torrent.
 
:''transmission-create'': creates a new torrent.
 
:''transmission-edit'': add, delete, or replace a tracker's announce URL.
 
:''transmission-edit'': add, delete, or replace a tracker's announce URL.
 +
:''transmission-cli'': ([https://github.com/transmission/transmission/commit/950387ab5a443629598f93c057f41150707866ab deprecated in favor of transmission-remote]) starts a non-daemonized local instance of ''transmission'', for manually downloading a torrent.
 +
:''tremc'': (requires {{AUR|tremc-git}}) starts the [[Wikipedia:curses (programming library)|curses]] interface for the daemon, whether local or remote.
  
 
=== Starting and stopping the daemon ===
 
=== Starting and stopping the daemon ===
As explained in [[#Choosing a user]], the {{ic|transmission}} daemon can be run:
 
  
* As the user ''transmission'', by running as root: {{bc|# transmission-daemon}} The daemon can then be stopped with: {{bc|# killall transmission-daemon}}
+
Transmission's daemon can be run:
 +
 
 +
* As the user ''transmission'', by starting/enabling {{ic|transmission.service}} using [[systemd#Using units|systemd]]. The user can be changed as explained in [[#Choosing a user]].
 +
 
 +
* As your own user, by running under your user name:
 +
 
 +
$ transmission-daemon
  
* As your own user, by running under your user name: {{bc|$ transmission-daemon}} The daemon can then be stopped with: {{bc|$ killall transmission-daemon}}
+
Starting the daemon will create an initial configuration file. See [[#Configuring the daemon]].
  
* Starting (and stopping) {{ic|transmission.service}} with [[systemd#Using units|systemctl]] will use the user set in [[#Choosing a user]]. Note that the name of the systemd service is {{ic|transmission.service}}, not {{ic|transmission-daemon.service}}.
+
The daemon can then be stopped with:
  
Starting the daemon will create an initial ''transmission'' configuration file. See [[#Configuring the daemon]].
+
$ pkill -3 transmission-daemon
 +
 
 +
An alternative option to stop Transmission is to use the ''transmission-remote'' command:
  
An alternative option to stop transmission is to use the ''transmission-remote'' command:
 
 
  $ transmission-remote --exit
 
  $ transmission-remote --exit
  
==== Autostart at boot ====
+
=== Reducing journal spam ===
[[Enable]] {{ic|transmission.service}} [[systemd#Using units|using systemd]].
 
  
The daemon is started after {{ic|network.service}} was initialised. However, if you enable the service {{ic|dhcpcd}} as opposed to the device-specific service, such as {{ic|dhcpcd@enp1s0.service}} for example, it may happen that Transmission is started too early and cannot bind to the network interface. Thus, the web interface is unreachable. A possible solution is to add the {{ic|Requires}} line to the unit's [[systemd#Editing provided units|configuration file]]:
+
Running transmission-daemon can lead to a lot of unwanted journal entries. Output can be filtered by starting it with a small wrapper script. The following example also provides some notifications:
 
+
{{hc|transwrap.sh|<nowiki>
{{hc|/etc/systemd/system/transmission.service.d/fixdep.conf|2=
+
#!/bin/zsh
[Unit]
+
killall transmission-daemon 2> /dev/null
Requires=network.target
+
transmission-daemon --foreground --log-info 2>&1 | while read line; do
 +
echo $line |
 +
grep -v "announcer.c:\|platform.c:\|announce done (tr-dht.c:" |
 +
grep -v "Saved.*variant.c:" |
 +
while read line; do
 +
echo $line | grep -q "Queued for verification (verify.c:" &&
 +
notify-send --app-name="Transmission Started" "${line#* * }"
 +
echo $line | grep -q "changed from .Incomplete. to .Complete." &&
 +
notify-send --app-name="Transmission Complete" "${line#* * }"
 +
echo $line | systemd-cat --identifier="TransWrap" --priority=5
 +
done 2>&1 > /dev/null
 +
done&disown
 +
</nowiki>
 
}}
 
}}
  
==== Run only while connected to network ====
+
=== Run only while connected to network ===
===== Netctl =====
+
==== Netctl ====
  
 
It may only be desirable to run transmission on certain networks.  The following script checks that the connection is to a list of authorized networks and then proceeds to launch transmission-daemon.
 
It may only be desirable to run transmission on certain networks.  The following script checks that the connection is to a list of authorized networks and then proceeds to launch transmission-daemon.
  
 
{{hc|/etc/netctl/hooks/90-transmission.sh|<nowiki>
 
{{hc|/etc/netctl/hooks/90-transmission.sh|<nowiki>
#!/bin/sh
+
#!/bin/bash
 
 
# A simple function to check whether an array contains a value
 
function contains() {
 
    local array="$1[@]"
 
    local seeking=$2
 
    local in=1
 
 
 
    for element in "${!array}"; do
 
        if [[ $element == $seeking ]]; then
 
            in=0
 
            break
 
        fi
 
    done
 
    return $in
 
}
 
  
 
# The SSIDs for which we enable this.
 
# The SSIDs for which we enable this.
ssids=(
+
declare -A ssids=(
     "network_1"
+
     ["network_1"]=y
     "network_2"
+
     ["network_2"]=y
 
)
 
)
  
# In the following, `${array_name[(I)search]}` returns 0 if `array_name` does
+
if [[ ${ssids[$SSID]} ]]; then
# not contain `search`, or the index of the match (starting at 1).
+
     case $ACTION in
if contains ssids "$SSID"; then
+
         CONNECT|REESTABLISHED)
     case "$ACTION" in
 
         "CONNECT"|"REESTABLISHED")
 
 
             # Need to wait, otherwise doesn't seem to bind to 9091.
 
             # Need to wait, otherwise doesn't seem to bind to 9091.
 
             sleep 30
 
             sleep 30
Line 116: Line 106:
 
}}
 
}}
  
===== Wicd =====
+
==== Wicd ====
 
Create a [[#Starting and stopping the daemon|start script]] in folder {{ic|/etc/wicd/scripts/postconnect}}, and a [[#Starting and stopping the daemon|stop script]] in folder {{ic|/etc/wicd/scripts/predisconnect}}. Remember to make them executable. For example:
 
Create a [[#Starting and stopping the daemon|start script]] in folder {{ic|/etc/wicd/scripts/postconnect}}, and a [[#Starting and stopping the daemon|stop script]] in folder {{ic|/etc/wicd/scripts/predisconnect}}. Remember to make them executable. For example:
  
Line 129: Line 119:
 
systemctl stop transmission
 
systemctl stop transmission
 
}}
 
}}
 
===== NetworkManager =====
 
{{Expansion|Todo}}
 
  
 
=== Choosing a user ===
 
=== Choosing a user ===
Line 139: Line 126:
 
By default, ''transmission'' creates a user and a group {{ic|transmission}}, with its home files at {{ic|/var/lib/transmission/}}, and runs as this "user". This is a security precaution, so ''transmission'', and its downloads, have no access to files outside of {{ic|/var/lib/transmission/}}. Configuration, operation, and access to downloads needs to be done with "root" privileges (e.g. by using [[sudo]]).
 
By default, ''transmission'' creates a user and a group {{ic|transmission}}, with its home files at {{ic|/var/lib/transmission/}}, and runs as this "user". This is a security precaution, so ''transmission'', and its downloads, have no access to files outside of {{ic|/var/lib/transmission/}}. Configuration, operation, and access to downloads needs to be done with "root" privileges (e.g. by using [[sudo]]).
  
*Under the user's own user name.
+
*Under your own user.
 
To set this up, [[systemd#Editing provided units|override]] the provided service file and specify your username:
 
To set this up, [[systemd#Editing provided units|override]] the provided service file and specify your username:
  
Line 156: Line 143:
 
One can customize the daemon by using a Transmission client or using the included web interface accessible via http://localhost:9091 in a supported browser.
 
One can customize the daemon by using a Transmission client or using the included web interface accessible via http://localhost:9091 in a supported browser.
  
A guide to configuration options can be found on the Transmission web site: https://trac.transmissionbt.com/wiki/EditConfigFiles#Options
+
A guide to configuration options can be found on the Transmission web site: https://github.com/transmission/transmission/wiki/Editing-Configuration-Files
  
 
{{Note|If you want to edit the configuration manually using a text editor, [[#Starting and stopping the daemon|stop the daemon]] first; otherwise, it would overwrite its configuration file when it closes.
 
{{Note|If you want to edit the configuration manually using a text editor, [[#Starting and stopping the daemon|stop the daemon]] first; otherwise, it would overwrite its configuration file when it closes.
Line 174: Line 161:
 
An alternative is to add your user to the {{ic|transmission}} group ({{ic|#usermod -a -G transmission yourusername}}) and then modify the permissions on the {{ic|/var/lib/transmission}} and {{ic|/var/lib/transmission/Downloads}} directories to allow {{ic|rwx}} access by members of the {{ic|transmission}} group.
 
An alternative is to add your user to the {{ic|transmission}} group ({{ic|#usermod -a -G transmission yourusername}}) and then modify the permissions on the {{ic|/var/lib/transmission}} and {{ic|/var/lib/transmission/Downloads}} directories to allow {{ic|rwx}} access by members of the {{ic|transmission}} group.
  
==== Logging daemon to logfile ====
+
==== Host whitelist ====
too many tracker error messages in the syslog. logfile facility needed.
+
If you plan to access the Transmission daemon over the network using the server's hostname, you need to add this hostname to {{ic|rpc-host-whitelist}} in {{ic|settings.json}}.
 +
Otherwise, you will get a "421 Misdirected Request" error when accessing the server.
 +
 
 +
If you connect to the daemon using the server's IP-address, this is not required.
  
 
==== Watch dir ====
 
==== Watch dir ====
 
If you want to ''Automatically add .torrent files from a folder'', but you find that the {{ic|watch-dir}} and {{ic|watch-dir-enabled}} options set in the config file do not work, you can start the transmission daemon with the flag {{ic|-c /path/to/watch/dir}}.
 
If you want to ''Automatically add .torrent files from a folder'', but you find that the {{ic|watch-dir}} and {{ic|watch-dir-enabled}} options set in the config file do not work, you can start the transmission daemon with the flag {{ic|-c /path/to/watch/dir}}.
  
If you're using systemd, edit the unit file located at {{ic|/etc/systemd/system/transmission.service}}.
+
If you're using systemd, edit the {{ic|transmission.service}} unit as described in [[systemd#Editing provided units]].
 +
 
 +
==== Enable IPv6 ====
 +
By default, the daemon only listens for IPv4 connections. To also listen for IPv6 connections, install {{AUR|transmission-cli-ipv6}} (or {{AUR|transmission-cli-git}}, or wait for Transmission 3.0), and change the {{ic|rpc-bind-address}} option to {{ic|"::"}} in {{ic|settings.json}}.
 +
 
 +
==== CLI Examples ====
 +
 
 +
If you want to remove all finished torrents you can use the following command with your own username and password
 +
# transmission-remote -n 'username:password' -l | grep 100% | awk '{print $1}'| paste -d, -s | xargs -i transmission-remote -t {} -r
 +
 
 +
== Web Interface ==
 +
 
 +
=== The GUI way ===
 +
Once Transmission is installed, you can easily set up the web interface. All you need to do is click the '''edit''' menu and select '''preferences'''. Click the '''Remote''' tab and enable '''Allow remote access'''.
 +
 
 +
Here, you have the opportunity to change the default listening port from 9091.
 +
 
 +
Check the '''Use authentication''' and fill in a username and password so that authentication can be used.
 +
 +
To increase security, you can restrict access from any IP address by enabling '''Only allow these IP addresses'''.
 +
 
 +
Now you are ready to launch the web interface by either clicking on the '''Open web client''', which makes your default web browser open it, or manually reaching {{ic|http://''TARGET_IP_ADDRESS'':''PORT''}} with any supported web browser.
 +
 
 +
If you haven't changed the listening port, the default one is 9091. In this case, the link is {{Ic|http://localhost:9091}}
 +
{{Note|Keep in mind that {{Pkg|transmission-cli}} must be installed}}
 +
=== The CLI way===
 +
 
 +
You don't need a graphical interface to set up the web interface, the daemon offers the very same options. You can reach the web interface without specifing any flags. See [[#Starting and stopping the daemon]]
 +
 
 +
Nevertheless, you can specify everything that you see in the previous section:
 +
 
 +
{{bc|$ transmission-daemon --auth --username arch --password linux --port 9091 --allowed "127.0.0.1"}} is equivalent to {{bc|$ transmission-daemon -t -u arch -v linux -p 9091 -a "127.0.0.1"}}
  
 
== Troubleshooting ==
 
== Troubleshooting ==
=== UDP Failed to set receive/sent buffer ===
 
The error messages {{ic|UDP Failed to set receive buffer}} and {{ic|UDP Failed to set sent buffer}} mean that Transmission would like a bigger sent and receive buffer. These buffers can be changed by adding the following file:
 
  
{{hc|/etc/sysctl.d/60-net_buffer.conf|
+
==== Cannot access the daemon over the network ====
<nowiki>
+
The daemon is started after {{ic|network.service}} was initialised. However, if you enable the service {{ic|dhcpcd}} as opposed to the device-specific service, such as {{ic|dhcpcd@enp1s0.service}} for example, it may happen that Transmission is started too early and cannot bind to the network interface. Thus, the web interface is unreachable. A possible solution is to add the {{ic|Requires}} line to the unit's [[systemd#Editing provided units|configuration file]]:
net.core.rmem_max = 16777216
+
 
net.core.wmem_max = 4194304
+
{{hc|/etc/systemd/system/transmission.service.d/fixdep.conf|2=
</nowiki>
+
[Unit]
 +
Requires=network.target
 
}}
 
}}
  
To load the new configuration run {{ic|# sysctl --system}} and then reload Transmission.
+
==== Web interface cannot be reached====
 +
{{bc|404: Not Found
 +
 
 +
Couldn't find Transmission's web interface files!
 +
 
 +
Users: to tell Transmission where to look, set the TRANSMISSION_WEB_HOME environment variable to the folder where the web interface's index.html is located.
 +
 
 +
Package Builders: to set a custom default at compile time, #define PACKAGE_DATA_DIR in libtransmission/platform.c or tweak tr_getClutchDir () by hand.}}
 +
 
 +
Even if you use the graphical interface, you still need to install {{Pkg|transmission-cli}} in order for web interface to work.
 +
 
 +
==== Failed to set send/receive buffer ====
 +
 
 +
Transmission might display either of these messages in the journal on startup:
 +
 
 +
UDP Failed to set receive buffer: requested 4194304, got 425984
 +
UDP Failed to set send buffer: requested 1048576, got 425984
 +
 
 +
These can be fixed by setting {{ic|1=net.core.rmem_max=4194304}} and {{ic|1=net.core.wmem_max=1048576}} with [[sysctl]].
  
 
== See also ==
 
== See also ==
 
*[https://trac.transmissionbt.com/wiki Transmission wiki]
 
*[https://trac.transmissionbt.com/wiki Transmission wiki]
 
*[https://trac.transmissionbt.com/wiki/HeadlessUsage/General HeadlessUsage]
 
*[https://trac.transmissionbt.com/wiki/HeadlessUsage/General HeadlessUsage]

Latest revision as of 08:13, 16 August 2019

Transmission is a light-weight and cross-platform BitTorrent client.

Installation

There are several packages available to install Transmission with:

Configuring the GUI version

Both GUI versions, transmission-gtk and transmission-qt, can function autonomously without a formal back-end daemon.

GUI versions are configured to work out-of-the-box, but the user may wish to change some of the settings. The default path to the GUI configuration files is ~/.config/transmission.

A guide to configuration options can be found on Transmission's Github.

Transmission daemon and CLI

The commands for transmission-cli are:

transmission-daemon: starts the daemon.
transmission-remote: invokes the CLI for the daemon, whether local or remote, followed by the command you want the daemon to execute.
transmission-show: returns information on a given torrent file.
transmission-create: creates a new torrent.
transmission-edit: add, delete, or replace a tracker's announce URL.
transmission-cli: (deprecated in favor of transmission-remote) starts a non-daemonized local instance of transmission, for manually downloading a torrent.
tremc: (requires tremc-gitAUR) starts the curses interface for the daemon, whether local or remote.

Starting and stopping the daemon

Transmission's daemon can be run:

  • As the user transmission, by starting/enabling transmission.service using systemd. The user can be changed as explained in #Choosing a user.
  • As your own user, by running under your user name:
$ transmission-daemon

Starting the daemon will create an initial configuration file. See #Configuring the daemon.

The daemon can then be stopped with:

$ pkill -3 transmission-daemon

An alternative option to stop Transmission is to use the transmission-remote command:

$ transmission-remote --exit

Reducing journal spam

Running transmission-daemon can lead to a lot of unwanted journal entries. Output can be filtered by starting it with a small wrapper script. The following example also provides some notifications:

transwrap.sh
#!/bin/zsh
killall transmission-daemon 2> /dev/null
transmission-daemon --foreground --log-info 2>&1 | while read line; do
	echo $line |
		grep -v "announcer.c:\|platform.c:\|announce done (tr-dht.c:" |
		grep -v "Saved.*variant.c:" |
		while read line; do
			echo $line | grep -q "Queued for verification (verify.c:" &&
				notify-send --app-name="Transmission Started" "${line#* * }"
			echo $line | grep -q "changed from .Incomplete. to .Complete." &&
				notify-send --app-name="Transmission Complete" "${line#* * }"
			echo $line | systemd-cat --identifier="TransWrap" --priority=5
		done 2>&1 > /dev/null
	done&disown

Run only while connected to network

Netctl

It may only be desirable to run transmission on certain networks. The following script checks that the connection is to a list of authorized networks and then proceeds to launch transmission-daemon.

/etc/netctl/hooks/90-transmission.sh
#!/bin/bash

# The SSIDs for which we enable this.
declare -A ssids=(
    ["network_1"]=y
    ["network_2"]=y
)

if [[ ${ssids[$SSID]} ]]; then
    case $ACTION in
        CONNECT|REESTABLISHED)
            # Need to wait, otherwise doesn't seem to bind to 9091.
            sleep 30
            systemctl start transmission
            ;;
        *)
            systemctl stop transmission
            ;;
    esac
fi

Wicd

Create a start script in folder /etc/wicd/scripts/postconnect, and a stop script in folder /etc/wicd/scripts/predisconnect. Remember to make them executable. For example:

/etc/wicd/scripts/postconnect/transmission
#!/bin/bash

systemctl start transmission
/etc/wicd/scripts/predisconnect/transmission
#!/bin/bash

systemctl stop transmission

Choosing a user

Choose how you want to run transmission:

  • As a separate user, transmission by default (recommended for increased security).

By default, transmission creates a user and a group transmission, with its home files at /var/lib/transmission/, and runs as this "user". This is a security precaution, so transmission, and its downloads, have no access to files outside of /var/lib/transmission/. Configuration, operation, and access to downloads needs to be done with "root" privileges (e.g. by using sudo).

  • Under your own user.

To set this up, override the provided service file and specify your username:

/etc/systemd/system/transmission.service.d/username.conf
[Service]
User=your_username

Configuring the daemon

Create an initial configuration file by starting the daemon.

  • If running Transmission under the username transmission, the configuration file will be located at /var/lib/transmission/.config/transmission-daemon/settings.json.
  • If running Transmission under your own username, the configuration file will be located at ~/.config/transmission-daemon/settings.json.

One can customize the daemon by using a Transmission client or using the included web interface accessible via http://localhost:9091 in a supported browser.

A guide to configuration options can be found on the Transmission web site: https://github.com/transmission/transmission/wiki/Editing-Configuration-Files

Note: If you want to edit the configuration manually using a text editor, stop the daemon first; otherwise, it would overwrite its configuration file when it closes.
Note: Alternatively, the daemon can be instructed to reload its configuration with SIGHUP, by running kill -s SIGHUP `pidof transmission-daemon`.

A recommendation for those running under username transmission is to create a shared download directory with the correct permissions to allow access to both the transmission user and system users, and then to update the configuration file accordingly. For example:

# mkdir /mnt/data/torrents
# chown -R facade:transmission /mnt/data/torrents
# chmod -R 775 /mnt/data/torrents

Now /mnt/data/torrents will be accessible for the system user facade and for the transmission group to which the transmission user belongs. Making the target directory world read/writable is highly discouraged (i.e. do not chmod the directory to 777). Instead, give individual users/groups appropriate permissions to the appropriate directories.

Note: If /mnt/data/torrents is located on a removable device, e.g. with an /etc/fstab entry with the option nofail, Transmission will complain that it cannot find your files. To remedy this, you can add RequiresMountsFor=/mnt/data/torrents to /etc/systemd/system/transmission.service.d/transmission.conf in the section [Unit].

An alternative is to add your user to the transmission group (#usermod -a -G transmission yourusername) and then modify the permissions on the /var/lib/transmission and /var/lib/transmission/Downloads directories to allow rwx access by members of the transmission group.

Host whitelist

If you plan to access the Transmission daemon over the network using the server's hostname, you need to add this hostname to rpc-host-whitelist in settings.json. Otherwise, you will get a "421 Misdirected Request" error when accessing the server.

If you connect to the daemon using the server's IP-address, this is not required.

Watch dir

If you want to Automatically add .torrent files from a folder, but you find that the watch-dir and watch-dir-enabled options set in the config file do not work, you can start the transmission daemon with the flag -c /path/to/watch/dir.

If you're using systemd, edit the transmission.service unit as described in systemd#Editing provided units.

Enable IPv6

By default, the daemon only listens for IPv4 connections. To also listen for IPv6 connections, install transmission-cli-ipv6AUR (or transmission-cli-gitAUR, or wait for Transmission 3.0), and change the rpc-bind-address option to "::" in settings.json.

CLI Examples

If you want to remove all finished torrents you can use the following command with your own username and password

# transmission-remote -n 'username:password' -l | grep 100% | awk '{print $1}'| paste -d, -s | xargs -i transmission-remote -t {} -r

Web Interface

The GUI way

Once Transmission is installed, you can easily set up the web interface. All you need to do is click the edit menu and select preferences. Click the Remote tab and enable Allow remote access.

Here, you have the opportunity to change the default listening port from 9091.

Check the Use authentication and fill in a username and password so that authentication can be used.

To increase security, you can restrict access from any IP address by enabling Only allow these IP addresses.

Now you are ready to launch the web interface by either clicking on the Open web client, which makes your default web browser open it, or manually reaching http://TARGET_IP_ADDRESS:PORT with any supported web browser.

If you haven't changed the listening port, the default one is 9091. In this case, the link is http://localhost:9091

Note: Keep in mind that transmission-cli must be installed

The CLI way

You don't need a graphical interface to set up the web interface, the daemon offers the very same options. You can reach the web interface without specifing any flags. See #Starting and stopping the daemon

Nevertheless, you can specify everything that you see in the previous section:

$ transmission-daemon --auth --username arch --password linux --port 9091 --allowed "127.0.0.1"

is equivalent to

$ transmission-daemon -t -u arch -v linux -p 9091 -a "127.0.0.1"

Troubleshooting

Cannot access the daemon over the network

The daemon is started after network.service was initialised. However, if you enable the service dhcpcd as opposed to the device-specific service, such as dhcpcd@enp1s0.service for example, it may happen that Transmission is started too early and cannot bind to the network interface. Thus, the web interface is unreachable. A possible solution is to add the Requires line to the unit's configuration file:

/etc/systemd/system/transmission.service.d/fixdep.conf
[Unit]
Requires=network.target

Web interface cannot be reached

404: Not Found

Couldn't find Transmission's web interface files!

Users: to tell Transmission where to look, set the TRANSMISSION_WEB_HOME environment variable to the folder where the web interface's index.html is located.

Package Builders: to set a custom default at compile time, #define PACKAGE_DATA_DIR in libtransmission/platform.c or tweak tr_getClutchDir () by hand.

Even if you use the graphical interface, you still need to install transmission-cli in order for web interface to work.

Failed to set send/receive buffer

Transmission might display either of these messages in the journal on startup:

UDP Failed to set receive buffer: requested 4194304, got 425984
UDP Failed to set send buffer: requested 1048576, got 425984

These can be fixed by setting net.core.rmem_max=4194304 and net.core.wmem_max=1048576 with sysctl.

See also