Jump to content

rTorrent

From Official NixOS Wiki
Revision as of 20:42, 1 November 2026 by Tie-ling (talk | contribs) (flood and rutorrent)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

rTorrent is a bittorrent client by rakshasa (Jari Sundell). The active development restarted in 2024, thanks to donations to the developer. Concurrently the development of the web client ruTorrent was restarted by a hosting company (xirvik.com). Both the program and the web client have frequent releases as of November 2026, with optimizations, bugfixes and security patches applied. The rTorrent author released 0.16.27 on October 28, 2026 and is targeting a 1.0 release in the near future.

This article describes how to set up both the torrent client and the web client, performance tuning, and how to override the old version shipped in nixpkgs.

rTorrent with Flood

rtorrent can open a socket which other software can use to interface with. No unprotected RPC socket of rtorrent is required with this setup and it therefore provides a higher security standard.

{ config, lib, pkgs, ... }:

let
  peer-port = 51412;
  web-port = 8112;
in {
  
  services.rtorrent = {
    enable = true;
    port = peer-port;
    package = pkgs.rtorrent; # (2025-07-28) upstream develop of rtorrent continued, jesec-rtorrent does not build in nixpkgs
    openFirewall = true;
  };
  # If you have lots of torrents in the seed you may see rtorrent stack-trace with "too many open files"
  # to increase the limit of open files use:
  systemd.services.rtorrent.serviceConfig.LimitNOFILE = 16384;

  services.flood = {
    enable = true;
    port = web-port;
    openFirewall = true;
    extraArgs = ["--rtsocket=${config.services.rtorrent.rpcSocket}"];
  };
  # allow access to the socket by putting it in the same group as rtorrent service
  # the socket will have g+w permissions
  systemd.services.flood.serviceConfig.SupplementaryGroups = [ config.services.rtorrent.group ];
}

Sample configuration is to be put into rtorrent.nix and imported in your configuration.nix via:

{
  imports = [ ./rtorrent.nix ];
}

After performing nixos-rebuild switch on port http://localhost:8112 the flood service should run.