(Answer) (Category) Brian's BitTorrent FAQ and Guide : (Category) Advanced Topics : (Answer) How do I create a new torrent (share a file I have with others)?

Sharing files that you have with others is relatively easy with BitTorrent, but a little extra work is required compared to marking a directory as "shared" as with some other file sharing applications. There are essentially three elements necessary to sharing a file with BitTorrent:

  1. The tracker, which coordinates connections among the peers. Bandwidth required is very moderate compared to the size of the files being shared.
  2. The web server, which stores and serves the .torrent file. This is usually a quite small file, and is only requested once by each peer before initiating the transfer. The web server also serves to index and organize the torrents, since there is no built-in search capability in the BitTorrent protocol -- existing web techniques are instead used.
  3. At least one seeder. This is the only element of the three that contains any of the file's actual contents. The seeder is almost always an end-user's desktop machine, rather than a dedicated server machine.

In earlier periods of BitTorrent, the process was somewhat more difficult because frequently you had to run your own tracker (and possibly web server) in addition to the seeder. Recently, however, torrent communities have sprouted which take care of many of the details of running a tracker and distributing the .torrent metadata file. For most purposes, using one of these communities is the quickest and easiest way to share data.

For the purposes of this part of the FAQ, we will assume you already have a tracker and web server, or access to them. Most of the sites in the links section ((Xref) Links to Popular BitTorrent Sites) run trackers and web servers that you are welcome to use. The rule of thumb here is to never create a torrent for a tracker which you do not have permission to use. In most cases that simply means that if you intend to use a tracker, you should also post your .torrent file to the website associated with the tracker, so that the whole community can benefit.

If you still desire to run a tracker or web server, see (Xref) How do I run a tracker? and (Xref) How do I configure a web server for .torrent files? .

Below are the steps to create and distribute the .torrent file, and begin the seeding.

  1. Decide what you want to share. A torrent can contain either a single file, or a directory of many files. This is often quite convenient, since it avoids the step of creating an archive (.zip, .rar, etc.) if you need to store multiple files. For example, if you are sharing a 2-CD movie, put both of the files in a directory and create a torrent for that, rather than zipping the files and then creating a torrent for the single archive file.

    IMPORTANT NOTE! Despite what I would call common sense and courtesy, I see people doing stupid things at this point all the time! For example, if the file you are sharing was originally posted to Usenet and came in a number of parts (.RAR, .R00, .R01), do not put those parts in an archive and then create a torrent of that. Most media files are already compressed, and rar-ing or zip-ing them just adds an additional step for everyone that receives the files. And for the love of $DEITY, do not include the parity files in your torrent! In summary, if the end product you are sharing is an .AVI file, create a torrent for that. This makes it easier for people to hold on to the original form of the torrent, and this tends to lead to it being shared longer. If you distribute your AVI file as an RAR containing 33 parts, which itself contains a ZIP, then people will trudge through the processing of the files to get the AVI, and then most likely delete the original since it's in a form that is useless to them. Therefore, they cannot (re-)seed the torrent since they've lost the original format. Finally, you do your part to put an end to the neverending stream of "How do I open .R00 files?" questions. (end opinionated rant)
  2. Run maketorrent. (See (Xref) What other BitTorrent-related utilities are out there? if you haven't installed it.) If you are sharing a single file, click the (file) button, otherwise click the (dir) button. In either case a file dialog will appear, and you should select the file/directory that you wish to share.
  3. Enter the tracker's announce url in the space provided, or use the drop-down list to select from one of a common list of trackers. Remember, if you use a site's tracker when creating a .torrent file, plan to upload/post the file to that community. You can also add a comment, but it's optional.
  4. Select the piece size, or just accept the default value of (auto). In general, the smaller the piece size, the more efficient the BitTorrent download will be, but will result in a larger .torrent file. 256 kB seems to be the most common piece size in use these days, but you can experiment with other settings if you want. Avoid very large piece sizes for small files; likewise avoid small piece sizes for very large files.
  5. Click create torrent to begin the process of creating the file. You can then select if you want to create a single .torrent for all the files in the directory, or a number of separate .torrents. Most of the time you want a single .torrent for the whole folder, unless you know what you're doing. When finished, you should find a newly created .torrent file in the same directory as the file/directory you selected to share.
  6. Upload this .torrent file to a web server. Usually this means going to the web page of the site whose tracker you used and clicking the "Upload torrent" link. The procedure varies from site to site, but it's usually always explained in a FAQ link or forum posting. If you are running your own web server (and have appropriately according to (Xref) How do I configure a web server for .torrent files?) then upload the file to your server's public web space, or whatever method you use to put files on your server.
  7. Finally, you must seed the file. Until this step, nothing but metadata has been transferred. Seeding is necessary to actually transmit your file to others. There are several ways to do this, but the simplest is to use your ordinary BitTorrent client just as you would with any other file. Navigate to the page on the web server where your .torrent is posted, click the link, and when the BitTorrent client starts be sure to select the same file/ directory that you used in maketorrent in step 2 above. The client should check the files and verify that they are complete, and then connect to the tracker and begin seeding. There are several important points about this step:

    • Be sure the machine that you are seeding from can accept incoming network connections on the ports BitTorrent is using. Usually this means configuring port forwarding if you are in a NAT environment. See (Xref) What ports does BitTorrent use? Will it work with a firewall/NAT? .
    • If you are running the tracker on the same machine as the seeding client, and you are in a NAT environment, you must add the "--ip address" parameter to the client command line, where address is the publicly-visible IP address of the machine. For example, your machine might be on an internal network, sharing a DSL or cable modem connection behind a router/gateway. In this case it probably has an internal (unroutable) IP address such as 192.168.x.x or 10.x.x.x. It is necessary to tell the tracker your true public IP address instead of this internal address. If you're not sure what that is, try a site such as this one. For details on the command line see (Xref) How do I change the command line parameters in Windows?. Finally, remember that in a lot of cases you will have a dynamic IP address (one that is assigned to you each time you connect), and if this is true you will have to ensure that you are using the correct one each time. Again, this process applies ONLY if you are seeding and running a tracker on the same machine, and you have a NAT setup.
    • Make sure to leave the seeding client open long enough. The exact amount of time depends on a number of factors. If the file you are seeding is very popular, then you can often seed just long enough to get several distributed copies into the swarm, and then disconnect. If the torrent is sufficiently "healthy," the seeder leaving will have no adverse effects, since there are enough distributed copies of the file to support the swarm. If the file has fewer interests, you will generally have to seed longer. A good policy is to check back later on the tracker's stats page or in the forums and make sure that no one has been left stranded.
    • If you want to seed a number of different torrents, it is often cumbersome to open a number of copies of the GUI client. In this situation the btlaunchmany.py version of the client is very useful. See the section (Xref) Is there a way to download or seed a number of files at once without launching a bunch of copies of the client? for details.

[Append to This Answer]
Next: (Answer) How do I change the command line parameters in Windows?
This document is: http://btfaq.com/cgi-bin/fom?file=56
[Search] [Appearance]
This is a Faq-O-Matic 2.721.