DEV Community

Sarvesh Huddedar
Sarvesh Huddedar

Posted on

Host your own Dark Site

First you need to install TOR on your device

apt install tor
Enter fullscreen mode Exit fullscreen mode

Once Done, Install Web-server on your host

$ sudo apt install nginx
Enter fullscreen mode Exit fullscreen mode

Update TOR Configuration(torrc) file as below

 HiddenServiceDir /var/lib/tor/my_website/
 HiddenServicePort 80 127.0.0.1:80
Enter fullscreen mode Exit fullscreen mode

/var/lib/tor/my_website/ - this folder should contain your website contents along with TOR keys

Save and restart tor service

sudo systemctl restart tor
Enter fullscreen mode Exit fullscreen mode

Once done, check your HiddenServiceDir for filename as hostname
this file will contain public .onion URL which you will be able access using TOR network.

Friendly advise: Keep keys private else this address can be utilized by others if keys are not private.

Top comments (1)

Collapse
 
dshaw0004 profile image
Dipankar Shaw • Edited

you don't need nginx. I even hosted an astro website in tor. just change HiddenServicePort to what ever port you want. In my case I have done

npm run dev
Enter fullscreen mode Exit fullscreen mode

I have runned astro in development mode just for testing

HiddenServicePort 80 127.0.0.1:4321
Enter fullscreen mode Exit fullscreen mode