How to download torrents from command line in Ubuntu

Even though torrent doesn't have the best reputation, there are still a lot of positives to using it. For starters, if you like to share files, it's a great way to outsource your bandwidth. No longer having to host a download server. Just offer the torrent to your community and ask them to seed it! Low bandwidth costs and fast transmission for everyone!

Most torrenting on Linux is done through graphical clients. However, you might be interested to know that it's also possible to download torrents directly inside Terminal. This article will show you how to download torrents in the latest Ubuntu LTS.

Install CLI Torrent Client on Ubuntu

There are many good CLI-based torrent clients, but few are as good as transmission-cli. This is the easiest to use out of all the options available and is similar to the most used torrent client on Linux (Transmission).

To install transmission-cli, open a terminal window and enter the following command:

sudo apt install transmission-cli

Add torrents in Transmission

Adding torrents to transmission-cli is quite simple. Start by finding torrent files from your favorite torrent distributor. This tutorial will use the Ubuntu MATE LTS release torrent.

Download torrents by URL

Transmission CLI can download torrents directly from a URL by executing the command:

transmission-cli https://cdimage.ubuntu.com/ubuntu-mate/releases/22.04/release/ubuntu-mate-22.04.3-desktop-amd64.iso.torrent -w ~/Downloads

How to download torrents from command line in Ubuntu Picture 1

 

This method is great if the user is having difficulty and just wants the download to happen as soon as possible.

Download torrent using magnet link

Transmission CLI torrent client also supports magnet links. To download torrents using magnet links, try the following:

transmission-cli magnet:?xt=urn:btih:0223dcb7785d09dbdff5839a089774277a66b4c9&dn=ubuntu-mate-22.04.3-desktop-amd64.iso -w ~/Downloads

Download Torrent using torrent file

And finally, Transmission CLI can initiate downloads via local torrent files. Get the torrent file by normal means (through a web browser) or find a link to the torrent file and download it via Terminal using wget.

For example:

wget https://cdimage.ubuntu.com/ubuntu-mate/releases/22.04/release/ubuntu-mate-22.04.3-desktop-amd64.iso.torrent

To download using a torrent file, do the following:

transmission-cli ./ubuntu-mate-22.04.3-desktop-amd64.iso.torrent -w ~/Downloads

Activate peer block list

Since transmission-cli works differently from its graphical version, it often does not save settings. This means you need to specify your peer block list every time you download a torrent to Ubuntu. Flag -b enables the blocklist. To use a block list during downloads, follow this example:

transmission-cli https://cdimage.ubuntu.com/ubuntu-mate/releases/22.04/release/ubuntu-mate-22.04.3-desktop-amd64.iso.torrent -w ~/Downloads -b https://mirror .codebucket.de/transmission/blocklist.p2p.gz

How to download torrents from command line in Ubuntu Picture 2

 

Download torrents with encryption

Although it is not recommended to download sketchy files from torrents, it still happens. To protect yourself when downloading these types of files, you can encrypt your traffic while torrenting on Ubuntu. Here's how:

transmission-cli https://cdimage.ubuntu.com/ubuntu-mate/releases/22.04/release/ubuntu-mate-22.04.3-desktop-amd64.iso.torrent -w ~/Downloads -er

The -er flag tells transmission-cli that it requires encryption for all peers it connects to. This can slow down transfer speeds, so this option may not be for everyone, especially those with slow connections.

To download with encrypted traffic but also increase your transfer speed, try using the -ep flag instead. This will tell the peer that the client prefers encryption, but it will not require it.

transmission-cli https://cdimage.ubuntu.com/ubuntu-mate/releases/22.04/release/ubuntu-mate-22.04.3-desktop-amd64.iso.torrent -w ~/Downloads -ep

How to download torrents from command line in Ubuntu Picture 3

Explore other Transmission flags

Transmission-cli is full of different types of options. To see these options, run transmission-cli --help. Doing so will output various flags and command modifications that users can add to their transmission-cli command for a better download experience. For example, you can enter transmission-cli -d 800 to limit total client throughput to 800 kilobytes per second.

How to download torrents from command line in Ubuntu Picture 4

Download torrents using rTorrent

Besides Transmission CLI, you can also use other torrent client terminals to manage your torrent downloads. These are typically Terminal-only tools, meaning they contain features geared toward user automation and macros.

rTorrent is a popular TUI torrent client that allows you to automatically handle share rates, TOR, and automatically extract torrent files from websites. To install it in Ubuntu, run the following command:

sudo apt install rtorrent

To add torrent files to rTorrent, open a new terminal and run rtorrent. This will load the client's TUI and take up the entire Terminal screen.

How to download torrents from command line in Ubuntu Picture 5

Press Enter to open the torrent prompt, then enter the path to your torrent file. This can be a local '.torrent' file or a remote link.

How to download torrents from command line in Ubuntu Picture 6

Press the Down Arrow key to select the first torrent file, then press Ctrl + S to start downloading your new torrent.

How to download torrents from command line in Ubuntu Picture 7

Download torrents with aria2c

Aria2c is a lightweight and highly minimalist download manager for Linux. Unlike Transmission and rTorrent, aria2c is a multi-protocol download client, meaning you can also use it to download non-torrent files. You can download aria2c by running the following command:

sudo apt install aria2c

To download torrents using aria2c, run the program, followed by the path of the '.torrent' file you want to download. Like in rTorrent, this can be a local or remote path:

aria2c https://cdimage.ubuntu.com/ubuntu-mate/releases/22.04/release/ubuntu-mate-22.04.3-desktop-amd64.iso.torrent

You can also download torrent files directly in aria2c using their magnet link:

aria2c magnet:?xt=urn:btih:0223dcb7785d09dbdff5839a089774277a66b4c9&dn=ubuntu-mate-22.04.3-desktop-amd64.iso

While downloading using a command instead of a fancy GUI may not seem very appealing, you'd be wrong. For example, Transmission CLI has more features than most conventional graphical clients. Meanwhile, rTorrent and aria2c are also great alternatives that offer unique features like rate handling and multi-protocol support.

5 ★ | 1 Vote

May be interested

  • How to Install Ubuntu PackagesHow to Install Ubuntu Packages
    this wikihow will show you how to install packages on ubuntu using the ubuntu software center, the synaptic package manager, and a command-line window. the ubuntu software center is similar to the app store for macos and the microsoft...
  • How to use uTorrent Web to download torrents in the browserHow to use uTorrent Web to download torrents in the browser
    utorrent web is a browser torrent download tool like chrome, firefox, microsoft edge, opera ...
  • How to use RSS feed to automatically download torrentsHow to use RSS feed to automatically download torrents
    there are several ways to download torrent files. in today's article, tipsmake.com.com will discuss how you can download torrents automatically using rss feed.
  • 5 reasons why people love the Linux command line5 reasons why people love the Linux command line
    many people are afraid of the command line. they see it as something for software developers or geeks. but the command line is merely another way of interacting with a pc, and there are some tasks that are very easy to do with the cli.
  • 5 best command line emulation software for Windows 105 best command line emulation software for Windows 10
    currently, users can get a shell within windows 10, but many still prefer the more configurable command line emulator applications. so this article will introduce you to five of the best command line emulation software for windows 10.
  • Download Ubuntu right in Windows Store only brothersDownload Ubuntu right in Windows Store only brothers
    microsoft announced at the build 2017 conference earlier this year that users can download ubuntu directly from the windows store, and now this most popular linux distro is available for download.
  • How to check internet speed with the command line in LinuxHow to check internet speed with the command line in Linux
    today, tipsmake.com will read how to check the speed of the internet from the command line via terminal in various popular linux distributions, including ubuntu, fedora and arch linux.
  • How to use the Linux command line on Android with TermuxHow to use the Linux command line on Android with Termux
    android is a very operating system 'capacity with more and more desktop accessibility applications. however, sometimes you want to make some things on android that can be as easy as desktop. fortunately, you can use the termux tool, which builds on the existing infrastructure and provides a command line environment that allows you to install real linux applications on your android device.
  • How to create a command line program in Python with ClickHow to create a command line program in Python with Click
    click is a python package to write command line interfaces with as little code as possible. this article will show you how to use click to create the command line program.
  • How to create and run shell scripts in Ubuntu 22.04How to create and run shell scripts in Ubuntu 22.04
    shell is a user-written command interpreter. script shell helps users write and execute multiple commands at the same time. in this article, readers will learn how to execute shell scripts through command line input.