Friday, March 09, 2007

Getting Started with rTorrent on Ubuntu

rTorrent is a ncurses-based BitTorrent client for Linux. It's a very lightweight client and is available on Ubuntu's universe repository. Just install using the following command:

~$ sudo apt-get install rtorrent

To run the client, just type rtorrent from gnome-terminal or press Alt+F2 and key in rtorrent in the resulting window. This will run rTorrent with default settings and save any torrents you load to the current working directory, but often that's not what you want. To customise rTorrent to your needs, you'll need to edit rTorrent's configuration file. By default, this file doesn't exist so you'll need to create one yourself.

~$ vim .rtorrent.rc

Substitute Vim with you text editor of choice. Below are the settings I use:

# Global upload/download rate in KiB. 0 for unlimited.
upload_rate = 30

# Default download directory
directory = ./Downloads

# Default session directory
session = ./.rtorrent/session

# Port range to use for listening
port_range = 49152-65535
port_random = yes

# Watch a directory for new torrents, and stop those that have been
# deleted.
schedule = watch_directory,5,5,load_start=./Downloads/*.torrent
schedule = untied_directory,5,5,stop_untied=

# rTorrent should try to use UDP trackers
use_udp_trackers = yes

# Check hash for completed torrents
check_hash = yes

# Use protocol encryption
encryption = allow_incoming,try_outgoing,enable_retry,prefer_plaintext

# Enable DHT as needed
dht = auto
dht_port = 6881

# Enable peer exchange
peer_exchange = yes

There's more settings available that you can tinker with from the website. Simply download a copy of rtorrent.rc and rename to .rtorrent.rc in your home folder and uncomment/tweak the features you wish to use. There's a "Common rTorrent Tasks for Dummies" available with explanations for various configuration options.

Note: .rtorrent.rc was named .rcrtorrent.rc in older rTorrent releases.

With that your rTorrent client should be up 'n running. Happy downloading! ;-)

Related posts:

A rTorrent command reference
Common rTorrent commands