Version 31 (modified by Dbryrtfbcbhgf, 3 years ago) (diff)


Building Command-Line Tor on macOS

Pre-Packaged Alternatives

Go to to install a pre-built Tor Browser on macOS, including a recent command-line tor.

Go to to install a command-line tor binary, or build it from source. The current MacPorts version of tor is

Obtaining a Recent libevent

  1. Go to
  2. Download the latest stable libevent tar.gz, currently 2.1.8
  3. Go to the “Building libevent from source” instructions below

PGP keys to verify the libevent source.

Nick Mathewson 2133 BC60 0AB1 33E1 D826 D173 FE43 009C 4607 B1FB

Azat Khuzhin 9E3AC83A27974B84D1B3401DB86086848EF8686D

Niels Provos B683 13D0 C293 9222 D26E DFD6 13C2 15C0 6A45 C816

Obtaining a Recent OpenSSL

The included OpenSSL 0.9.8 on macOS is too old to build tor. You need at least OpenSSL 1.0.

Build or install the x86_64 architecture of OpenSSL's stable or developer version:

Installing Pre-Built Binaries

  1. Use the instructions at to install MacPorts, but don't install tor
  2. Run: port install openssl

This installs the latest version of tor.

Building libevent from source

  1. ./configure
  2. make
  3. make verify # (optional)
  4. sudo make install

This installs libevent (currently 2.1.8)

Obtaining Stable OpenSSL

  1. Go to
  2. Download the latest stable OpenSSL tarball
  3. Go to the Building OpenSSL from Source instructions below

Obtaining Development OpenSSL

  1. Go to
  2. Clone the latest development version of OpenSSL using git
  3. Go to the Building OpenSSL from Source instructions below

Building OpenSSL from Source

  1. Run: ./Configure --prefix=/usr/local/ssl darwin64-x86_64-cc
  2. Run: make depend
  3. Run: make
  4. Run: make test # Ignore any gost failures in make test
  5. Run: sudo make install

PGP keys used to verify the OpenSSL source can be found.

Building Tor

Obtain Tor source code

Download a tor source tarball from

PGP keys used to verify the Tor source. Roger Dingledine (0x28988BF5 and 0x19F78451) or Nick Mathewson (0xFE43009C4607B1FB with signing key 0x6AFEE6D49E92B601) used to sign the Tor source code tarballs.


Clone the tor git repository from and checkout a stable or unstable branch

To build Tor from a just-cloned git repository:

  1. Run: /usr/bin/ruby -e "$(curl -fsSL" Close Terminal and reopen it before step 2.
  1. brew install automake && brew install asciidoc
  1. sh

After autogen is finished Continue to Configure and Build Tor

Configure and Build 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 to run Tor under launchd.