On this page, the commands to manage the web server are based on Debian-like operating systems and may differ from other systems. Check your web server and operating system documentation. To install apache2 package:. To install nginx package:. By default, the web server will be running on localhost at the end of the installation.
Then try putting a file in the main html directory, and make sure it shows up when you access the site. The next step is opening the config file of Tor torrc and doing the appropriate configurations to setup an onion service. Depending on your operating system and setup, your Tor configuration file can be at a different location or look different. The HiddenServiceDir line specifies the directory which should contain information and cryptographic keys for your onion service.
The HiddenServicePort line specifies a virtual port that is, the port that people visiting your onion service will be using , and in the above case it says that any traffic incoming to port 80 of your onion service should be redirected to Tip: A good practice to avoid leaking an onion service to a local network is to run onion services over Unix sockets instead of a TCP socket. You will need to edit and put the following two lines in your torrc file:.
If Tor starts up again, great. Otherwise, something is wrong. First look at your logfiles for hints. It will print some warnings or error messages. That should give you an idea of what went wrong. When Tor starts, it will automatically create the HiddenServiceDir that you specified if necessary. Make sure this is the case. Now to get your onion service address, go to your HiddenServiceDir directory, and find a file named hostname. The hostname file in your onion service configuration directory contains the hostname for your new onion v3 service.
The other files are your onion service keys, so it is imperative that these are kept private. If your keys leak, other people can impersonate your onion service, deeming it compromised, useless, and dangerous to visit.
Now you can connect to your onion service using Tor Browser, and you should get the html page you setup back in Step 1. It is important to note that an onion service configured like this will be readable by anybody who knows or discovers the address.
You can make onion services require authentication, and only users with a private key will access the service. Read more about Client authorization documentation. If you want to forward multiple virtual ports for a single onion service, just add more HiddenServicePort lines.
If you want to run multiple onion services from the same Tor client, just add another HiddenServiceDir line. The most reliable service to check if Tor is running is the second one. The command:. The Tor main configuration file is named torrc. Before editing, create a backup copy:. A very simple configuration will expose Tor Socks proxy service on Tor default port and will accept connections only from local LAN Now you need to configure your client to use Socks proxy server for internet connections.
You have to check this, depending on your client browser. You should have a configuration like the following picture:. Close and then restart your browser. Now you are using your Tor network in your browser. This article was originally posted at peppe8o. Creating a single proxy server with pihole and TOR proxy together is a bit more complex, requiring to configure a stack with pihole routing its traffic to in-built TOR proxy.
Ok ok Very informative article, thanks for writing. Thank you Abhinav. Thanks for this. Quite interesting and works like a charm. I am setting up an old Rasp 3B with few services including this ver tor proxy and I am wondering whether the raspi itself will route all its traffic through Tor by default? As the raspberry itself will be generating traffic, Is there something else I have to set up? Thanks a lot in advance! Thank you for your feedback! I got raspberry pi 4 and i want to install TOR.
I know i can just simply install so i need to use Chromium. However, either your system is not supported or there was a problem launching your system configuration. Thank you for your tutorial! Here are my logs:. Jun 11 access tor: Jun 11 Set up a Tor proxy with Raspberry Pi to control internet traffic Opensource. Create an anonymous server and browser with these simple steps and a few pieces of affordable hardware.
Image by :. Get the highlights in your inbox every week. First things first: What are proxy servers, and why use them? More on Raspberry Pi. What is Raspberry Pi? SocksPort Adding a display to a travel-ready Raspberry Pi Zero. A small eInk display turns a Raspberry Pi into a self-contained, pocket-sized travel computer.
Peter Garner. How to create a vanity Tor. Generate a vanity. Kc Nwaezuoke.