Sign inSign up

k44sh/rutorrent

By k44sh

•Updated 16 days ago

🐳 ruTorrent Docker compatible with Radarr/Sonarr šŸæ

Image
Web servers
2

100K+

k44sh/rutorrent repository overview

Latest Version ⁠ Docker Size ⁠ Docker Pulls ⁠ Build Main ⁠ Build Dev ⁠

Github Stars ⁠ Forks ⁠ License ⁠

⁠About

rTorrent⁠ and ruTorrent⁠ Docker image based on Alpine Linux⁠.


⁠Features

⁠Volume Overview

VolumeDescription
/configStores rTorrent, ruTorrent, and other configurations
/dataMain storage for downloaded torrent files
/passwdHolds .htpasswd files for HTTP authentication

:information_source: Note: Volumes should be owned by the user/group matching the specified PUID and PGID.

⁠Radarr / Sonarr Users

It is recommended to use the same data volume for ruTorrent and Radarr/Sonarr, in order to have a structure similar to this :

data
ā”œā”€ā”€ downloads
└── media
   ā”œā”€ā”€ movies
   ā”œā”€ā”€ music
   └── tv

:information_source: More informations here : TRaSH Guide⁠

⁠Multi Platform Images

  • linux/amd64
  • linux/arm64
  • linux/arm/v7

⁠Usage

⁠Docker Compose

Docker compose is the recommended way to run this image. Edit the compose file with your preferences and run the following command:

mkdir $(pwd)/{config,data,passwd}
chown ${PUID}:${PGID} $(pwd)/{config,data,passwd}
docker compose up -d
docker compose logs -f
⁠Upgrade

To upgrade, pull the newer image and launch the container:

docker compose pull
docker compose up -d
⁠Cleanup
docker compose down -v
rm -rf $(pwd)/{config,data,passwd}
⁠Command line

You can also use the following minimal command:

mkdir $(pwd)/{config,data,passwd}
chown ${PUID}:${PGID} $(pwd)/{config,data,passwd}
docker run -d --name rutorrent \
  --ulimit nproc=65535 \
  --ulimit nofile=32000:40000 \
  -p 6881:6881/udp \
  -p 8000:8000 \
  -p 8080:8080 \
  -p 9000:9000 \
  -p 50000:50000 \
  -v $(pwd)/config:/config \
  -v $(pwd)/data:/data \
  -v $(pwd)/passwd:/passwd \
  k44sh/rutorrent:latest && \
  docker logs -f rutorrent

⁠Environment variables

⁠General
VariableDescriptionDefault
TZThe timezone assigned to the containerUTC
PUIDrTorrent user ID1000
PGIDrTorrent group ID1000
CONFIG_PATHruTorrent configuration path/config
TOPDIR_PATHruTorrent top directory/data
DOWNLOAD_PATHPath for downloaded files/data/downloads
MM_ACCOUNTYour MaxMind account ID(required for auto update)
MM_LICENSEYour MaxMind license key(required auto update)
WAN_IPPublic IP address reported to the trackerAuto resolved
MEMORY_LIMITPHP memory limit512M
UPLOAD_MAX_SIZEMax upload size16M
CLEAR_ENVClear environment in PHP-FPM workersyes
OPCACHE_MEM_SIZEPHP OpCache memory size256
MAX_FILE_UPLOADSMax number of files allowed to be uploaded simultaneously50
AUTH_DELAYDelay before HTTP Basic Auth is enforced0s
REAL_IP_FROMTrusted CIDR ranges that can set real client IPsfalse
REAL_IP_CFTrusted Cloudflare IP ranges that can set real client IPsfalse
REAL_IP_HEADERHeader containing the real client IPX-Forwarded-For
LOG_IP_VARVariable used in Nginx logs for remote IPremote_addr
XMLRPC_AUTHBASIC_STRINGMessage shown for XMLRPC Basic AuthrTorrent XMLRPC restricted access
XMLRPC_PORTXMLRPC port through Nginx (over SCGI socket)8000
XMLRPC_SIZE_LIMITMax body size of XMLRPC calls2M
RUTORRENT_AUTHBASIC_STRINGMessage shown for ruTorrent Basic AuthruTorrent restricted access
RUTORRENT_PORTHTTP port used by ruTorrent8080
WEBDAV_AUTHBASIC_STRINGMessage shown for WebDAV Basic AuthWebDAV restricted access
WEBDAV_PORTWebDAV port for accessing completed downloads9000
⁠rTorrent
VariableDescriptionDefault
RT_LOG_LEVELrTorrent log levelinfo
RT_LOG_EXECUTELog executed commands to /config/rtorrent/log/execute.logfalse
RT_LOG_XMLRPCLog XMLRPC queries to /config/rtorrent/log/xmlrpc.logfalse
RT_SESSION_SAVE_SECONDSInterval (in seconds) between saving session data to disk3600
RT_TRACKER_DELAY_SCRAPEDelay tracker announces at startuptrue
RT_RECEIVE_BUFFER_SIZETCP receive buffer size (network.receive_buffer.size.set)16M
RT_SEND_BUFFER_SIZETCP send buffer size (network.send_buffer.size.set)16M
RT_PREALLOCATE_TYPEDisk space preallocation type0
RT_DHT_PORTDHT UDP port (dht.port.set)6881
RT_INC_PORTIncoming port range (network.port_range.set)50000
⁠ruTorrent
VariableDescriptionDefault
RU_REMOVE_CORE_PLUGINSRemove ruTorrent core plugins; comma-separatedfalse
RU_HTTP_USER_AGENTruTorrent HTTP user agentMozilla Firefox
RU_HTTP_TIME_OUTruTorrent HTTP timeout in seconds30
RU_HTTP_USE_GZIPUse HTTP Gzip compressiontrue
RU_RPC_TIME_OUTruTorrent RPC timeout in seconds5
RU_LOG_RPC_CALLSLog ruTorrent RPC callsfalse
RU_LOG_RPC_FAULTSLog ruTorrent RPC faultstrue
RU_PHP_USE_GZIPUse PHP Gzip compressionfalse
RU_PHP_GZIP_LEVELPHP Gzip compression level2
RU_SCHEDULE_RANDRandom delay (0 to X seconds) for scheduler start10
RU_LOG_FILEruTorrent log file path for error messages/config/rutorrent/rutorrent.log
RU_DO_DIAGNOSTICruTorrent diagnostics (e.g., permission checks)true
RU_CACHED_PLUGIN_LOADINGEnable rapid cached loading of ruTorrent pluginsfalse
RU_SAVE_UPLOADED_TORRENTSSave uploaded torrent files to /config/rutorrent/share/torrentstrue
RU_OVERWRITE_UPLOADED_TORRENTSOverwrite existing .torrent filesfalse
RU_FORBID_USER_SETTINGSEnforce global settings, even with HTTP authfalse
RU_LOCALEDefault locale for ruTorrentUTF8

⁠Ports

PortVariableDescription
6881RT_DHT_PORTDHT UDP port (dht.port.set)
50000RT_INC_PORTIncoming connections (network.port_range.set)
8000XMLRPC_PORTXMLRPC port through Nginx over SCGI socket
8080RUTORRENT_PORTruTorrent HTTP port
9000WEBDAV_PORTWebDAV port for completed downloads

⁠Notes

⁠WebDAV

WebDAV allows you to retrieve your completed torrent files in /data on port 9000. Like XMLRPC, these requests can be secured with basic authentication through the /passwd/webdav.htpasswd file in which you will need to add a username with his password. See below to populate this file with a user / password.

⁠Populate .htpasswd files

For ruTorrent basic auth, XMLRPC through nginx and WebDAV on completed downloads, you can populate .htpasswd files with the following command:

docker run --rm -it httpd:2.4-alpine htpasswd -Bbn <username> <password> >> $(pwd)/passwd/webdav.htpasswd

Htpasswd files used:

  • rpc.htpasswd: XMLRPC through nginx
  • rutorrent.htpasswd: ruTorrent basic auth
  • webdav.htpasswd: WebDAV on completed downloads
⁠Override or add a ruTorrent plugin/theme

You can add a plugin for ruTorrent in /config/rutorrent/plugins/.

If you add a plugin that already exists in ruTorrent, it will be removed from ruTorrent core plugins and yours will be used. And you can also add a theme in /config/rutorrent/themes/. The same principle as for plugins will be used if you want to override one.

:information_source: Container has to be restarted to propagate changes

⁠Edit a ruTorrent plugin configuration

As you probably know, plugin configuration is not outsourced in ruTorrent. Loading the configuration of a plugin is done via a conf.php file placed at the root of the plugin folder. To solve this issue with Docker, a special folder has been created in /config/rutorrent/plugins-conf to allow you to configure plugins. For example to configure the diskspace plugin, you will need to create the /config/rutorrent/plugins-conf/diskspace.php file with your configuration:

<?php
$diskUpdateInterval = 10;	// in seconds
$notifySpaceLimit = 512;	// in Mb
$partitionDirectory = null;	// if null, then we will check rtorrent download directory 

:information_source: Container has to be restarted to propagate changes

Fork based on the version of CrazyMax⁠

Tag summary

Content type

Image

Digest

sha256:33192fa09…

Size

158.7 MB

Last updated

over 1 year ago

docker pull k44sh/rutorrent