How to install Tor?

75,440

Solution 1

If you want to anonymously browse the internet using the Tor network

If you want to anonymously do other things using the Tor network

As of 2014-02-13, The Tor Project's Ubuntu installation page says:

"You'll need to set up our package repository before you can fetch Tor. First, you need to figure out the name of your distribution. A quick command to run is lsb_release -c or cat /etc/debian_version. If in doubt about your Debian version, check the Debian website. For Ubuntu, ask Wikipedia. Then add this line to your /etc/apt/sources.list file:

deb http://deb.torproject.org/torproject.org <DISTRIBUTION> main

where you put the codename of your distribution (i.e. lenny, sid, saucy or whatever it is) in place of <DISTRIBUTION>.

Then add the gpg key used to sign the packages by running the following commands at your command prompt:

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

Now refresh your sources, running the following command (as root) at your command prompt:

apt-get update

If there are no errors you're good to continue.

We provide a Debian package to help you keep our signing key current. It is recommended you use it. Install it using:

apt-get install deb.torproject.org-keyring

To finally install Tor just run:

apt-get install tor

Now Tor is installed and running. Move on to step two of the "Tor on Linux/Unix" instructions.

The DNS name deb.torproject.org is actually a set of independent servers in a DNS round robin configuration. If you for some reason cannot access it you might try to use the name of one of its part instead. Try deb-master.torproject.org, mirror.netcologne.de or tor.mirror.youam.de."

Step Two of "Tor on Linux/Unix" instructions:

"For information on how to Torify other applications, check out the Torify HOWTO."

Solution 2

  • Surf the web anonymously

    If you just want to browse the web anonymously or access .onion domains (so-called hidden services), the recommended and simplest way is to use the Tor Browser Bundle:

    1. Download Tor Browser bundle
    2. Extract the downloaded archive
    3. click on the file "start-tor-browser".

    If you need maximum privacy and don't want to leave any trace of a Tor installation on your computer, download, burn and boot the Live CD system Tails.


  • Torify any application

    Only when you want to torify any other application (Instant messenger, Bitcoin client, etc.), you need to follow this procedure.

    You can add the repository, download and install Tor on Ubuntu by executing the following commands in a Terminal:

    sudo apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 886DDD89
    sudo add-apt-repository "deb http://deb.torproject.org/torproject.org $(lsb_release -s -c) main"
    sudo apt-get update && sudo apt-get -y install tor-geoipdb
    

    Now you can start Tor by pressing Alt+F2 and entering tor. Applications that support a proxy can now be set up to use address localhost, port 9050 as a SOCKS proxy.


  • Custom web browser and proxy setup

    If you still want to torify your existing browser with stand-alone Tor and surf anonymously, you can install polipo

    sudo apt-get install polipo
    sudo cp /etc/polipo/config /etc/polipo/config.bak
    sudo wget -O /etc/polipo/config https://gitweb.torproject.org/torbrowser.git/blob_plain/ae4aa49ad9100a50eec049d0a419fac63a84d874:/build-scripts/config/polipo.conf
    sudo service polipo restart
    

    Set the browser proxy settings to localhost and port 8123. Check if the settigns are correct by visiting https://check.torproject.org. Keep in mind that the Tor Browser Bundle is still the best option to surf the web anonymously because it uses a custom-built version of Firefox.

Solution 3

Add this line:

deb     http://deb.torproject.org/torproject.org <DISTRIBUTION> main

to the /etc/apt/sources.list file, using sudo nano /etc/apt/sources.list.

Also, I find it easier to just download the tor browser bundle and unpack it. You get manual updates, but it informs you when there's a new version.

Solution 4

On the installation instruction page of tor you will find what you need to do, here are the instructions.

Enter the folloing commands in a terminal of your choice. (ctrl + alt + T as standard)

