Install Transmission with web interface on Ubuntu

Transmission bittorrent is probably the most common bittorent client for Linux platforms. Transmission web interface is like a thin client yet feature-rich and aesthetically pleasing. Bittorrent client for Windows and Linux are both available. I have previously written articles on how to install Deluge with webui on Lucid Lynx server and Precise Pangolin server. I initially started with Deluge but Transmission quickly became my favorite due to its simplicity, ease of install, and yet feature-full webui. In this post, I provide instructions on how to setup server running Ubuntu 12.04 with Transmission (with or without gui interface and with web interface). This method works on previous versions of Ubuntu as well (>10.04). While this post explains how to run Transmission web interface on a headless server, if you are running a desktop environment, installing a Gtk or Qt interface is just one step away.

Atomic-Toolkit-LogoLooking for an automated solution? Try our AtoMiC ToolKit, which makes installation and management of Home Server software such as SickBeard, CouchPotato, Torrent clients, etc. easy.

About Transmission

Install Transmission With Web InterfaceTransmission is a completely free open-source application.

Transmission's website describes it as:

Easy: Transmission is designed for easy, powerful use. We've set the defaults to "Just Work" and it only takes a few clicks to configure advanced features like watch directories, bad peer blocklists, and the web interface. When Ubuntu chose Transmission as its default BitTorrent client, one of the most-cited reasons was its easy learning curve.

Lean: In separate benchmarks, Linux Format and Lacrocivious both found Transmission to use less CPU than any other GUI client. It even used less CPU than some non-GUI clients. Transmission also has the lowest memory footprint of any major BitTorrent client.

Native: Unlike many cross-platform applications, Transmission integrates seamlessly with your operating system. The Mac OS X interface is written in Objective-C and uses Growl notifications and dock badging to keep you informed. The GTK+ interface has been carefully written to follow the GNOME Human Interface Guidelines. If your desktop supports popup notifications, desktop sounds, and a system tray, the GTK+ interface will make use of them.

Powerful: Transmission has the features you want from a BitTorrent client: encryption, a web interface, peer exchange, magnet links, DHT, µTP, UPnP and NAT-PMP port forwarding, webseed support, watch directories, tracker editing, global and per-torrent speed limits, and more.

In addition, it has a wealth of addons and other relevant applications.

Step 1: Add Transmission PPA Repository

Transmission is readily available in Ubuntu repository. However, Ubuntu repository is usually a bit slow on updating versions. So if you are like me and would like to have the latest version as soon as possible, then add the PPA repository as described below. If not proceed to step 2.

sudo add-apt-repository ppa:transmissionbt/ppa

Step 2: Install Transmission Web Interface

Then update packages list and install Transmission:

sudo apt-get update
sudo apt-get install transmission-cli transmission-common transmission-daemon

If you want the full desktop gui software then use:

sudo apt-get update
sudo apt-get install transmission-gtk transmission-cli transmission-common transmission-daemon

Step 3: Configure Users and Permissions

It is recommended that Transmission runs under it's own username for security reasons. This creates a few issues with file and folder access by Transmission as well as your account (let us assume it is user). You will have to create a new set of folders for Transmission to read/write/execute (example: transmission folder containing these subfolders: completed, incomplete, and torrents). The account user also needs full control over these folders and their contents. I recommend reading this post to familiarize yourself with safely changing user groups and permissions.

First, cd to the desired folder and create a folder for Transmission to use:

cd /home/user/Downloads
mkdir transmission
cd transmission
mkdir completed incomplete torrents

Then, add the username user to the group debian-transmission:

sudo usermod -a -G debian-transmission user

This will add debian-transmission as a secondary group to the account user, resulting in access to both Transmission and user. Then, change the ownership of the Transmission download folders to the group debian-transmission:

sudo chgrp -R debian-transmission /home/user/Downloads/transmission

Next, change the permissions for the transmission download folders to allow read, write, and execute for Transmission and user:

sudo chmod -R 775 /home/user/Downloads/transmission

This gives the group debian-transmission, of which both Transmission and user are members of, full access while others get only read and execute permissions. If you want to further restrict access for others you could use 774 (read only) or 770 (no access).

Best Standalone Bittorrent Downloaders:

Finally, as described later, you will also have to set the umask parameter in Transmission's settings file to "2" (default is 18) for the account user to have full access to files/folders created by Transmission.


Continue to next page
to fully install Transmission ...

Step 4: Starting and Stopping Transmission Daemon

After install Transmission, the daemon will be started automatically (but not accessible yet). Starting and stopping Transmission daemon is pretty straightforward. You can start and stop Transmission daemon using the following commands:

sudo service transmission-daemon start
sudo service transmission-daemon stop

For convenience, you could create bash aliases as described in this post. For example, transstart could execute sudo service transmission-daemon start.

