Raspberry Pi

How to Setup TOR Proxy on Raspberry Pi

Nowadays, people realize the importance of increasing their browsing security. For this reason, they are trying several options to ensure that the IP address they are using won’t be accessible to anyone. Different proxy tools available on the internet will let people perform private browsing. Still, they won’t ensure secure communication, nor will they allow you a good browsing experience because of too many ads.

If you are looking for a good proxy tool for your Raspberry Pi device, you should pick TOR proxy, a free and open-source software providing you the ultimate experience of private browsing. Using a TOR proxy will make it difficult for anyone to trace your internet connectivity, and it will allow you the freedom to surf any websites with ease.

How to setup TOR proxy on Raspberry Pi

In this article, we will provide you with the necessary steps to set up a TOR proxy on your Raspberry Pi device to get the freedom to perform private browsing without worrying about your activity being traced.

Step 1: First, make sure that your Raspberry Pi OS is updated and for that you will need to run the following commands.

$ sudo apt update

$ sudo apt upgrade

Step 2: Now, install TOR for the Raspberry Pi using the following command.

$ sudo apt install tor

When you complete the TOR installation on Raspberry Pi, you will get two running services: “tor.service” and [email protected]. To check whether TOR is running, you can check the second service status using the following command, as the first one is a dummy service.

$ sudo systemctl status tor@default.service

Step 3: Now, the next step is to set up the proxy server and for that, you will need to make some changes in the TOR configuration file called “torrc”. However, before making changes, you will need to back up the file using the following command.

$ sudo cp /etc/tor/torrc /etc/tor/torrc.backup

Now, open the “torrc” file using the nano editor.

$ sudo nano /etc/tor/torrc

Go down to the bottom and add the below lines.


SocksPolicy accept

RunAsDaemon 1

DataDirectory /var/lib/tor

From the above lines, replace the Socksport address “” with your Raspberry Pi address while leaving the port number the same. Also, use the first three numbers of SocksPolicy similar to your Raspberry Pi address.

Step 4: Now, restart the TOR services again using the following command.

$ sudo systemctl restart tor@default.service

Note: In this guide we are setting up a TOR proxy on Mozilla Firefox but it can be set up on the other browsers as well.

Step 5: Now, open Mozilla Firefox browser and go to its “Settings” option.

Step 6: Scroll down and find the Network Settings. Choose the “Settings” option to open the browser’s proxy configuration.

Step 7: In the Connection Settings, write your Raspberry Pi IP address in the SOCKS Host blank and use the port 9050. Choose SOCKS v5 option and click on the “OK” option to confirm the settings.

Step 8: Load the addresshttps://check.torproject.org/?lang=enon the browser and it will provide you the confirmation that TOR is set up on your browser.

Now, you can surf any website in anonymous mode as no one would be able to track your IP address.


TOR is a free and open-source proxy that lets you do internet browsing in a hidden mode. It doesn’t allow your IP to be tracked easily, ensuring secure communication on the internet. The above setup instructions will help you set up a TOR proxy on your Raspberry Pi device.

About the author

Awais Khan

I'm an Engineer and an academic researcher by profession. My interest for Raspberry Pi, embedded systems and blogging has brought me here to share my knowledge with others.