If you're using Debian, just run as root:

# apt install tor

Debian provides the LTS version of Tor. Note that this might not always give you the latest stable Tor version, but you will receive important security fixes. To make sure that you're running the latest stable version of Tor, see option two below.

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

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.

Raspbian is not Debian. Tor might run fine on the Raspberry Pi 2 / 3 but not the first generation Pi. These packages might be confusingly broken for Raspbian users, since Raspbian called their architecture armhf but Debian already has an armhf. See this post for details.

Admin access: To install Tor you need root privileges. Below all commands that need to be run as root user like apt and dpkg are prepended with '#', while commands to be run as user with '$' resembling the standard prompt in a terminal. To open a root terminal you have several options: sudo su , or sudo -i , or su -i . Note that sudo asks for your user password, while su expects the root password of your system.

apt-transport-tor: To use source lines with https:// in /etc/apt/sources.list the apt-transport-https package is required. Install it with

# apt install apt-transport-https

to enable all package managers using the libapt-pkg library to access metadata and packages available in sources accessible over https (Hypertext Transfer Protocol Secure).

sources.list: 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.

I run Debian oldstable (jessie) Debian stable (stretch) Debian testing (buster) Debian unstable (sid) Ubuntu Trusty Tahr (14.04 LTS) Ubuntu Xenial Xerus (16.04 LTS) Ubuntu Artful Aardvark (17.10) Ubuntu Bionic Beaver (18.04 LTS) Ubuntu Cosmic Cuttlefish (18.10) and want You need to add the following entries to /etc/apt/sources.list or a new file in /etc/apt/sources.list.d/ : deb https://deb.torproject.org/torproject.org jessie main Then add the gpg key used to sign the packages by running the following commands at your command prompt: # curl https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --import # gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add - We provide a Debian package to help you keep our signing key current. It is recommended you use it. Install it with the following commands: # apt update # apt install tor deb.torproject.org-keyring # apt install build-essential fakeroot devscripts # apt build-dep tor deb.torproject.org-keyring Then you can build Tor in ~/debian-packages: $ mkdir ~/debian-packages; cd ~/debian-packages $ apt source tor $ cd tor-* $ debuild -rfakeroot -uc -us $ cd .. Now you can install the new package: # dpkg -i tor_*.deb

Then add this line to your /etc/apt/sources.list file:

deb https://deb.torproject.org/torproject.org <DISTRIBUTION> main where you put the codename of your distribution (i.e. stretch, buster, sid or whatever it is) in place of <DISTRIBUTION>. If you want to use the development branch of Tor instead (more features and more bugs), you need add a different set of lines to your /etc/apt/sources.list file:

deb https://deb.torproject.org/torproject.org <DISTRIBUTION> main deb https://deb.torproject.org/torproject.org tor-experimental-0.3.4.x-<DISTRIBUTION> main Then add the gpg key used to sign the packages by running the following commands at your command prompt: # curl https://deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --import # gpg --export A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add - Now refresh your sources, running the following command (as root) at your command prompt: # apt 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 together with tor: # apt install tor deb.torproject.org-keyring

Building from source If you want to build your own debs from source you must first add an appropriate deb-src line to sources.list . # For the stable version. deb-src https://deb.torproject.org/torproject.org <DISTRIBUTION> main # For the unstable version. deb-src https://deb.torproject.org/torproject.org <DISTRIBUTION> main deb-src https://deb.torproject.org/torproject.org tor-experimental-0.3.4.x-<DISTRIBUTION> main Substitute the name of your distro (stretch, buster, sid, xenial, ...) in place of <DISTRIBUTION>. Now refresh your sources by running (as root): # apt update You also need to install the necessary packages to build your own debs and the packages needed to build Tor: # apt install build-essential fakeroot devscripts # apt build-dep tor Then you can build Tor in ~/debian-packages: $ mkdir ~/debian-packages; cd ~/debian-packages $ apt source tor $ cd tor-* $ debuild -rfakeroot -uc -us $ cd .. Now you can install the new package: # dpkg -i tor_*.deb

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 .

deb.torproject.org is also served through via an onion service: http://sdscoq7snqtznauu.onion/

To use Apt with Tor, the apt transport needs to be installed:

# apt install apt-transport-tor

Then replace the address in the lines added before with, for example:

# For the stable version. deb tor://sdscoq7snqtznauu.onion/torproject.org <DISTRIBUTION> main # For the unstable version. deb tor://sdscoq7snqtznauu.onion/torproject.org tor-nightly-master-<DISTRIBUTION> main

Now refresh your sources and try if it's still possible to install tor:

# apt update # apt install tor

See onion.torproject.org for all torproject.org onion addresses.