How to set up Tor proxy with Raspberry Pi

Are you worried about online privacy? Perhaps you are interested in protecting your personal information from online marketers and advertisers who may want to use the data without your permission, or sell your information you to a third party. Regardless of the engine, the Tor network is one of the most common ways to avoid any form of online surveillance.

In today's article, you'll learn how to set up a Tor proxy on your Raspberry Pi and use it to automatically route traffic through Tor whenever you connect to your home network.

Set up Tor proxy with Raspberry Pi for secure browsing

  1. What is the Tor proxy server?
  2. Things to prepare
  3. Get started: Set up a Raspberry Pi
  4. Install Tor on the Raspberry Pi
  5. Configure the Tor proxy server
  6. Connect to Tor proxy from any web browser
    1. Mozilla Firefox
    2. Google Chrome (and other Chromium-based browsers)
    3. Apple Safari

What is the Tor proxy server?

Proxy servers act as intermediaries for clients who are requesting resources from the server, such as files or web pages.

When you set up the Tor proxy server, all traffic will be redirected through the Tor network. Each data packet you send via Tor is encrypted and decoded multiple times, then redirected through a number of relays, randomly selected from the thousands of relays that make up the Tor network. This way, you can hide your location and activity from anyone who is watching the network, including hiding the websites you visit, messages you send and any posts you make.

Many people access Tor through the free Tor browser, but this requires setting up the browser on any device you have Internet access. If you want to use the Tor network on all your devices or surf the web anonymously with your current web browser, it's often easier to set up the Tor proxy server, which is what you'll learn in the next section this lead.

Things to prepare

To complete this tutorial, you will need:

  1. Raspberry Pi runs Raspberry Pi OS
  2. The power cable is compatible with the Raspberry Pi
  3. External keyboard and how to attach it to a Raspberry Pi
  4. HDMI or micro HDMI cables, depending on the Raspberry Pi model
  5. External screen
  6. Ethernet cable (if not connected via WiFi)

Get started: Set up a Raspberry Pi

To get started, connect all peripherals to the Raspberry Pi.

When the Raspberry Pi starts, click the small network icon on the toolbar and connect to a WiFi network, if you don't use an Ethernet cable.

Before you begin, you should check that you are running the latest version of the Raspberry Pi OS. Open Terminal and type the following command:

sudo apt update && sudo apt -y upgrade

If you have installed one or more updates, restart your Raspberry Pi by running the following command:

sudo reboot

Install Tor on the Raspberry Pi

You can install Tor with a single Terminal command:

sudo apt install tor

You can install the Tor software on a Raspberry Pi with a single command.

You now have 2 new services running on your Raspberry Pi: tor.service and tor@default.service.

Service tor is only symbolic. To check if the actual tor @ default service is running, use the following Terminal command:

sudo systemctl status tor@default.service
How to set up Tor proxy with Raspberry Pi Picture 1 Check if the actual tor @ default service is running

If the Terminal returns an active message , you're ready to move on to the next step.

Configure the Tor proxy server

Set up the proxy server by making some changes to the Tor configuration file. Before editing this 'torr' file , you should make a backup:

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

Now that you have the backup, create a simple configuration, specify the Tor Socks proxy service on port 9050 and accept connections from the local LAN.

To open the 'torr' configuration file and edit, run the following command:

sudo nano /etc/tor/torrc

This file will now launch in the Nano editor. First, identify SocksPort , which is the IP address of your Raspberry Pi. You can get this information by running the following Terminal command:

hostname -I

Get this IP address and add the port number : 9050. For example, if the Raspberry Pi's IP address is 192.168.1.111, then add the following to the Torr configuration file:

SocksPort 192.168.1.111:9050

Add the following to the Nano editor, making sure to replace SocksPort with your own value:

SocksPort 192.168.1.100:9050 SocksPolicy accept 192.168.1.0/24 RunAsDaemon 1 DataDirectory /var/lib/tor

Once you have made the changes, save the file by pressing Ctrl+ Oand Ctrl+ Xto close.

To restart the Tor service with the new configuration, run the following command:

sudo systemctl restart tor@default.service

Connect to Tor proxy from any web browser

In this final section, you will learn how to connect to a Raspberry Pi server, using all major web browsers.

Note that you will usually connect to a Raspberry Pi using an IP address. You can access this information at any time by running it hostname -Iin the Raspberry Pi Terminal.

Mozilla Firefox

Start by configuring Firefox to use the proxy server:

1. In the upper right corner of Firefox, select the three horizontal lines icon.

2. Select Preferences.

3. In the menu on the left, select General.

4. Scroll to Network Settings and click the Settings button .

5. In the Connection Settings window , select the Manual proxy configuration checkbox .

How to set up Tor proxy with Raspberry Pi Picture 2 Select the Manual proxy configuration checkbox

