Tor allows clients and relays to offer onion services. You can offer a web server, SSH server, etc., without revealing your IP address to its users. In fact, because you don’t use any public address, you can run an onion service from behind your firewall.
First download Tor browser from the Tor website, i prefer this version of Tor browser as we can edit the configuration file to make it run as root, if we installed it with “apt install” we won’t be able to run it as root.
Now we need to host the server on our machine, let’s create a folder hidden_service:
Now create an html file and call it index.html and write inside it “Hello Hidden Web”
Start a simple server using python3 on local host and port 8080 with
python3 -m http.server –bind 127.0.0.1 8080
We’re going to edit a file “torrc” to make sure Tor is running right, navigate to /etc/tor and open torrc with any editor and add these lines to the file:
HiddenServicePort 80 127.0.0.1:8080
Save the file and exit, navigate to the /var/lib and create a folder hidden_service and give it permission:
chmod 0700 hidden_service
Restart Tor with systemctl restart tor
Then test tor by writing “tor” and you would see something like this:
In the folder we created hidden_service you will find hostname file which is the address to your tor site:
It looks weird but if we test it in the tor browser it will view the page we created earlier:
If you want to create a custom Tor onion name you can use Scallion.
Scallion lets you create vanity GPG keys and .onion addresses (for Tor’s hidden services) using OpenCL.
You can download it from here https://github.com/lachesis/scallion.git
Follow the instructions and make your own onion address.