0

I want to build Tor from source code. Also, I was wondering if this source builds just the Tor service, or it includes the Tor Browser itself?

If not, how can the Tor service that I built and installed be attached to any browser in my computer (e.g. Firefox or Chrome)?

1
  • Your entry contains of multiple questions. It is a bit unclear, what you want to know. Do you want to know if Tor Browser can be built from source or something else? Please modify your question.
    – Jens Kubieziel
    Jul 12 at 11:31
1

In case you want to build (compile) and install Tor from source code, you can follow these steps:

Step 1:

Install pre-requisites, in this example I used a Debian based GNU Linux distribution:

sudo apt install -y git build-essential automake libevent-dev libssl-dev zlib1g-dev

Step 2:

Clone Tor from git.torproject.org:

git clone https://git.torproject.org/tor.git

Step 3:

Enter tor directory:

cd tor

Step 4:

Run autogen.sh to generate all the initial makefiles:

./autogen.sh

Step 5:

Prepare tor to be built, you can use any of the following commands (Option 1 or Option 2), but check if you receive any error messages:

  • Option 1:

    ./configure
    
  • Option 2:

    ./configure --disable-asciidoc  # do not build manpages
    

Step 6:

Run make to start the compilation process:

make

Step 7:

Install the compiled tor in your system:

make install

The location of tor binary by default will be:

/usr/local/bin/tor

You can run it by typing tor and the output will be pretty similar to this:

galoget@hackem:~$ tor
Jul 12 12:46:26.082 [notice] Tor 0.4.7.0-alpha-dev (git-9b2d179d9537b2f3) running on Linux with Libevent 2.1.11-stable, OpenSSL 1.1.1f, Zlib 1.2.11, Liblzma N/A, Libzstd N/A
 and Glibc 2.31 as libc.
Jul 12 12:46:26.082 [notice] Tor can't help you if you use it wrong! Learn how to be safe at https://www.torproject.org/download/download#warning
Jul 12 12:46:26.082 [notice] This version is not a stable Tor release. Expect more bugs than usual.
Jul 12 12:46:26.082 [notice] Configuration file "/usr/local/etc/tor/torrc" not present, using reasonable defaults.
Jul 12 12:46:26.084 [notice] Opening Socks listener on 127.0.0.1:9050
Jul 12 12:46:26.084 [notice] Opened Socks listener connection (ready) on 127.0.0.1:9050
Jul 12 12:46:26.000 [notice] Parsing GEOIP IPv4 file /usr/local/share/tor/geoip.
Jul 12 12:46:26.000 [notice] Parsing GEOIP IPv6 file /usr/local/share/tor/geoip6.
Jul 12 12:46:26.000 [notice] Bootstrapped 0% (starting): Starting
Jul 12 12:46:26.000 [notice] Starting with guard context "default"
Jul 12 12:46:27.000 [notice] Bootstrapped 5% (conn): Connecting to a relay
Jul 12 12:46:27.000 [notice] Bootstrapped 10% (conn_done): Connected to a relay
Jul 12 12:46:27.000 [notice] Bootstrapped 14% (handshake): Handshaking with a relay
Jul 12 12:46:27.000 [notice] Bootstrapped 15% (handshake_done): Handshake with a relay done
Jul 12 12:46:27.000 [notice] Bootstrapped 75% (enough_dirinfo): Loaded enough directory info to build circuits
Jul 12 12:46:27.000 [notice] Bootstrapped 90% (ap_handshake_done): Handshake finished with a relay to build circuits
Jul 12 12:46:27.000 [notice] Bootstrapped 95% (circuit_create): Establishing a Tor circuit
Jul 12 12:46:28.000 [notice] Bootstrapped 100% (done): Done

And remember, this version is not a stable Tor release, so it could have more bugs than usual.

In this guide I showed you how to build tor from source code. This does not include Tor Browser, just the service that is listening at 127.0.0.1:9050 by default.

In case you want to try it, you can configure your browser to use a proxy. Please refer to the following image to prepare your Firefox instance to browse the Internet by using the Tor service you just installed:

How to configure Mozilla Firefox to use Tor

Finally, if you prefer Google Chrome, you can use the following command to open a Chrome instance that uses the tor service you just installed:

google-chrome-stable --proxy-server="socks://127.0.0.1:9050"

As you can see in my answer, there is no requeriment to use additional plugins to route your traffic through the TOR Network.

Enjoy!

2
  • @kukiudowr667 Please, do not forget to mark the question as SOLVED and UPVOTE the answer if it solves your questions. =)
    – galoget
    Jul 12 at 18:31
  • I can't up vote I don't have enough reputation points, comments like: "thank you" are not allowed, what interested me me most is building Tor but in Windows which is probably harder than from a Linux distro. Jul 17 at 16:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.