This procedure is the same for every version, but you need to edit the source line with your release name. The currently supported releases are:

  • Ubuntu 13.04 is "raring"

  • Ubuntu 12.10 is "quantal"

  • Ubuntu 12.04 is "precise"

  • Ubuntu 11.10 is "oneiric"

  • Ubuntu 11.04 is "natty"

  • Ubuntu 10.04 is "lucid"

add the source. by editing the source list. add the line that starts with deb. change RELEASENAME to what release you are on.

sudo nano  /etc/apt/sources

deb     http://deb.torproject.org/torproject.org RELEASENAME main

add the keys

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

update the system and install tor.

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

Solution 5

Tor Browser (torbrowser-launcher) is available in the default Ubuntu repositories in Ubuntu 16.04 and later. torbrowser-launcher handles downloading the most recent version of Tor Browser Bundle for you, in your language and for your architecture. After installing Tor Browser, it can be launched by searching for tor in the Dash and clicking the Tor Browser icon. The Tor Browser Launcher Settings app is also installed along with Tor Browser.

Tor


Unfortunately the Tor Browser developers change their signing key that is used to install Tor Browser at periodic intervals which makes the torbrowser-launcher package from the default Ubuntu repositories not work because it is not as up-to-date as the current version of Tor Browser.

These are the instructions from the official Tor Browser User Manual in case the Ubuntu torbrowser-launcher package hasn't updated the gpg key that is required to install Tor Browser. When I updated the Tor Browser Developers signing key I noticed that the key that I updated will expire in less than one year.

Install Tor Browser

  1. Navigate to the Tor Browser download page.

  2. Download the GNU/Linux .tar.xz file

  3. (Recommended) Verify the file's signature. The steps for verifying the file's signature are shown below.

  4. When the download is complete, extract the archive with the command tar -xf [TB archive] or with the Archive Manager.

  5. Navigate to the newly extracted Tor Browser directory. Right-click on start-tor-browser.desktop, open Properties and change the permission to Allow executing file as program by clicking the checkbox.

  6. Start Tor Browser from the command line by running:

     ./start-tor-browser
    

Set a keyboard shortcut to start Tor Browser

Remember the location where you downloaded the tor-browser-linux64-xx.x.xx_xx-xx.tar.xz archive. In this example I will call this location /home/your-username/Downloads/ which is the default location of the Downloads directory in Ubuntu if you replace your-username by your own user name.

Remember the directory where you extracted the Tor Browser files. In this example I will call this directory /home/your-username/Downloads/tor-browser_en-US/ where en is the abbreviation for the language and US is the abbreviation for the nation which could be different depending on your language and nation.

Go to Settings -> Keyboard -> View and Customize Shortcuts -> Set Custom Shortcut.

  • In the field after Name type Tor Browser.

  • In the field after Command type: sh -c '"/home/your-username/Downloads/tor-browser_en-US/Browser/start-tor-browser" --detach || ([ ! -x "/home/your-username/Downloads/tor-browser_en-US/Browser/start-tor-browser" ] && "$(dirname "$*")"/Browser/start-tor-browser --detach)' dummy %k

  • In order to fill in an entry in the field after Shortcut press any easy to remember keyboard shortcut combination (e.g. Ctrl + Alt +B).

enter image description here

Now you can start Tor Browser by pressing Ctrl + Alt +B.


How to verify Tor Browser's signature

Fetching the Tor Developers key

The Tor Browser team signs Tor Browser releases. Import the Tor Browser Developers signing key (0xEF6E286DDA85EA2A4BA7DE684E2C6E8793298290):

gpg --auto-key-locate nodefault,wkd --locate-keys [email protected]

This should show you something like:

gpg: key 4E2C6E8793298290: public key "Tor Browser Developers (signing key) <[email protected]>" imported
gpg: Total number processed: 1
gpg:               imported: 1
pub   rsa4096 2014-12-15 [C] [expires: 2020-08-24]
      EF6E286DDA85EA2A4BA7DE684E2C6E8793298290
