You're at a friends house, extolling the virtues of your latest TV obsession or music kick, and you can't wait to get them into it as well. Usually, this conversation ends with a promise of burned CDs—but why not offer them what you've already grabbed from BitTorrent, or give them a user name and password to get what you're about to start downloading? TorrentFlux, a free, open-source, server-based BitTorrent manager, can do all those things. If you've got a Windows or Linux computer you keep on most of the time, a home server, or even hosted space, you can take control of your downloads. Follow through the jump for a tutorial on getting started with TorrentFlux.
Windows Users: Install WAMP
Windows users who have undertaken any one of web serving projects should be familiar with WAMP, the all-in-one package that sets up the Apache web server, a mySQL database and PHP functionality. WAMP's been updated since we last linked to it, but the easy setup remains. Follow the first two in this step-by-step guide exactly, but create a database named "torrentflux" at the third step.
Grab a copy of the stable Windows release, unzip it and open the file named "torrentflux.sql" with Notepad or another editor, and copy all the text inside to your clipboard. Head back to phpMyAdmin, click the "SQL" tab, then enter the copied text and hit go. A few more file shifts, and we'll have TorrentFlux up and running.
Set up TorrentFlux
Create a new directory somewhere you have access—I made a folder named "tfdownloads" right at my hard drive's base c: section—and right-click on it. You're going to give full control of the folder to administrators and users, so make sure it's not somewhere you also place sensitive files.
Inside the TorrentFlux folder, unzip the "binaries" file, then copy all of the resulting folder's files inside your WAMP folder—I like to make a new "torrentflux" folder inside the "bins" directory and paste them all inside. Now copy all the files inside the "html" folder, create a "torrentflux" directory in your published documents folder ("www" inside the wamp folder, in most cases), and paste all those files in there. Now open up the "config.inc.php" file you just pasted with a text editor.
At the line starting with $cfg["db_user"], fill in the username (root) and password you gave your database. Scroll down and change "C:/binaries" to wherever you stashed the binaries folder (making sure to use forward-slashes), and
change the downloads directory to the folder you enabled earlier (again, using forward-slashes).
Once that's set up, head to localhost/torrentflux in a browser, and you'll be prompted twice for a username and password. Whatever you put in will be what protects your files from peering eyes, so choose something secure. Now you're in, and you can start poking around.
Starting a download is as easy as pasting a link in the "URL" field and hitting the green "Start" button—unfortunately, the stable Windows version lacks the ability to individually throttle torrents, but you can set a general upload cap (which usually equates to downstream traffic) in the config file. You can can change the themed skin of the page, set up user accounts for friends, see your server stats and hit "directory list" to see your collected files, but you can't download them—not yet, anyways.
If you're feeling hacker-ish and want to code download links yourself, you can take ,one forum member's suggestions and run with them, but I've put together a single file replacement that should enable direct downloads:
Simply grab that file and drop it into the folder where you stashed TorrentFlux's web files (wampwwwtorrentflux, most likely). You should now see download links in the right-hand columns for every file, finished or not.
Installing TorrentFlux in Linux
TorrentFlux is one of the few cross-platform apps you'll find that's easier, and more advanced, in its Linux installation than Windows. If you want to set up a system with full file-sharing (Samba), we've previously posted a guide to creating an $80 file server that features TorrentFlux. Otherwise, the steps are very similar to the Windows installation, with a few command-line differences:
Installing LAMP: This will vary by distribution a bit, but the basics of setting up Apache, mySQL and PHP are covered in this HowtoForge guide for Ubuntu.
Installing phpMyAdmin: Your repository should have an auto-setup package for it, and changing passwords is the same as with Windows.
Setting up TorrentFlux: If your distribution has a package, all the better. If not, grab the latest version and follow the installation instructions included—though they should be the same as Windows.
That's it: Direct downloads, per-file throttling and other extras are enabled by default in the latest Linux packages.
Open it up
Finally, to make your torrents controllable and accessible from the big world out there, you'll need to open up a port for web access and find a way to get to it. Luckily, Gina's written up great guides to getting past your router/firewall and giving it a constant home with DynDNS. Follow those guides for the Apache module, and you'll be sharing videos, tunes, and other gear with friends in no time.
Like anything about TorrentFlux I didn't mention? Found an easier way to make your files accessible from outside your home network? Share your thoughts, takes, and questions in the comments.
Kevin Purdy, associate editor at Lifehacker, is psyched about starting torrent downloads from the line at the coffee shop. His weekly feature, Open Sourcery, appears every Friday on Lifehacker.