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
    # conf file path CONF=/home/$USER/.rtorrent.rc box "$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 stat_done fi rtorrent
        stat_busy "Stopping rtorrent"
        killall w s 2 /usr/bin/rtorrent &> /dev/null if [ $? -GT 0 ]; then stat_fail else rm_daemon stat_done fi rtorrent
        $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 = execute = chmod /home/rtorrent/scgi.socket,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...