Evandrel's Homepage

https://www.pcl2.top

Bring your website alive on Tor

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.

CharactersApproximately Time
1~3<1 second
42 seconds
51 minute
630 minutes
71 day
825 days
92122 \frac{1}{2} years
1040 years
11640 years
1210000 years
13640000 years
142600000 years
For reference only.

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

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *