How to use BitTorrent

BitTorrent is a downloader which uses a peer-to-peer protocol.


Under Debian, just install the following packages :

sudo apt-get install bittorrent ppp

Create Your Own Torrent

You want to share files via BitTorrent, for that you need :

  • a tracker : to coordinate.
  • a web server (we suppose here that you have it) : to give access to your .torrent files
  • a seeder(s) : who have the file and share it.

We are showing how to share many files, acting like a server.

The Tracker

First, run the tracker, using bttrack :

bttrack --port 6969 --dfile dstate --logfile tracker.log

So your tracker is running on the port 6969, you can check it with your browser at http://localhost:6969 and your announce url is: http://localhost:6969/announce

Note: localhost must be replaced by your machine name to be used over internet.

The Torrent

The torrent is a small file ending in .torrent that is used to initialize the transfer.

To create it, just run :

btmakemetafile yourfile http://localhost:6969/announce

You should now have a yourfile.torrent file, now you just have to upload it to your web server.

Note: yourfile could be also a directory

Note: the above syntax did not work on a debian machine, this syntax did:

btmakemetafile http://localhost:6969/announce yourfile

The Web Server

If your are using a Debian packaged apache, you don't have to configure anything.

If your not, add application/x-bittorrent .torrent to your mime.types.

Just create a directory named torrent, and put in it your .torrent files and your files.

The Seeder

Now we need to make your files available for download, by seeding it (give the complete file).

For that, launch :

btlaunchmany path/to/the/torrent/directory > seeder.log

Now, if you click on your .torrent files you we be able to download the file, from your server and from other clients too and you earn bandwith !!


Your log file will grow quickly; this can be limited with the option: –display_interval <arg>, where <arg> should be 50 (or higher if it still grows too fast).

You can create shell script to automate some actions.


how_to_use_bittorrent.txt · Last modified: 2009/11/30 13:30 by alban
Except where otherwise noted, content on this wiki is licensed under the following license:CC Attribution-Noncommercial-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Run by Debian Driven by DokuWiki