uid           [ unknown] Tor Browser Developers (signing key) <[email protected]>
sub   rsa4096 2018-05-26 [S] [expires: 2020-09-12]

After importing the key, you can save it to a file (identifying it by fingerprint here):

gpg --output ./tor.keyring --export 0xEF6E286DDA85EA2A4BA7DE684E2C6E8793298290

Verifying the signature

To verify the signature of the package you downloaded, you will need to download the corresponding ".asc" signature file as well as the installer file itself, and verify it with a command that asks GnuPG to verify the file that you downloaded.

The example below assumes that you downloaded these two files to your Downloads folder.

gpgv --keyring ./tor.keyring ~/Downloads/tor-browser-linux64-9.0_en-US.tar.xz{.asc,}

The result of the command should produce something like this:

gpgv: Signature made 07/08/19 04:03:49 Pacific Daylight Time
gpgv:                using RSA key EB774491D9FF06E2
gpgv: Good signature from "Tor Browser Developers (signing key) <[email protected]>"
Share:
75,440
ali
Author by

ali

Updated on September 17, 2022

Comments

  • ali
    ali over 1 year

    I tried to install Tor on my new version of Ubuntu, but it seems that Tor is not available in the repositories.

    How else can I install and use Tor?

  • ali
    ali over 13 years
    I found out what the problem was , [Mr.jerad benge's help][1] was correct , I live in Iran and torproject site is blocked or filtered from Iran and that is why I could not download tor . I finally got it to work. [1]:askubuntu.com/a/6543/61218
  • Zignd
    Zignd over 11 years
    the following intruction didn't work sudo chown $USER -R ~/.tor-browser/ because the directory don't exist. This is the output message: chown: cannot access '/home/zignd/.tor-browser/': No such file or directory
  • Bruno Pereira
    Bruno Pereira over 11 years
    @Zignd you probably need to start tor at least once for the directory to exist.
  • Zignd
    Zignd over 11 years
    @BrunoPereira It still didn't worked, I've also install tor, polipo and tor-geoipdb. I think this answer simply don't work.
  • Admin
    Admin almost 11 years
    I did just what you wrote.Something is wrong with my PC.
  • Admin
    Admin almost 11 years
    After I typed "sudo apt-get install tor-browser" , this massage alway comeup "E: Unable to locate package tor-browser
  • Dr_Bunsen
    Dr_Bunsen almost 11 years
    Did you run sudo apt-get update? Because I just tested this, and it works.
  • king_julien
    king_julien over 10 years
    As the install page says, these are instructions to install tor - not the tor browser bundle as the OP was asking. If you only install tor, you still have to configure your applications to use tor.
  • king_julien
    king_julien over 10 years
    @ali I'm glad that you managed to find a way to install tor. I assume you also need to use bridges to connect to the tor network, right? Could you please tell me how you managed to download tor?
  • Durgesh Suthar
    Durgesh Suthar over 9 years
    After installing, when I start tor browser Error pops up "tor unexpectedly exited" Help please
  • mikemaccana
    mikemaccana over 6 years
    How well does this PPA stay on top of security updated vs the torproject.org packages?
  • Dr_Bunsen
    Dr_Bunsen over 6 years
    I do not know. Ask in irc or check the package manager
  • Mirza
    Mirza over 5 years
    I can't open the tor-project site, because it's filtered in here!
  • Sybil
    Sybil over 3 years
    Tor didn't release yet packages for Ubuntu 20.04 2019.www.torproject.org/docs/debian.html.en#ubuntu They say: Do not use the packages in Ubuntu's universe. In the past they have not reliably been updated. That means you could be missing stability and security fixes.
  • Random-Ubuntu-User
    Random-Ubuntu-User over 2 years
    It does not seem like that package exists for arm64 processors
  • Dr_Bunsen
    Dr_Bunsen over 2 years
    Arm is a totally different platform. You could always try to compile it yourself.