Concerned about online privacy? Shield your data from advertisers, trackers, and surveillance by setting up a Tor proxy on your Raspberry Pi. This expert guide, tested on Raspberry Pi OS, shows you how to route all home network traffic through the Tor network for anonymous browsing across devices.
What is a Tor Proxy Server?
A proxy server acts as an intermediary between your device and the internet, forwarding requests and responses. With a Tor proxy, your traffic is encrypted, bounced through multiple volunteer-run relays worldwide, and decrypted at each hop—obscuring your IP address, location, and activities from ISPs, websites, and eavesdroppers.
While the Tor Browser is great for single devices, a Raspberry Pi-based Tor proxy anonymizes traffic network-wide, letting you use any browser or app seamlessly. I've relied on this setup for years to enhance privacy without compromising usability.
What You'll Need
To follow this tutorial:
- Raspberry Pi running Raspberry Pi OS
- Compatible power cable
- USB keyboard
- HDMI or micro HDMI cable (model-dependent)
- External monitor
- Ethernet cable (if not using Wi-Fi)
Getting Started: Configure Your Raspberry Pi
Connect all peripherals to your Raspberry Pi and power it on. If using Wi-Fi, click the network icon in the toolbar to connect.
Update to the latest Raspberry Pi OS for security and stability:
sudo apt update && sudo apt -y upgrade
Reboot if updates were installed:
sudo reboot
Install Tor on Your Raspberry Pi
Install Tor via the package manager:
sudo apt install tor
Verify it's active with sudo systemctl status tor.
Configure Your Tor Proxy Server
Backup the config file first:
sudo cp /etc/tor/torrc /etc/tor/torrc.backup
Edit the Tor config:
sudo nano /etc/tor/torrc
Find your Pi's IP with hostname -I (e.g., 192.168.1.111). Add these lines at the end, replacing the IP:
SocksPort 192.168.1.111:9050 SocksPolicy accept 192.168.1.0/24 RunAsDaemon 1 DataDirectory /var/lib/tor
Save (Ctrl+O, Enter) and exit (Ctrl+X). Restart Tor:
sudo systemctl restart tor@default
Connect to Your Tor Proxy from Any Browser
Use your Pi's IP (from hostname -I) and port 9050. Here's how for major browsers.
Mozilla Firefox
- Click the menu (three lines) > Settings > General > Network Settings > Settings.
- Select "Manual proxy configuration".
- SOCKS Host: Your Pi's IP; Port: 9050; Select SOCKS v5.
- OK, then restart Firefox.
Google Chrome (and Chromium Browsers)
- Menu (three dots) > Settings > Advanced > System > "Open your computer's proxy settings".
macOS:
- Select SOCKS Proxy; Server: Pi IP; Port: 9050; OK > Apply.
Windows:
- LAN Settings > "Use a proxy server" > Advanced > Socks: Pi IP:9050; Save > Apply.
Restart Chrome.
Apple Safari
- Safari > Preferences > Advanced > Proxies > Change Settings.
- Select SOCKS Proxy; Server: Pi IP; Port: 9050; OK > Apply.
- Restart Safari.
Verify You're Using Tor
Visit check.torproject.org in your browser.
Congratulations—your traffic is now Tor-routed! For portability, consider Tor Browser on USB; for speed, optimize bridges or relays.