Restarting (or reloading) Transmission daemon can be tricky. Restarting the the daemon (while it is already running) would rewrite the Transmission settings files to its original state. In other words, restarting the Transmission daemon would reset all the custom settings you saved. If Transmission is running, always reload the service:

sudo service transmission-daemon reload

Or, add the following bash aliases to /home/user/.bash_aliases:

alias transstop='sudo service transmission-daemon stop'
alias transstart='sudo service transmission-daemon start'
alias transreload='sudo service transmission-daemon reload'

Step 5: Move Default Settings File

To make the Transmission daemon accessible through the web interface, the configuration files have to be edited and Transmission daemon reloaded. The configuration file is this: /etc/transmission-daemon/settings.json. Edit the file as needed. In order to protect your settings from being accidentally re-written (example: if you accidentally restart Transmission instead of reload), I like to save the actual settings file in a safe location and creating a symbolic link to it inside /etc/transmission-daemon/. This way, even if Transmission accidentally overwrites settings.json all you have to do is re-create the symbolic link.

First, backup the default settings file /etc/transmission-daemon/settings.json:

cd /etc/transmission-daemon
sudo cp -a settings.json settings.json.default

Then create a transmission settings directory in your home folder (example: /home/user/.config/transmission-daemon), copy settings.json into it, and change its permissions to make it accessible to transmission-daemon:

mkdir /home/user/.config/transmission-daemon
sudo cp -a /etc/transmission-daemon/settings.json transmission-daemon/
sudo chgrp -R debian-transmission /home/user/.config/transmission-daemon
sudo chmod -R 770 /home/user/.config/transmission-daemon

Then, remove /etc/transmission-daemon/settings.json, create a symbolic link in the /etc/transmission-daemon folder, and edit it permissions to make it accessible to Transmission and the user account:

cd /etc/transmission-daemon
sudo rm settings.json 
sudo ln -s /home/user/.config/transmission-daemon/settings.json settings.json
sudo chgrp -R debian-transmission /etc/transmission-daemon/settings.json
sudo chmod -R 770 /etc/transmission-daemon/settings.json

You can now start editing /home/user/.config/transmission-daemon/settings.json without worries of losing your settings.

Step 6: Edit Transmission Configuration Files

My recommendations are to set at least the following as a starting point:

"download-dir": "/path/to/downloads/folder",
...
"incomplete-dir": "/path/to/incomplete/folder",
"incomplete-dir-enabled": true,
...
"rpc-authentication-required": true,
"rpc-bind-address": "0.0.0.0",
"rpc-enabled": true,
"rpc-password": "password",
"rpc-port": 9091,
"rpc-username": "username",
"rpc-whitelist": "127.0.0.1,*.*.*.*",
"rpc-whitelist-enabled": true,
...
"umask": 2,
...
"watch-dir": "/media/datadrive/downloads",
"watch-dir-enabled": true

The default rpc-username and password is "transmission".

Change it to whatever you want (any password will work). After next restart the password will be rewritten in SHA1 encrypted format for security reasons. Below is a modified example of my settings.json file.

