There is a lot of misconception around the dark web, and most people think that it is not possible to create their website on the Dark web (The Onion network). Today we will set up a website in the Onion/Tor network for free (With our own home server). As you can see above, I have created my website in the Tor network, and I've accessed it using the Tor Browser. This tutorial consists of four steps: Preparing your computer (Not a real step) Installing & Configuring nginx Installing Tor Configuring the Tor server Ingredients An old computer (You can try on AWS EC2, but I've not tried it there) 💻 A stable internet connection 🌐 2 hours ⌚ Comfort using terminal ⌨ Instructions To begin with, find a spare computer that can be used as a server (If you don't have one, you can try following the tutorial on an AWS EC2 or similar service). Also, you do not need a static IP for your dark web website. To follow the tutorial, You will need to install a Linux-based OS on the server (we will refer to your spare computer/cloud computer as a server from now), I have tested the below steps on and I recommend that you also use the same. Ubuntu 20.04 doesn't seem to work well with Tor. Ubuntu 18.04 Server LTS It is also recommended to use SSH to connect to your server since there will be no GUI, you will not be able to open this article on the server and copy-paste the commands. Typing the commands out will be time taking & also very error-prone. In this article, I will not explain how to use & configure SSH but you can refer to the below link to understand & use SSH. s How To Use SSH To Connect To A Remote Server In Linux Or Window : Make sure you are running as root throughout the tutorial. Important sudo su Let's get our hands dark 😎 Installing & Configuring nginx The role of is to serve the HTML files and assets (act as a web server). nginx apt update apt install nginx The above commands will update the server & install . To start the server nginx nginx service nginx start To check the status of the server nginx service nginx status To confirm if the server is working. We will make a request to the server using . Before that, you'll need to know what is your IP address. nginx GET curl ifconfig The output will be similar to this lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536 inet 127.0.0.1 netmask 255.0.0.0 inet6 ::1 prefixlen 128 scopeid 0x10<host> loop txqueuelen 1000 (Local Loopback) RX packets 134 bytes 21230 (21.2 KB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 134 bytes 21230 (21.2 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 wlp9s0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500 inet your-ip-address netmask 255.255.255.0 broadcast inet6 ether RX packets 6379 bytes 8574482 (8.5 MB) RX errors 0 dropped 0 overruns 0 frame 0 TX packets 3518 bytes 506008 (506.0 KB) TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0 ###.###.#.### ####::####:####:####:#### prefixlen 64 scopeid 0x20<link> ##:##:##:##:##:## txqueuelen 1000 (Ethernet) Find your IP address in Note it down, using that now make a request. inet your-IP-address. curl curl your-IP-address:80 The console should print out the HTML code of the default page. You can also check if is working by typing the IP address of the server in your browser. nginx nginx To add your custom page, follow the steps from their official documentation. Beginner's guide - nginx Installing Tor Installing Tor (not just the browser) allows your computer to communicate with the Tor network. Before installing Tor, we will have to install , so that we can use source lines with apt-transport-https https:// apt install apt-transport-https : The below commands are for Ubuntu 18.04 only Important If you are running another OS, please find the commands . We will now open the sources file to add the Tor sources. here, from Tor's official, site touch /etc/apt/sources.list.d/ nano /etc/apt/sources.list.d/ Once the editor is open, add the following sources to the file deb https: deb-src https: //deb.torproject.org/torproject.org bionic main //deb.torproject.org/torproject.org bionic main After exit & saving, type the following in the terminal. This is to add the gpg key used to sign the Tor packages. curl https: gpg -- A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89 | apt-key add - //deb.torproject.org/torproject.org/A3C4F0F979CAA22CDBA8F512EE8CBC9E886DDD89.asc | gpg --import export Finally, now we install Tor and also a package that will help to keep the signing key current. apt update apt install tor deb.torproject.org-keyring Similar to , Tor can be started & checked by the following commands nginx service nginx start service nginx status Setting up the tor server Now that we have & Tor up and running, we will have to configure Tor so that our server acts as a Tor server nginx (Your server will not be used as a relay node) For this, we will have to edit the file. The is the configuration file for your Tor, the power of the file is such that, you can alter Tor to act as a proxy server & contribute to the Tor network (Not in this tutorial). In this tutorial, the will be configured to act as a tor webserver (onion service). torrc torrc torrc nano /etc/tor/torrc In the file, Go to the middle section and look for the line torrc ############### This section is just location-hidden services ### for And uncomment the following lines. HiddenServiceDir / /lib/tor/hidden_service/ HiddenServicePort : var 80 127.0 .0 .1 80 In these lines, will tell Tor where to save the private_key & hostname of your Tor website (They are information about your dark website). The private key stored is very important & could be used to impersonate you. In case you change your server, you just need to copy-paste your private key into the new server. HiddenServiceDir lets you specify a virtual port (that is, what port people accessing the website will think they're using) and an IP address and port for redirecting connections to this virtual port. HiddenServicePort To apply this new configuration, Stop the Tor service and start it again by typing the following commands. service tor stop service tor start Now check the status of the tor service to see if the changes are working & valid. service tor status If things are looking good, proceed to the next step, otherwise, you might have made a mistake in editing the file. .torrc At this point, your dark website must be running. But we don't know what is the URL, to get it, run the following command cat / /lib/tor/hidden_service/hostname var The URL to your all-new dark website will be printed in the console. To test if it's working curl -v --socks5-hostname localhost: http: 9050 //your-onion-domain.onion The URL is actually . Tor has a different way of identifying websites, i.e. via their public RSA key. your-public-RSA-key.onion You might notice that the URL generated, is very long and you might be wondering how to create a custom hostname (i.e. Custom RSA public key). I will be creating an article on this topic very soon. Now let's celebrate on your first dark website 🎉.