In this tutorial, I will show you exactly how to host your website on the Tor network and make it accessible via a .onion address.
I wrote this guide based on Debian, but you can easily apply it to most Linux distributions.
First, update your system and install the Tor package by running these commands:
sudo apt update
sudo apt install tor
Next, open the Tor configuration file:
sudo nano /etc/tor/torrc
Tor v3 offers better security, so I strongly recommend using it. Scroll to the bottom of the file and add these three lines:
HiddenServiceDir /var/lib/tor/[Replace this folder name]/
HiddenServiceVersion 3
HiddenServicePort 80 127.0.0.1:80
Note: Change the HiddenServicePort if your website runs on a different port.
After editing, restart Tor.
sudo systemctl restart tor
This command displays your unique .onion address (for example: k7sroz6qru2uzydjvylpnxgitxkswcib7gimuf3q4pklh3frkx52r4qd.onion).
sudo cat /var/lib/tor/[Replace this folder name]/hostname
Set permission:
sudo chown -R debian-tor:debian-tor /var/lib/tor/[Replace]/
sudo chmod 700 /var/lib/tor/[Replace]/
Use Tor Browser and access your website. If everything is set properly, you should see your website alive on the Dark Web.
Optional: Custom .onion Domain prefix
If you don’t like the random .onion address generated by Tor and want your dark web domain to start with specific characters, you can read this optional section and generate a Vanity Address.
First, you need to consider the time taken to generate a Vanity Address. It depends on the CPU performance, the number of characters you want to customize at the beginning of the domain name, and luck.
A table of time taken to generate a Vanity Address by using a 1.5GHz CPU is shown below.
| Characters | Approximately Time |
| 1~3 | <1 second |
| 4 | 2 seconds |
| 5 | 1 minute |
| 6 | 30 minutes |
| 7 | 1 day |
| 8 | 25 days |
| 9 | years |
| 10 | 40 years |
| 11 | 640 years |
| 12 | 10000 years |
| 13 | 640000 years |
| 14 | 2600000 years |
Currently, I recommend using mkp224o to generate v3 Vanity address.
Build mkp224o first. It only needs to be built once.
git clone https://github.com/cathugger/mkp224o.git
cd mkp224o
./autogen.sh && ./configure && make -j$(nproc)
start to generate
./mkp224o -d ./my_onions -t $(nproc) -n [replace with the characters amount] [replace with the characters]
After generating, there will be hostname and hs_ed25519_secret_key, etc files in the folder.
Apply the generated domain to Tor
Copy the generated folder to HiddenServiceDir
sudo cp -r ./my_onions/[replace]* /var/lib/tor/[replace]/
sudo chown -R debian-tor:debian-tor /var/lib/tor/[replace]/
sudo chmod 700 /var/lib/tor/[replace]/
Restart Tor service:
sudo systemctl restart tor
Look at the Domain:
sudo cat /var/lib/tor/[replace]/hostname
Important Notice: After generating, please back up the hs_ed25519_secret_key file. It is impossible to recover the domain if lost.
The End
www.pcl2.top/k7sroz6qru2uzydjvylpnxgitxkswcib7gimuf3q4pklh3frkx52r4qd.onion

Leave a Reply