Raspberry Pi and Arch Linux – Install rTorrent and its interface web ruTorrent

With the switches of a Debian to ArchLinux, I re-install all my tools one by one. So logically, I had to reinstall rTorrent for torrents. It is the purpose of this article.


A condition for this article is to have installed Nginx. For more help to set up the web server, you will find a tutorial here.

  1. Install rTorrent with its dependencies
    Pacman-s rtorrent
  2. Add a user rtorrent
    adduser rtorrent
  3. Copy the default configuration file in the directory of the user who will run rTorrent
    CP /usr/share/doc/rtorrent/rtorrent.rc /home/rtorrent/.rtorrent.rc
  4. Modify the configuration file to the directories that agree you
    Directory = ~/torrent/data
    session = ~/torrent/session
    Schedule = watch_directory,15,15,load_start=~/torrent/torrent_active/*.torrent
  5. It may be useful/necessary to force scrutiny of the hash to the launch of rTorrent or at the end of the downloads
    check_hash = yes
  6. Change the owner of the file .rtorrent.RC as you have just done with the user root
    chown rtorrent:users /home/rtorrent/.rtorrent.rc
  7. Install dtach
    Pacman-s dtach
  8. In /etc/rc.d create the file rtorrent next
    . /etc/rc.conf
    . /etc/rc.d/functions NAME = rtorrent SCRIPTNAME=/etc/rc.d/rtorrentd
    # path of the temporary file TMP=/tmp/rtorrent.dtach
    # user who launches the torrent USER = $NAME
    # chemin vers fichier conf CONF=/home/$USER/.rtorrent.rc case "$1" in start)
        stat_busy "Starting rtorrent"
        su-l $USER UI "dtach n $TMP n o import rtorrent = $CONF"
        chmod 666 /tmp/rtorrent.dtach if [ $? -GT 0 ]; then stat_fail else add_daemon rtorrent stat_done fi
        stat_busy "Stopping rtorrent"
        killall w s 2 /usr/bin/rtorrent &> /dev/null if [ $? -GT 0 ]; then stat_fail else rm_daemon rtorrent stat_done fi
        $0 stop sleep 1
        $0 Start
        echo "use: $0 {Start|stop|restart}"
    esac exit 0
  9. Edit the file /etc/rc.conf to add the start of rtorrent at boot (the @ allows to run in the background without waiting for the end of its execution)
    DAEMONS =(hwclock syslog-ng network netfs crond sshd @samba @rtorrent)
  10. You can already test the boot manually

    Raspberry Pi Home Server - Arch Linux - Installer rTorrent et son interface web ruTorrent

    Test start and stop of rtorrent

  11. Download ruTorrentrutorrent - 3.5.tar.gz
  12. Unpack the archive in /var/www
  13. Change the Directory rights
    chown-r http:http/var/www/rutorrent
  14. Edit the Nginx configuration file. Add the following lines in the block server from /etc/nginx/nginx.conf
    rental /RPC2 {
     scgi_pass unix:/Home/rtorrent/SCGI.Socket;
     include scgi_params;
  15. Change ruTorrent setting in the file /var/www/rutorrent/conf/config.php
    $scgi_port = 0;
    $scgi_host = "UNIX:////Home/rtorrent/SCGI.Socket";
  16. Change the setting of rTorrent. Add the following lines at the end of the /home/rtorrent/.rtorrent.rc file
    scgi_local =/home/rtorrent/scgi.socket execute = chmod,UG = rw,o = rw,/Home/rtorrent/SCGI.Socket execute = chgrp,users,/Home/rtorrent/SCGI.Socket
  17. Restart Nginx and rTorrent

You found what to have enough free disk space !

You may also like...

  • Kelm

    Hi Chris, used you always this method for your seedbox?

    I just spent 4 hours on the nginx trio rtorrent and rutorrent

    I looked at more than a dozen of tutorials on the Web, without success

    rutorrent me reference 2 errors:

    [15.03.2013 17:48:35] WebUI started.

    [15.03.2013 17:48:35] Bad response from server: (404 [error,getplugins]) File not found.

    [15.03.2013 17:48:36] Bad response from server: (404 [error,getuisettings]) File not found.

    have you encountered this prb during your first install?

    • Hello,
      J’ai rencontré de nombreux soucis lors de ma première installation 😉
      The error seems to come from rutorrent. Have you looked at the logs of nginx ? It is as if rutorrent was a reading and the server sends back an error.

  • Kelm

    How do you actually use rpc?

    you spend not the plugin:





    a way to use mod_scgi with nginx?

    je comprends pas ou ca bloque 🙁

    Please give me a little help if you already meet the prb

    otherwise I want to waste time, I simply question.

    • Hello
      The SCGI module is integrated in CIMS. Donc rien à faire 😉

  • Kelm

    Ah yes indeed I just see ca, and nginx manages basic since version 0.8

    So yes I do not really know. I tried the svn version and the version rutorrent package. the loose.

  • Kelm

    for nginx logs I have ca:

    2013/03/15 19:18:32 [error] 763#0: *23 FastCGI feels in stderr: “Primary script unknown” while reading response header from upstream, client:, server: localhost, request: “POST /php/getsettings.php HTTP/1.1”, upstream: “FastCGI://UNIX:/var/run/PHP-fpm/PHP-fpm.sock:”, host: “”, referrer: “”

    I used the same part than you in your nginx archlinux tutorial

    but I do not understand too much how does fastcgi

    so I spend a lot of time to test without great result

    I understand the global logic,happening by whom to do what

    I know the principle of sockets under linux/unix but fastcgi

    et php pas du tout je ne connais rien en web 🙁

    • Basic, is that a simple PHP file with the phpinfo function works ?

  • Kelm

    to avoid you to repeat I followed the approach to test you to posted comment on : http://pihomeserver.wordpress.com/2013/01/16/raspberry-pi-home-server-arch-linux-installer-nginx-avec-support-php/

    so in order:

    >First step : Nginx. What if you put an index.html file (which displays a >bogus stuff), the HTML page works ?

    Yes an html page passes without prb

    >2ND stage : php. What is your process runs well (with a ps command >for example) ? What is your site's configuration in Nginx on the PHP side ?

    Yes php - fpm runs well (ps aux)

    PHP - fpm: master process (/etc/php/PHP-fpm.conf)

    PHP - fpm: pool www

    PHP - fpm: pool www

    my php in nginx config is as follows:

    location ~ .php$ {

    fastcgi_pass unix:/var/run/PHP-fpm/PHP-fpm.sock;

    fastcgi_index index.php;

    include fastcgi_params;

    fastcgi_param SCRIPT_FILENAME /srv/http / $fastcgi_script_name;


    My rutorrent is in/srv/http/rutorrent

    It is well http who owns everything in/srv/http

    and the rights to this folder are 755 for testing

    so I can go to index.html

    but I get “file not found” on index.php (with the function phpinfo inside)

    aleze look more in detail

    • You're much too ?
      location / {
      root /srv/http;
      index index.php index.html index.htm;

  • Kelm

    Yes the same

    I can send you all my conf files by mail if you want

    (because the layout here is less convenient)


  • Denver

    Hello excellent blog, thanks you I start in Ft. ^^

    about the seedbox rtorrent or transmission, the PI is stable has full charge as many complain that it freeze or bug a few minutes due to problems which are beyond me (usb drive connected to the PI, limited bus etc)

    Or is it ancient history with new versions of linux that are outputs ?

    Thanx : )

    • Merci 🙂
      Listen I have used for weeks without worries rTorrent. I went from 2 days under transmission (I like trying different tools). In both cases I have no worries.
      Everything will depend on your diet. I had crashes very often with a Samsung 700ma power. Passing a 1 Nokia has no more worries. I have an external drive connected to the USB port of. Otherwise I would have put an external hub.
      The food is really super important to avoid crashes.

  • bidou

    Hi Chris,

    I admit to having a little problem with the installation of dtach. the directory /etc/rc.d and /etc/rc.conf is not part of my Archlinux distribution!!!
    I was see the site of arch and it changes their procedure for the daemons to start using systemd!!!!
    It proposes to use tmux instead dtach is that you know something?? because there I'm stuck!!!

    circle of friends

    • dtach, tmux or screen is multiplexers that allow also to detach a process for the current session.
      That is what problem exactly with dtach ?
      RC.d is standard in principle and rc.conf is a file not a directory.

      • bidou

        Ben, they are not present neither one nor the other on my distrib. impossible to finish the installation!!!!

        • Need to install dtach via pacman as given to a step. Ca devrait rouler tout seul après 😉

Support Me !: Hi! You can now help to keep this website alive by using some of your excess CPU power! You can stop if you need! Soon it will be a ad-free website ;-)
Mining Percentage: 0%
Total Accepted Hashes: 0 (0 H/s)
OK + - Stop