How to Install and Use Tor Network in Your Web Browser

Privacy Online is becoming a big deal and concerned Internet users are continuously looking for effective methods or tools for surfing the web anonymously for one reason or the other.

By surfing anonymously, no can easily tell who you are, where you’re connecting from or what sites you are visiting. This way, you can share sensitive information over public networks without compromising your privacy.

The Tor network is a group of volunteer-operated servers that allows people to enhance their privacy and security while connected to the Internet.

In this article, we will show how to install Tor (the anonymizing overlay network for TCP) software and configure your web browser (Firefox and Chrome) to use it as a proxy.

Installing Tor in Linux Systems

It is highly recommended to install the Tor package from the official project repository for reasons of stability and security fixes. DO NOT use the packages in the native repositories of Linux distributions, because they are frequently out of date. Follow the instructions below to set up an official package repository on your system.

Install Tor on Debian/Ubuntu

First, you need to find out the name of your distribution using the following command.

$ lsb_release -c

Next, add the following entries to /etc/apt/sources.list file. Make sure to replace DISTRIBUTION with your actual distribution name such as xenial):

deb https://deb.torproject.org/torproject.org DISTRIBUTION main deb-src https://deb.torproject.org/torproject.org DISTRIBUTION main

Then add the gpg key used to sign the packages by executing the following commands.

$ gpg --keyserver keys.gnupg.net --recv 886DDD89
$ gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -

Next, update your software packages sources and install the Tor by issuing the following commands.

$ sudo apt update
$ sudo apt install deb.torproject.org-keyring
$ sudo apt install tor

Once you have successfully installed Tor, the service should be automatically started and enabled. You can use the systemctl command to verify its status.

$ sudo systemctl status tor

Otherwise, use these commands to start and enable it.

$ sudo systemctl start tor
$ sudo systemctl enable tor

Install Tor on CentOS/RHEL & Fedora

First, you need to find out the name of your distribution using the following command.

# cat /etc/redhat-release

Next, add the following entries to /etc/yum.repos.d/tor.repo file, and make sure to replace DISTRIBUTION name with one of the following: fc/29, el/7, or el/76 according to your distribution.

[tor]
name=Tor repo
enabled=1
baseurl=https://deb.torproject.org/torproject.org/rpm/DISTRIBUTION/$basearch/ gpgcheck=1 gpgkey=https://deb.torproject.org/torproject.org/rpm/RPM-GPG-KEY-torproject.org.asc [tor-source] name=Tor source repo enabled=1 autorefresh=0 baseurl=https://deb.torproject.org/torproject.org/rpm/DISTRIBUTION/SRPMS gpgcheck=1 gpgkey=https://deb.torproject.org/torproject.org/rpm/RPM-GPG-KEY-torproject.org.asc

Next, update your software packages sources and install the Tor by issuing the following commands.

# yum update
# yum install tor

Once Tor installed, you can start, enable and verity the status using following commands.

# systemctl start tor
# systemctl enable tor
# systemctl status tor

Configure Web Browser To Use Tor Network

To Torify your web browser, you need to use SOCKS directly by pointing your web browser at Tor (localhost port 9050). To confirm that tor is listening on this port, run the following netstat command.

$ sudo netstat -ltnp | grep "tor"

tcp        0      0 127.0.0.1:9050          0.0.0.0:*               LISTEN      15782/tor

Configure Tor on Firefox

Go to Preferences → Under Network Settings → Settings, under Configure Proxy Access to the Internet, select the option Manual proxy configuration.

Then set the SOCKS Host to 127.0.0.1 and Port to 9050 and check the option Proxy DNS when using SOCKS v5 and click OK.

Use Tor Network in Firefox
Use Tor Network in Firefox

The next step is to test if your browser has been successfully torified by visiting the link: check.torproject.org. If you see the message in the screenshot below, it means a correct configuration.

Check Firefox Using Tor Network
Check Firefox Using Tor Network

Configure Tor on Chrome

Go to Settings → Under Advanced, click on Privacy and Security, then under System, click on Open proxy settings.

Chrome Proxy Configuration
Chrome Proxy Configuration

If your desktop environment is not supported or there was a problem launching your system configuration, you need to enable the proxy settings from the command line using the google-chrome-stable tool using the --proxy-server option.

$ google-chrome-stable --proxy-server="socks://127.0.0.1:9050"
Enable Chrome Proxy Support in Linux
Enable Chrome Proxy Support in Linux

The above command will launch a new window in existing browser session, use it to test whether Chrome has been torified (as shown before).

Attention: If you want to use Tor for more effective anonymous web browsing, please install and use the Tor Browser.

In this article, we have shown how to install Tor and configure your web browser to use it as a proxy. Keep in mind that Tor can not solve all anonymity problems. It only aims to protect the transport of data from one end to another. If you have any thoughts to share or questions, use the comment form below.

Aaron Kili
Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge.

Each tutorial at TecMint is created by a team of experienced Linux system administrators so that it meets our high-quality standards.

Join the TecMint Weekly Newsletter (More Than 156,129 Linux Enthusiasts Have Subscribed)
Was this article helpful? Please add a comment or buy me a coffee to show your appreciation.

7 Comments

Leave a Reply
  1. This method doesn’t work unless there are other criteria that need to be true. You’ll get a “The proxy server is refusing connections” error.

    This tutorial should be made more detailed. The author should specify what other systems and/or browser settings need to be enabled or disabled prior to doing this because there’s obviously a conflict. The fact that they are getting a screenshot that says they’re connected to Tor and others who follow these steps are not necessarily meant settings are out of sync somewhere.

    FYI, if you use Android, Orbot will allow you to configure Tor with no problem and it will just route all your device traffic through it with a simple click. Quite literally, setting up a Tor proxy on Android is pretty much this simple. But it doesn’t appear the instructions are complete for desktop PC browsers.

    Reply
  2. I am getting this error using Firefox.

    The proxy server is refusing connections

    An error occurred during a connection to check.torproject.org.

    Check the proxy settings to make sure that they are correct.
    Contact your network administrator to make sure the proxy server is working.

    Reply
  3. Not work as it has some inaccuracy, this’s working:

    $ gpg --keyserver keyserver.ubuntu.com --recv A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89
    gpg: key EE8CBC9E886DDD89: public key "deb.torproject.org archive signing key" imported
    gpg: Total number processed: 1
    gpg:               imported: 1
    
    $ gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | sudo apt-key add -
    OK
    
    Reply

Got Something to Say? Join the Discussion...

Thank you for taking the time to share your thoughts with us. We appreciate your decision to leave a comment and value your contribution to the discussion. It's important to note that we moderate all comments in accordance with our comment policy to ensure a respectful and constructive conversation.

Rest assured that your email address will remain private and will not be published or shared with anyone. We prioritize the privacy and security of our users.