{
    "alt-speed-down": 500, 
    "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": 1, 
    "bind-address-ipv4": "0.0.0.0", 
    "bind-address-ipv6": "::", 
    "blocklist-enabled": false, 
    "blocklist-updates-enabled": true, 
    "blocklist-url": "http://www.example.com/blocklist", 
    "cache-size-mb": 4, 
    "dht-enabled": true, 
    "download-dir": "/home/user/Downloads/", 
    "download-limit": 100, 
    "download-limit-enabled": 0, 
    "encryption": 2, 
    "filter-mode": "show-all", 
    "idle-seeding-limit": 30, 
    "idle-seeding-limit-enabled": false, 
    "incomplete-dir": "/home/user/Downloads/incomplete", 
    "incomplete-dir-enabled": true, 
    "inhibit-desktop-hibernation": false, 
    "lazy-bitfield-enabled": true, 
    "lpd-enabled": false, 
    "main-window-height": 500, 
    "main-window-is-maximized": 0, 
    "main-window-layout-order": "menu,toolbar,filter,list,statusbar", 
    "main-window-width": 467, 
    "main-window-x": 50, 
    "main-window-y": 50, 
    "max-peers-global": 200, 
    "message-level": 2, 
    "minimal-view": false, 
    "open-dialog-dir": "/home/user", 
    "open-file-limit": 32, 
    "peer-congestion-algorithm": "", 
    "peer-limit-global": 240, 
    "peer-limit-per-torrent": 60, 
    "peer-port": 9058, 
    "peer-port-random-high": 9098, 
    "peer-port-random-low": 9026, 
    "peer-port-random-on-start": true, 
    "peer-socket-tos": "default", 
    "pex-enabled": true, 
    "play-download-complete-sound": true, 
    "port-forwarding-enabled": false, 
    "preallocation": 1, 
    "prefetch-enabled": 1, 
    "prompt-before-exit": true, 
    "proxy": "", 
    "proxy-auth-enabled": false, 
    "proxy-auth-password": "", 
    "proxy-auth-username": "", 
    "proxy-enabled": false, 
    "proxy-port": 80, 
    "proxy-type": 0, 
    "ratio-limit": 1.5, 
    "ratio-limit-enabled": true, 
    "rename-partial-files": true, 
    "rpc-authentication-required": true, 
    "rpc-bind-address": "0.0.0.0", 
    "rpc-enabled": true, 
    "rpc-password": "wfsdfasdfwf234sdf28b453906c3wer235sarthtys4usXRA", 
    "rpc-port": 9025, 
    "rpc-url": "/transmission/", 
    "rpc-username": "username", 
    "rpc-whitelist": "127.0.0.1,*.*.*.*", 
    "rpc-whitelist-enabled": true, 
    "script-torrent-done-enabled": false, 
    "script-torrent-done-filename": "", 
    "show-backup-trackers": false, 
    "show-desktop-notification": true, 
    "show-extra-peer-details": false, 
    "show-filterbar": true, 
    "show-notification-area-icon": false, 
    "show-options-window": true, 
    "show-statusbar": true, 
    "show-toolbar": true, 
    "show-tracker-scrapes": false, 
    "sort-mode": "sort-by-name", 
    "sort-reversed": false, 
    "speed-limit-down": 0, 
    "speed-limit-down-enabled": false, 
    "speed-limit-up": 1, 
    "speed-limit-up-enabled": true, 
    "start-added-torrents": true, 
    "statusbar-stats": "total-ratio", 
    "trash-original-torrent-files": false, 
    "umask": 2, 
    "upload-limit": 100, 
    "upload-limit-enabled": 0, 
    "upload-slots-per-torrent": 4, "user-has-given-informed-consent": true, 
    "utp-enabled": true, 
    "watch-dir": "/home/user/Downloads/torrents", 
    "watch-dir-enabled": true
}

In the example settings.json shown in previous page, note that I changed all the ports to non-default ports for security reasons. For further security you may want to allow web interface access only within your local network. If so, change "rpc-whitelist" value to "127.0.0.1,192.168.*,*".

Save the settings and exit. You will now have to reload transmission-daemon to apply the new settings.

sudo service transmission-daemon reload

Do not forget to setup port forwarding on your router to divert Transmission traffic to the right computer running Transmission daemon on your home network (if you are behind a router).

Transmission Web Interface Screenshot
Transmission Web Interface Screenshot
Transmission Gtk Desktop Interface
Transmission Gtk Desktop Interface

If you do decide to install the Desktop GTK interface, then most of the settings, including enabling web interface, can be set from within the gui interface (pictures below):

Transmission Download Folders Settings
Transmission Download Folders Settings
Transmission Web Client Settings
Transmission Web Client Settings

If you like to be able control your deluge daemon through android phone, refer to this post.

Step 7: Apache proxy for Transmission Web Interface (optional)

To access the web interfaces using port numbers (eg. http://myserver.com:9091) is cumbersome. When possible, I like to create proxies for easier access (eg. http://myserver.com/transmission). If you are interested in setting up this please refer to this post.

If you SSL is enabled on your server you could redirect Transmission web interface to a secure HTTPS connection, thereby all information is encrypted during transfers. Below is an example of /etc/apache2/mods-available/proxy.conf on a LAMP server:

ProxyRequests Off
<proxy *>
     AddDefaultCharset off
     Order Allow,Deny
     Allow from all
</proxy>
ProxyPass /transmission http://localhost:9025/transmission
ProxyPassReverse /transmission http://localhost:9025/transmission
Redirect permanent /trans https://myserver.com/transmission/web/

Don't forget to enter the correct port number. The last line is optional (to redirect to a secure HTTPS connection), and automatically redirects http://myserver.com/trans to https://myserver.com/transmission/web (you have to have SSL enabled on your server).

Best Standalone Bittorrent Downloaders:

Step 8: Setting up Dynamic DNS (optional)

If you would like to be able to access your Transmission web interface from the internet then it might be easier to setup Dynamic DNS service. This way you can reach your server with a nice URL (example: http://mytransmission.dyndns.org) instead of the http://ipaddress:port. You can get free domain names through services like DynDns.com. For a guide to setup DDNS autoupdate client on Linux, refer to this post.

That is it. Enjoy your transmission and do share your experiences in the comments section.

Be the 1 in 200,000. Help us sustain what we do.
104 / 150 by Dec 31, 2024
Join Us (starting from just $1.67/month)

Anand

Anand is a self-learned computer enthusiast, hopeless tinkerer (if it ain't broke, fix it), a part-time blogger, and a Scientist during the day. He has been blogging since 2010 on Linux, Ubuntu, Home/Media/File Servers, Smart Home Automation, and related HOW-TOs.