6. In the SOCKS Host field , enter the IP address of the Raspberry Pi.

7. In the Port section , enter 9050.

8. Make sure the SOCKS v5 checkbox is selected.

9. Click OK.

10. Close and relaunch Firefox!

Google Chrome (and other Chromium-based browsers)

Are you using Chrome? To point Google Chrome towards the proxy server:

1. In the upper right corner of Chrome, select the three dot icon.

2. Select Settings.

3. In the menu on the left, navigate to Advanced> System .

How to set up Tor proxy with Raspberry Pi Picture 3 Navigate to Advanced> System

4. Select Open your computer's proxy settings .

The next steps will vary, depending on the operating system.

macOS

If you're a Mac user, Google Chrome will launch the Mac's Network> Proxies menu . In this window:

  1. Select SOCKS Proxy.
How to set up Tor proxy with Raspberry Pi Picture 4 Select SOCKS Proxy
  1. In SOCKS Proxy Server , enter the IP address of the Raspberry Pi.
  2. In the enclosed text box, enter the port number of 9050.
  3. Save the changes by clicking OK> Apply .
  4. Close and then relaunch Chrome.

Windows

If you are using a Windows PC, Google Chrome will launch an Internet Options window . In this window:

  1. Select the LAN settings button .
  2. Select the following checkbox: Use a proxy server for your LAN .
  3. Click on Advanced.
  4. In the Socks section , enter the IP address of the Raspberry Pi.
  5. In the Port section , enter 9050.
  6. Click Save> Apply .
  7. Relaunch Google Chrome.

Apple Safari

If you use the Apple Safari browser, then:

1. In the Safari toolbar, select Safari> Preferences .

2. Select the Advanced tab .

3. Find Proxies and select the Change Settings button .

4. In the left menu, select SOCKS Proxy .

5. In SOCKS Proxy Server , enter the IP address of the Raspberry Pi.

6. In the accompanying text field, enter the port number of 9050.

7. Save the changes by clicking OK> Apply .

8. Don't forget to relaunch Safari!

4.1 ★ | 11 Vote

May be interested

  • How to set up a proxy server in Nox App PlayerHow to set up a proxy server in Nox App Player
    although nox does not support vpn applications, but if you are using a proxy server to connect to the internet on the server, you can still configure the nox to use the same proxy server. follow the steps below to see how to configure a proxy server in the nox app player.
  • What is the Raspberry Pi and how is the Raspberry Pi used?What is the Raspberry Pi and how is the Raspberry Pi used?
    you can use the raspberry pi as a computer because everything needed has been built in. its broadcom bcm2835 soc processor includes cpu, gpu, ram, microsd card slot, wi-fi, bluetooth and 4 usb 2.0 ports.
  • How to start Raspberry Pi 3 from USBHow to start Raspberry Pi 3 from USB
    raspberry pi is a great, versatile software suite, with a variety of capabilities like running a media center or using as a radio.
  • What is Proxy? Instructions for Installing Proxy Server on PC and PhoneWhat is Proxy? Instructions for Installing Proxy Server on PC and Phone
    what is a proxy? what features do they have and how to install them? find out the details with hoang ha pc in the article below.
  • 5 reasons why you should avoid free proxy servers5 reasons why you should avoid free proxy servers
    although proxy servers are useful in dealing with geographic area restrictions when accessing the web, the level of security of free proxy servers is something that users are more interested in.
  • Why should people try Raspberry Pi 4?Why should people try Raspberry Pi 4?
    the new raspberry pi 4 has been released, but do you need to upgrade? is raspberry pi 4 really offering more features than the previous raspberry pi 3 b +?
  • Raspberry Pi AI Kit: Bring AI to Raspberry PiRaspberry Pi AI Kit: Bring AI to Raspberry Pi
    the raspberry pi ai kit is essentially raspberry pi's new m.2 hat+ board integrated with the hailo-8l acceleration module.
  • How to bypass the proxy server on the LANHow to bypass the proxy server on the LAN
    system administrators often set up proxy servers between the endpoint and the internet to monitor web traffic and block unwanted websites.
  • Learn Pi Imager, How to Use Raspberry Pi ImagerLearn Pi Imager, How to Use Raspberry Pi Imager
    the raspberry pi foundation recently released a new application for recording sd cards for the raspberry pi. the new program, called raspberry pi imager, launches march 5, 2020.
  • How to Find Proxy Servers for PS4 ConsolesHow to Find Proxy Servers for PS4 Consoles
    today's tipsmake will show you how to find and edit your playstation 4's proxy server ip address. if you don't want to use a proxy server but your ps4 keeps asking for a proxy server address, the problem is usually with the path. internet transmission. let's learn how to fix, as well as how to set up your pc as a proxy server for ps4 to improve the download speed of your console.