Skip to content

Run rTorrent and Flood via Docker

Jesse Chan edited this page Feb 21, 2021 · 9 revisions

rTorrent + Flood

Discussions: github.com/jesec/flood/discussions/120

Example

Suppose the specifications are:

  • config directory: /home/jc/dlconfig
  • data directory: /mnt/data0
  • owner of files: jc
    • UID: 1000
    • GID: 1001
    • get UID/GID with id {username}, for example id jc
  • access Flood via port 3001
    • accessible by localhost (127.0.0.1) only
  • rTorrent BitTorrent port is 6881
    • accessible by Internet (0.0.0.0)
  • run rTorrent as a daemon

Configuration:

Note that Flood does not pass through arguments to rTorrent at the moment.

As a result, to change rTorrent's configurations, there has to be a .rtorrent.rc config file:

## Import default configurations
import = /etc/rtorrent/rtorrent.rc

## Listening port
network.port_range.set=6881-6881

In my case, I place the custom config file to /home/jc/dlconfig/.rtorrent.rc.

Run Flood and rTorrent:

docker run -it --rm \
--name rtorrent-flood \
--hostname rtorrent-flood \
-e HOME=/config \
-v /home/jc/dlconfig:/config \
-v /mnt/data0:/data \
-u 1000:1001 \
-p 127.0.0.1:3001:3001 \
-p 0.0.0.0:6881:6881 \
jesec/rtorrent-flood \
--port 3001 \
--allowedpath /data

Alternatively, use Docker Compose:

services:
  flood:
    hostname: flood
    image: jesec/flood
    user: 1000:1001
    restart: unless-stopped
    command: --port 3001 --allowedpath /data
    environment:
      HOME: /config
    volumes:
      - /home/jc/dlconfig:/config
      - /mnt/data0:/data
    ports:
      - 127.0.0.1:3001:3001

  rtorrent:
    hostname: rtorrent
    image: jesec/rtorrent
    user: 1000:1001
    restart: unless-stopped
    command: -o network.port_range.set=6881-6881,system.daemon.set=true
    environment:
      HOME: /config
    volumes:
      - /home/jc/dlconfig:/config
      - /mnt/data0:/data
    ports:
      - 0.0.0.0:6881:6881

Finally, access Flood and register a user with /config/.local/share/rtorrent/rtorrent.sock rTorrent socket path.