How to run Tor on Raspbian on the Raspberry Pi?

  • The Debian/Ubuntu packages from[docs] do not work on the Raspberry Pi when running Raspbian:

        $ tor --version
        Illegal instruction

    Why, and how can I still run Tor versions newer than what ships with Raspbian?

  • The issue

    The packages we build for deb.tpo are compiled for various Debian and Ubuntu architectures. These currently are amd64, i386 (x86-64 and x86), and two arm ports: armel and armhf.

    Arm CPUs come in different versions, and newer versions generally have more features. The arm ports of Debian differ in what kind of CPU they need as a minimum. In particular, the armhf port needs at least ARMv7.

    The arm CPU shipped in the Raspberry Pi is an ARMv6 CPU. As such, packages built for Debian's armhf port do not, in general, work on Raspberry Pi systems. Packages compiled for Debian's older arm port, armel, would work on the Raspberry Pi.

    Unfortunately however, Raspbian, a system based on Debian but built for the Raspberry Pi, still decided to call their architecture armhf, even if they can't run Debian armhf binaries. This means two things if you run Raspbian:

    • You can't install the packages we built for armel and that would work on your hardware, at least not easily[1].
    • The packages we built for Debian's armhf will install cleanly -- after all, they say they are for the same architecture as the host -- but then they will not work.


    If you want to run newer Tor versions than are available from the Raspbian folks, you will have to build them yourself.

    You can either build it from the source tarball like a lot of other Unix/Linux software and install it locally.

    The better option might be to build your own binary Debian packages using the source packages that we put up on deb.tpo. This means you will end up with nice Debian packages that you can install using dpkg and that integrate well in your current system.

    To build such packages, follow the documentation on Tor's page about Debian packages. It's a few easy steps, good luck!

    [1]: While the binaries built for armel would work on your hardware, they would need all the libraries they depend on built for armel as well. That is, you probably would need an all-armel system or a chroot. Hence "not easily".

License under CC-BY-SA with attribution

Content dated before 7/24/2021 11:53 AM