Using rtorrent on Linux like a pro .

One day I decided to completely switch to the Linux/Ubuntu . Ubuntu came with transmission by default . But I did not like it much as it was not upto my expectations . Then I tried few others and I found myself settled with the Vuze as I was familiar with it and I was getting decent speeds . But after one update it was heavily utilizing system resources and  such a behavior is just not acceptable . So I dumped it and started looking for something else . One day at some forum I read a post about rtorrent . So I installed it and started playing with it . But my initial experience with it was not so good and it took me about one week to completely understand it and use it efficiently .  Now I am using rtorrent without any problem. It just blows away every other client with its speed , efficiency and elegance . I am going to write this tutorial so that others can benefit from my experience and they don’t have to face the problems that I faced . This tutorial will be mainly targeted towards Ubuntu users but it will be equally helpful for the users of any other Linux distro . This tutorial is divided into 3 sections i.e. Installation , Configuration and Usage . So here I go :

INSTALLATION :

Installation of rtorrent is very simple , simply follow the below steps

1. For Ubuntu and Debian users just issue the following command :

sudo apt-get update
sudo apt-get install rtorrent

And this will install the rtorrent for you .
2. For Fedora users just issue the following command :

sudo yum install rtorrent

Now rtorrent is installed on your system .
3. For those who want to install by compiling from source can download the latest version from here

If there is any problem installing it from source then ask me for help in the comments .

4. To check if rtorrent is correctly installed you can run from terminal by typing

rtorrent

When you will first start it , it will show a warning that configuration file .rtorrent.rc not found .Just ignore it .
I suggest that you never run rtorrent as a root .

CONFIGURATION :

Before we begin configuration you need to create few directories which will be used by rtorrent . Suppose that your user name is foo . Then the user foo will create the following directories .

1. Default directory to save the downloaded torrents. Open your terminal and issue the following command without root (sudo) .

mkdir /home/foo/rDownloads

The above command will create a directoy named rDownloads in your home directory where your dowloaded torrents will be saved automatically . Remeber that you must change foo with your own username .

2. Default session directory . This is very important as it will contain data related to your download , paused , completely torrents .

mkdir /home/foo/session

This will create a directory in your home directory of name session and it will be used by rtorrent to save its current session .

Alright now you have created the directories required so now we can move on to the actual configuration part . So first of all download this files and save it on your computer.

Now open the file with your favorite text editor . You will a long file with some stuff in it . Well all this stuff is what we are going to configure now . The first thing that you will see is something like this :

# Maximum and minimum number of peers to connect to per torrent.
#min_peers = 40
#max_peers = 100

Now change it to exactly as shown below

# Maximum and minimum number of peers to connect to per torrent.
min_peers = 50
max_peers = 80

Now the next thing to change is this :

# Maximum number of simultanious uploads per torrent.
#max_uploads = 15

change it to this :

# Maximum number of simultanious uploads per torrent.
max_uploads = 4

Now change this :

# Global upload and download rate in KiB. "0" for unlimited.
#download_rate = 0
#upload_rate = 0

Into this :

# Global upload and download rate in KiB. "0" for unlimited.
download_rate = 0
upload_rate = 50

Now change this :

# Default directory to save the downloaded torrents.
#directory = ./

Into this :

# Default directory to save the downloaded torrents.
directory = /home/foo/rDownloads

(replace foo with your username)

Now change this :

# Default session directory. Make sure you don't run multiple instance
# of rtorrent using the same session directory. Perhaps using a
# relative path?
#session = ./session

Into this :

# Default session directory. Make sure you don't run multiple instance
# of rtorrent using the same session directory. Perhaps using a
# relative path?
session = /home/foo/session

(replace foo with your username)

Now change this :

# Port range to use for listening.
#port_range = 6890-6999

Into This :

# Port range to use for listening.
port_range = 60125-64125

Now change this :

# Start opening ports at a random position within the port range.
#port_random = no

Into This :

# Start opening ports at a random position within the port range.
port_random = yes

Now change This :

# Check hash for finished torrents. Might be usefull until the bug is
# fixed that causes lack of diskspace not to be properly reported.
#check_hash = no

Into This :

# Check hash for finished torrents. Might be usefull until the bug is
# fixed that causes lack of diskspace not to be properly reported.
check_hash = yes

Now change this :

# encryption = allow_incoming,enable_retry,prefer_plaintext

Into This:

 encryption = allow_incoming,try_outgoing ,enable_retry

Now change this :

# dht = auto

# UDP port to use for DHT.
#
# dht_port = 6881

# Enable peer exchange (for torrents not marked private)
#
# peer_exchange = yes

Into This:

dht = auto

# UDP port to use for DHT.
#
 dht_port = 63425

# Enable peer exchange (for torrents not marked private)
#
 peer_exchange = yes

Alright now your configuration is complete . Now save the file and copy the file into your home (/home/foo) directory . And issue the following command .

 mv rtorrent.rc /home/foo/.rtorrent.rc

This command is simply to hide the rtorrent.rc file

USAGE :
Now using rtorrent is very simple . Open your terminal and write

rtorrent

without root and hit enter
you will see a screen like below

To demonstrate the usage to rtorrent we will download the latest version of Ubuntu from here via torrent . So download the torrent file and save it in your computer . I downloaded the file and saved it in /home/harbhag/ where harbhag is my username for the system .

Now hit ENTER and the above screen will change to the one like below :

Here you can see that in the end of the screen is load> , so here rtorrent is asking to load the torrent file to start download .

Now press TAB and you will a screen like the one below

Here it is showing the list of all the Directories and files present in my home directory . Now you can see that in the end of the list it is showing torrent file that i just downloaded . If you also saved the file in your home directory then you will also see this file (ubuntu-10.04-desktop-i386.iso[www.tuxdistro.com].torrent) along with the other files and directories present in your home directory .

Now enter u (first letter for the torrent file) and hit TAB and it will automatically load the torrent file for you like below .

Now hit ENTER and your screen change to the one like below :

your torrent is loaded now but its not downloading yet to start the download press UP or DOWN arrow and you will see stars in front of the name of torrent you just added like below :

Now press Ctrl key and s key together (i.e. Ctrl+s) and your torrent will start downloading and the numbers on the bottom of the screen will start changing . Congratulations now your have successfully loaded your first torrent in the rtorrent .

To stop the downloading press Ctrl+d and your torrent will stop and if you press Ctrl+d the torrent will got deleted . To quit the rtorrent first stop all the torrents you are downloading by pressing Ctrl+d and then press Ctrl+q to quit the rtorrent . If you will press the RIGHT arrow key while the stars are in front of the torrent , then you will see a screen like below :

Here you can find lots of information regarding peers and trackers and many more . To exit from this screen to go back to previous screen just press the LEFT arrow key .

So thats all for now . If you have any problem regarding this tutorial or you are having slow speed or your are not able to do anything i explained here then you can ask me for help in the comments . Good luck ,cheers .

Improvements :

Well one of my reader(Ellidi) suggested me in comments that torrents should be loaded in to rtorrent automatically as adding them manually is little more overhead . So now I am going to explain how to do it . You need to change the file (rtorrent.rc to make this feature work . So open the file and change it as below :

gedit /home/foo/.rtorrent.rc

and change this :

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

Into this :

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

And then create the watch directory

mkdir /home/foo/watch

And dont forget to replace foo with you username .
So from now on rtorrent will automatically start downloading the torrents that you will save in watch (/home/foo/watch) directory . And if you will delete the torrent from the rtorrent , it will be automatically deleted from the watch directory .

55 thoughts on “Using rtorrent on Linux like a pro .

  • June 30, 2010 at 5:09 pm
    Permalink

    Do you know how to use magnet links in rtorrent?

    Reply
      • July 1, 2010 at 2:39 am
        Permalink

        But I did compile it.
        I have version 0.8.6/0.12.6
        When I load-start magnet link I get this message:
        Could not open file: “magnet:?xt=urn:…”

        Reply
      • February 20, 2012 at 1:02 pm
        Permalink

        I have rtorrent commandline client installed in ubuntu 10.04 ..I use magnet url to download torrrent.
        I am witing a program which will receive info hash of torrent as input and find out whether seeeding for that torrent has started or not ?

        Can you tell me any why through which i come to know ?

        With Best WIshes

        Reply
    • January 5, 2014 at 12:20 pm
      Permalink

      hey dev, i did exactly that by doing
      rtorrent “my-magnetic-link”

      Reply
  • June 30, 2010 at 6:02 pm
    Permalink

    You can make the torrents autoload from a directory. This is too much of a bother, don’t you think?

    Reply
    • June 30, 2010 at 6:33 pm
      Permalink

      I myself use this feature but i thought it may be more of learning to explain how to add torrents manually . But as you pointed out this , so I will add this to the tutorial . Thanks for your suggestion . Keep em coming .

      Reply
  • June 30, 2010 at 6:24 pm
    Permalink

    I’ve been using Transmission for years. I’m curious what version you were trying out. Older versions were seriously deficient. On the other hand, I’ve never tried uTorrent, and I’ve heard that is the sin qua non of graphical torrent clients.

    Reply
    • June 30, 2010 at 6:36 pm
      Permalink

      I never had any problem with the efficiency of the transmission . But I had very strange problem with that . My ISP throttles my bittorrent speed so I never got max speeds in transmission even if I used highest encryption . This is the only problem that kept me from using transmission as my default client .

      Reply
  • Pingback: Best Lightweight Applications for Linux . « Tech Simplified

  • February 22, 2011 at 2:58 am
    Permalink

    I’m very confused…your example says: “To demonstrate the usage to rtorrent we will…download the torrent file and save it in your computer.” Then it says: “Now you can see…torrent file that i just downloaded .”, and then: “your torrent is loaded…Now press Ctrl key and s key together (i.e. Ctrl+s) and your torrent will start downloading.” My question is, if i’ve already downloaded a torrent, why are you telling me to download it again, using rtorrent? Isn’t that a waste of time and disk space? Is there a way to use rtorrent to download a new torrent file, that you haven’t previously downloaded? If I want to download a torrent from a website, can I do that ONLY using rtorrent?

    Reply
    • February 22, 2011 at 6:02 am
      Permalink

      The second time I said to download torrent, that means I am talking about actual contents of that torrent and not the .torrent file itself. I am sorry if its confusing to you , I will try to update the article as I will get time.

      Reply
  • August 12, 2011 at 3:14 am
    Permalink

    is there any way to limit the number of active torrents to one?
    thanks in advance!

    Reply
  • August 12, 2011 at 3:16 am
    Permalink

    also, can we schedule rtorrent to run only for specific durations in a day like we can in deluge/utorrent?

    Reply
  • Pingback: Cómo descargar con Bittorrent desde consola (¡perfecto para VPS!)

  • Pingback: Cómo descargar con Bittorrent desde consola (¡perfecto para VPS!) | Tutoriales de Informática

  • January 21, 2012 at 11:37 pm
    Permalink

    A much better torrent client is Tixati. Tixati is way better than any of the above mentioned clients. I use it all the time for chatting and searching and sharing. Chatting is the funnest part.

    Reply
  • March 11, 2012 at 5:11 am
    Permalink

    Why would you want to chat in a torrent client? I’d rather want a torrent client that is focused on downloading torrents. Chatting is better done with a dedicated chat program.

    Reply
  • March 26, 2012 at 3:57 am
    Permalink

    Hello,
    Wouldn’t it make sense to use
    ~
    (tilde sign) instead of writing
    /home/foo
    everywhere and constantly reminding to use actual username?
    ~ is shorthand to /home/

    Nice rtorrent tutorial though 🙂 I’m using rtorrent myself.

    Reply
    • April 29, 2012 at 12:43 pm
      Permalink

      I want to know how much Total data my rtorrent 0.8.9 uploaded or seeded ???
      I am interested in building statistics. I tried installing Pyroscope but could not succeeded yet

      Reply
  • Pingback: Ubuntu BT 命令 — rtorrent « 我愛,故我在 — I love, therefore I am

  • September 21, 2012 at 8:11 pm
    Permalink

    Hmm the torrent stops seeding when i close Putty? or will it still keep on seeding? if it stops seeding can you please tell me how to make it so it seeds 24/7?

    Reply
    • November 11, 2012 at 7:41 pm
      Permalink

      Install ‘screen’ program on remote computer. Then issue command like this:
      screen rtorrent
      And that’s about it. Your seeding will continue after you turn off ssh or putty or whatever session. When you connect again, issue screen -r command and you’ll be reconnected. Reading screen manual won’t hurt though 🙂

      Reply
    • November 12, 2012 at 1:00 am
      Permalink

      If you start rtorent within a screen session it should keep running even when you detach and log off. Are you getting other results?

      Reply
  • Pingback: Best Lightweight Apps for Linux » Linux Shtuff

  • May 8, 2013 at 1:23 am
    Permalink

    I am getting an error “Using ‘epoll’ based polling.”,when i enter the filename and press enter….!!

    Reply
    • May 13, 2013 at 7:20 pm
      Permalink

      You are issuing command while not selecting file to which that command should be applied. You can choose file by tapping up/down keys on your keyboard.

      Reply
    • May 13, 2013 at 7:26 pm
      Permalink

      Use ^k command to pause torrent. That is:
      1. Chose file you want to pause using up/down keys
      2. Press Ctrl key and while holding it, tap letter K key
      3. Release Ctrl key

      Use ^s command to resume:
      1. Chose file you want to pause using up/down keys
      2. Press Ctrl key and while holding it, tap letter S key
      3. Release Ctrl key

      Reply
  • September 16, 2013 at 4:22 pm
    Permalink

    Can i log those stats (peers,seeders,uploaded bytes…etc) into a file ?

    Reply
  • Pingback: rtorrentの使い方 |

  • Pingback: Cómo descargar con Bittorrent desde consola

  • November 13, 2014 at 7:42 pm
    Permalink

    Ok, but I still need to make the changes you described above, don’t I?

    Reply
    • November 13, 2014 at 9:20 pm
      Permalink

      yes you need to apply changes described above. On Nov 13, 2014 7:42 PM, “Tech Simplified” wrote:

      >

      Reply
  • November 16, 2014 at 2:18 am
    Permalink

    10x for your reply, but would you help me with this too (I get the message when hitting Ctrl+S) :

    *** rTorrent 0.9.2/0.13.2 – hittman:1992 ***
    [View: main]
    * Replay Media Catcher v5.0.1.54 + Crack.7z
    * [CLOSED] 0.0 / 20.4 MB Rate: 0.0 / 0.0 KB Uploaded: 0.0 MB
    * Hashing: Storage error: [Hash checker was unable to map chunk: Permission denied]

    And one more thing: When you say that we should ignore the message “.rtorrent.rc not found”, why the configuration and putting it in the directory?
    Is there a way to change the directory for that file?
    I am using koding.com (a linux virtual machine, maybe would be useful for you to know it) and it is a little bit tricky to put files in the user directory..

    10x again

    Reply
  • Pingback: Cómo descargar con Bittorrent desde consola (¡perfecto para VPS!)

  • January 22, 2015 at 1:02 am
    Permalink

    thanks for this, really help me

    Reply
  • Pingback: List of GUI Based Torrent clients - Popular Ubuntu Questions

  • July 1, 2015 at 8:47 am
    Permalink

    the download that it links “this” in “Configuration part 2.” isn’t available anymore. I have no problem using a text editor to change a file in terminal but I don’t know what I should download in place of the “this” file. The site took it down because of violation of terms of service.

    Reply
    • July 3, 2015 at 2:01 am
      Permalink

      I will update tutorial with new file. On Jul 1, 2015 8:47 AM, “Tech Simplified” wrote:

      >

      Reply
  • Pingback: Tutorial : Using rtorrent on Linux like a pro . | Tech Simplified | Web Collection

  • October 17, 2015 at 10:32 pm
    Permalink

    “this’ file still missing. Is it possible to upload it to another site? pastebin maybe?

    Reply
  • Pingback: VPS的正确用法之——离线网盘rTorrent | Wang‘s Press

  • Pingback: rTorrent - Davut KARA

  • Pingback: Tutorial : Using rtorrent on Linux like a pro . | Tech Simplified

Leave a Reply

%d bloggers like this: