How To Create A Torrent Using Mktorrent
Name: how-to-create-a-torrent-using-mktorrent
Last reviewed by: Clipper, April 2026
Creating a torrent using mktorrent
mktorrent is a command-line tool for creating .torrent files. It is pre-installed on your Bytesized Appbox.
Basic usage
mktorrent -v -p -a http://tracker.url/announce -o filename.torrent folder_name
Important: The command must be all on one line. Use quotes around the folder name if it contains spaces.
Options
-
-v— verbose output -
-p— set the private flag (disables DHT and PeerExchange, required by most private trackers) -
-a <url>— announce URL of the tracker. Use multiple-aflags to add backup trackers -
-o <filename>— output.torrentfilename -
-l <n>— piece length as a power of 2 (see table below) -
-s <source>— source string embedded in the infohash (required by some trackers for cross-seeding) -
-n <name>— torrent name (defaults to the folder/file name) -
-c <comment>— add a comment to the torrent metadata -
-t <n>— number of threads for hash calculation (defaults to number of CPU cores) -
-d— omit the creation date from the torrent (useful for reproducible torrents) -
-w <url>— add a web seed URL
Example
To create a torrent for a release located at ~/torrents/completed/Artist - Album 2024:
cd ~/torrents/completed
mktorrent -v -p -a https://tracker.example.com/announce -o Artist-Album-2024.torrent "Artist - Album 2024"
To add a source tag and a backup tracker:
mktorrent -v -p \
-a https://tracker.example.com/announce \
-a https://backup.example.com/announce \
-s tracker.example.com \
-o Artist-Album-2024.torrent \
"Artist - Album 2024"
Piece size guide
The -l flag sets the piece length as 2^n bytes. Use this table as a guide:
-l value |
Piece size | Recommended for |
|---|---|---|
19 |
512 KiB | 512 MiB – 1 GiB |
20 |
1 MiB | 1 GiB – 2 GiB |
21 |
2 MiB | 2 GiB – 4 GiB |
22 |
4 MiB | 4 GiB – 8 GiB |
23 |
8 MiB | 8 GiB – 16 GiB |
24 |
16 MiB | 16 GiB – 512 GiB |
25 |
32 MiB | Not recommended (incompatible with older clients) |
If -l is not specified, mktorrent defaults to 18 (256 KiB), which is suitable for small files.
| Last Author | Contributors | Versions | Last update |
|---|---|---|---|
| Clipper | None | 5 | Sat, 11 Apr 2026 18:58:28 +0200 |