First you need to install TOR on your device
apt install tor
Once Done, Install Web-server on your host
$ sudo apt install nginx
Update TOR Configuration(torrc) file as below
HiddenServiceDir /var/lib/tor/my_website/
HiddenServicePort 80 127.0.0.1:80
/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
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)
you don't need nginx. I even hosted an astro website in tor. just change
HiddenServicePortto what ever port you want. In my case I have doneI have runned astro in development mode just for testing