Installing Tor on FreeBSD 11
Tor is a piece of free software and an open network that enables anonymous communication. Combined, these two components help defend against various forms of traffic analysis and network surveillance. Trying to re-explain Tor in a comprehensive way is outside the scope of this post, but please read about it via the literature provided by the project site and The Electronic Frontier Foundation (EFF) before installing.
The first step toward installing Tor on FreeBSD is deciding whether you want to install the precompiled package with
pkg, or you want to compile it yourself from the FreeBSD Ports Collection. The tradeoffs between these two approaches are well-explained within the FreeBSD Handbook. I chose the package because customizing the installation configuration beyond the defaults didn’t seem necessary.
With all of that said, from inside a
root shell install the Tor package with:
From there, copy the sample Tor configuration file into its default location and open it inside your editor:
Once inside the file, there are three settings that we want to make explicit. All should be commented out by default (
Log again), so we simply need to uncomment them. Below is a
diff of the changes between the sample and our desired configuration file:
SOCKSPort setting ensures that we’re binding Tor to
127.0.0.1 on its default port of
9050. The two
Log settings ensure that
notice level log messages are written to a specific log file, as well as
Now, we can launch Tor using the
tor command to see if things are working properly:
CTRL+C the process so that control is returned to your shell.
Lastly, let’s enable the Tor service so that it starts on its own after the system boots. To achieve that, all we have to do is ensure that
/etc/rc.conf contains the following line:
Afterwards, launch the Tor service through the service manager if you want it running prior to the next boot cycle:
That’s it. You should now have a fully functional installation of Tor running on FreeBSD.