This guide is old and probably outdated. I used these steps to compile and install rTorrent 0.7.4/libTorrent 0.11.4
So, you’ve come to the realization that most of the OS X BitTorrent clients aren’t up to par with those offered on other platforms. Until today, I had been using the standard BitTorrent client but it left me wanting more, especially a “watch” folder. A watch folder is a folder where I can throw my torrents and know that my client will automatically pick them up and download them. Anyways, I was pointed to rTorrent today, and thought I’d write a little guide on getting it up and running on OS X, since I was unable to find something quickly with a Google search. Here is step by step what I did to get rTorrent working for me.
XCode is a set of development tools provided by Apple. They can be obtained by anyone at the Apple Developer Connection. You will have to sign up for an account, but you can do so for free. Download the latest version of XCode (2.4.1 at the time of writing this), mount it and run the installer. This should be a familiar process for most Mac users. As a warning the XCode dmg is almost 1GB.
OS X doesn’t really have a package manager, and resolving and installing dependencies manually is no fun. This is what DarwinPorts is for. It is based on the BSD package manager and is pretty slick. If you don’t like DarwinPorts, you may want to consider Fink, although they didn’t seem to have rTorrent marked as stable when I looked.
Assuming you choose DarwinPorts, download the Universal Binary from their main page, mount it, and run the installer that it contains. Then you’re going to need to add one line to your ~/.bashrc file so that port will be in your execution search path. You can do this with one command in a terminal. Open up Terminal.app (In /Applications/Utilities or just use QuickSilver) and copy and paste this line into it and press enter.
echo "export PATH=\$PATH:/opt/local/bin" >> ~/.bashrc If you’re using zShell then you can use the same thing in your ~/.zshrc, but if you’re using zShell you probably already know what to do.
If you already had DarwinPorts installed, you should probably run port selfupdate to upgrade it to the latest version (you’ll need to sudo to do this).
After you’ve installed or updated your copy of DarwinPorts, you need to update the package list so that you can get the latest stable version of rTorrent. You can achieve this with the port sync command.
Congratulations, you should now have a working copy of DarwinPorts.
rTorrent and all of it’s dependencies can be installed with one simple command.
sudo port install rtorrent When sudo prompts you for a password, just enter your local account password. That’s all there is to installing rTorrent. It may take 15-20 minutes depending on your computer.
Like many *nix applications, rTorrent uses a configuration file located in your home directory to decide how to behave. I’m not going to go in-depth and explain every option to you, as I have left comments in the file to do that. I have changed very little from the official documentation’s example config, so you may wish to just start from theirs instead. Anyways, here’s the link to my config file, just save it to your home directory and make any changes that you feel are necessary.
If you’re going to use my config, make sure you have these directories created.
Open up Terminal.app and run the command rtorrent and you should be presented with a mostly blank screen that says rTorrent and the version at the top.
Add Your Torrents
Now, all you should have to do is drop your torrents in the watch directory you specified in the config file, and it should automatically pick them up and start downloading. If you chose not to use a watch directory, you can add a torrent by hitting the return key and typing in the name of the file. It has tab completion and I recommend taking advantage of it.
Learn the Commands
I don’t know them all yet, but I’m picking them up quickly. I’m not going to list them all here because the rTorrent devs already took care of it over here. A notable one though, is Ctrl-q for quit.
More and more ISPs and campuses have started to throttle or completely disable bittorrent. Encryption can sometimes help you workaround their restrictions and let you utilize all of that precious bandwidth. Look in the config file you downloaded from earlier in this guide. On line 83, you’ll see an option “encryption” that has been commented out. If you keep this line commented out, you will never use an encrypted connection. But, there are other users out there that will only accept an encrypted connection. So, we want to change this. If you uncomment the line as it is, it will allow you to accept an encrypted connection but will prefer unencrypted if that’s possible. This will enable you to connect to any body, whether they use encryption or not. But, we probably want encrypted to be the default, so let’s change it a bit.
encryption = allow_incoming,try_outgoing,enable_retry This line will initiate and accept encrypted connections but will fallback to plaintext if the other user is not using encryption. This is my preferred method, as it will allow me to connect to as many people as possible, but will use encryption where available.
encryption = enable_retry,require These two options (as I understand it) will require an encrypted connection, meaning no unencrypted connections will ever occur. The difference between require and require_rc4 is how much of the data it encrypts. Using require will only encrypt the header information, which will sometimes be enough to get around the your ISP’s throttling/blocking. The require_rc4 option will encrypt the entire stream, all the data that ever gets sent between the two clients. This is much more difficult, although not impossible, for a traffic shaper to detect. Note that require_rc4 will be much more processor intensive, so you may notice some performance differences.
encryption = enable_retry,require_rc4
Other Things to Consider
- Run rTorrent in a screen session. You can learn more about GNU screen here.
- Use Visor for you rTorrent session. Visor provides a quake-like console for OS X using Terminal.app.
- I don’t know everything. If I have a typo, mistake or just plain say something that’s incorrect, please leave a comment so I can fix it.