Go to https://www.torproject.org/download/download-easy.html.en#mac to install a pre-built Tor Browser on macOS, including a recent command-line tor.
Go to https://www.torproject.org/docs/tor-doc-osx.html.en to install a command-line tor binary, or build it from source. The current MacPorts version of tor is 0.3.1.8
=== Obtaining a Recent libevent ===
1. Go to http://libevent.org/
1. Download the latest stable libevent tar.gz, currently 2.1.8
1. Go to the “Building libevent from source” instructions below
1. Run: make test # Ignore any gost failures in make test
1. Run: sudo make install
PGP keys used to verify the OpenSSL source can be found. https://www.openssl.org/community/omc.html
== Building Tor ==
=== Obtain Tor source code ===
Download a tor source tarball from https://dist.torproject.org/
PGP keys used to verify the Tor source. https://www.torproject.org/docs/signing-keys.html Roger Dingledine (0x28988BF5 and 0x19F78451) or Nick Mathewson (0xFE43009C4607B1FB with signing key 0x6AFEE6D49E92B601) used to sign the Tor source code tarballs.
OR
Clone the tor git repository from https://git.torproject.org/tor.git and checkout a stable or unstable branch
To build Tor from a just-cloned git repository:
1. Run: `/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"` Close Terminal and reopen it before step 2.
After autogen is finished Continue to `Configure and Build Tor`
=== Configure, Build and install Tor ===
1. Run: `./configure --prefix=/usr/local/tor --with-openssl-dir=/usr/local/ssl --with-libevent-dir=/usr/local/lib && make && make check && sudo make install`
Optional you can add `--disable-asciidoc` flag to the ./configure command to build without manpages.
You should now have a working tor installation in /usr/local/tor
The `Torrc` File is location is at /usr/local/tor/etc/tor and it is called "torrc.sample". Edit the torrc file and save it, then remove the .sample from the file name before running Tor.
Enter `/usr/local/tor/bin/tor` into terminal and click `Return` to start Tor.
,,`If you get a error similar to " Found linkable libevent in (system), but it does not seem to run, even with -R. Maybe specify another using --with-libevent-dir}" go to "Obtaining a Recent libevent"`,,
== Running Tor ==
See https://trac.torproject.org/projects/tor/wiki/doc/MacRunOnBoot to run Tor under launchd.