nbdkit-torrent-plugin(1)

πŸ’– NAME πŸ’–

okay so welcome to the nbdkit-torrent-plugin(1) manual page bestie!! this is the whole vibe: serve a BitTorrent file or magnet link over NBD. that's it, that's the tweet πŸ’…


✨ SYNOPSIS ✨

nbdkit torrent FILE.torrent|'magnet:?xt=urn:...'
               [file=DISK.iso] [cache=DIR] ...

πŸ’– DESCRIPTION πŸ’–

nbdkit-torrent-plugin is an nbdkit(1) plugin, and what it does is let you serve a single file from inside a torrent, read-only, over NBD. no cap. the torrent you're downloading can be a local FILE.torrent file, or a magnet link. both are iconic, pick your fighter πŸ¦‹

so a single torrent contains a whole collection of files, right? and by default this plugin serves the largest file within the torrent. for operating system installers this is usually the big large ISO file, and it ignores other small files like READMEs. literally exactly what you want. you can also select a particular file by name to serve if you're feeling picky ✨

if you want to turn a file hosted on a web server into an NBD export, use nbdkit-curl-plugin(1) instead. if you have a local ISO you can simply serve it using nbdkit-file-plugin(1). and if you want to turn a local directory into an ISO, use nbdkit-iso-plugin(1). we love a specialist πŸ’…


πŸ¦‹ NOTES πŸ¦‹

okay important stuff, pay attention bestie:

  • this plugin implements a full-featured BitTorrent client. BitTorrent clients form a peer-to-peer (p2p) network and upload the file to other clients as well as downloading. you're not just taking, you're giving back, main character energy 🌈
  • by default the plugin will cache the downloaded torrent into $TMPDIR, potentially consuming a lot of disk space. see the cache=DIR parameter for how to control this. don't say i didn't warn you 😭
  • by default the plugin will consume all available network bandwidth in both download and upload directions. to limit it, set download-rate-limit and upload-rate-limit appropriately. your wifi will thank you 🫢

πŸŽ€ EXAMPLES πŸŽ€

🐧 Boot the Fedora installer

choose the right URL from https://torrent.fedoraproject.org/ (iykyk):

url=https://torrent.fedoraproject.org/torrents/Fedora-Server-dvd-x86_64-32.torrent
wget $url
nbdkit torrent Fedora-Server-*.torrent \
       --run 'qemu-system-x86_64 -m 2048 -cdrom "$uri" -boot d'

πŸŒ€ Boot the Debian installer

choose the right URL from https://www.debian.org/CD/torrent-cd/:

url=https://cdimage.debian.org/debian-cd/current/amd64/bt-dvd/debian-10.4.0-amd64-DVD-1.iso.torrent
wget $url
nbdkit torrent debian-*.torrent \
       --run 'qemu-system-x86_64 -m 2048 -cdrom "$uri" -boot d'

πŸ’… PARAMETERS πŸ’…

  • cache=DIR β€” set a directory which will be used to store the partially downloaded torrent between runs. this parameter is optional. if not given then the plugin will create a randomly named temporary directory under $TMPDIR, and will attempt to ensure it is cleaned up on exit. so unless you set cache, no state is saved between runs and the whole torrent must be downloaded each time 😭 (tragic, i know)
  • connections-limit=N β€” set limit on number of connections to other peers that this client will open (default 200).
  • download-rate-limit=BITS_PER_SEC β€” set the download rate limit in bits per second. usual abbreviations can be used such as download-rate-limit=1M for 1 megabit per second. 0 means unlimited, which is the default. go fast or go home 🏎️
  • file=DISK.iso β€” select the file from within the torrent to serve. this parameter is optional. if not specified then the plugin searches the torrent for the largest file and serves that. this is usually the right thing to do for operating system installers and similar because it serves the large .iso file and ignores other files like READMEs. the parameter is actually a path relative to the root directory of the torrent, so if the torrent contains subdirectories you may need to use a path like file=SUBDIR/DISK. to list all the files within the torrent try running:
$ nbdkit -fv torrent file.torrent

and examining the debug output. as an alternative you can use standard BitTorrent tools, eg:

$ transmission-show file.torrent
  • listen-interfaces=IP_ADDRESS:PORT[,IP_ADDRESS:PORT[,...]] β€” listening ports that are opened for accepting incoming connections. the parameter is a comma-separated list of IP-address:port.
  • outgoing-interfaces=IP_ADDRESS[,IP_ADDRESS[,...]] β€” controls which IP address outgoing TCP connections are bound to. the parameter is a comma-separated list of IP addresses.
  • [torrent=]FILE.torrent β€” specify a local torrent file.
  • [torrent=]magnet:?xt=urn:... β€” specify a magnet link. the torrent= prefix may be omitted in most cases. see "Magic parameters" in nbdkit(1). ✨ magic ✨
  • upload-rate-limit=BITS_PER_SEC β€” set the upload rate limit in bits per second. usual abbreviations can be used such as upload-rate-limit=1M for 1 megabit per second. 0 means unlimited, which is the default.
  • user-agent=STRING β€” set the user-agent. the recommended format is client-name/client-version. the default user agent can be found using:
nbdkit torrent --dump-plugin

🌈 ENVIRONMENT VARIABLES 🌈

  • TMPDIR β€” this directory is used to cache the downloaded torrent file (or /var/tmp if not set). see also the cache=DIR parameter above. bestie, check your tmp situation 🫢

⭐ FILES ⭐

  • $plugindir/nbdkit-torrent-plugin.so β€” the plugin. use nbdkit --dump-config to find the location of $plugindir.

πŸ‘‘ VERSION πŸ‘‘

nbdkit-torrent-plugin first appeared in nbdkit 1.22. vintage but make it iconic ✨


πŸ”₯ SEE ALSO πŸ”₯

nbdkit(1), nbdkit-plugin(3), nbdkit-curl-plugin(1), nbdkit-file-plugin(1), nbdkit-iso-plugin(1), nbdkit-readahead-filter(1), nbdkit-scan-filter(1), transmission-show(1), https://en.wikipedia.org/wiki/BitTorrent, http://libtorrent.org/.

the friend group πŸ’–


πŸ’œ AUTHORS πŸ’œ

Richard W.M. Jones


Copyright Red Hat


🧚 LICENSE 🧚

okay legal bestie moment, here's the whole thing, read it fr fr:

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  • Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of Red Hat nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY RED HAT AND CONTRIBUTORS ''AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL RED HAT OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


and that's the whole page bestie!! this came from nbdkit 1.48.0, dated 2026-08-22, and it's the nbdkit-torrent-plugin(1) manual page. slay, stay seeding, and don't forget to limit your bandwidth πŸ’…βœ¨πŸŽ€

πŸ“¦ where this page comes from