Host Own Dark Website (.onion) on Linux

We have learns how Tor network works and how to use it in our Tor article. As we know dark websites uses .onion for their domain extension. Here the question comes can we create our own website in Dark Web using our Kali Linux system? The answer is yes easily. No port forwarding, not buying domain names.
By following our detailed guide we can host our website or entire web application on deep web with onion domain extension in 5 minutes. We have used Kali Linux for this article but any Debian based Linux distro (Ubuntu, Linux Mint, Parrotos ,ElementaryOS) will work.
host own dark web
In this article we are going to learn how we can host own .onion dark web in Kali Linux.

Install & Configure Tor

First of all we install and configure Tor service on our Kali Linux. To do that we run following command in our Kali Linux Terminal:
sudo apt-get install tor -y
Tor will be installed on our system after we provide our root password. The screenshot of the command is following:
tor install on kali linux
Then we need to configure torrc file located on /etc/tor/torrc . So we apply the following command:
sudo mousepad /etc/tor/torrc
The screenshot is following:
configuring torrc
Then we need to find these two lines (highlighted on the above screenshot) and remove # from both line and save the file (uncomment). After doing this this will look like following:
configure torrc
Now we save this file by using CTRL+S, and close this file after saving. Then we restart Tor service by using following command:
sudo service tor restart

Create & Host Website on Localhost

Now we create a web page on our desktop called index.html or index.php. We do it by using following command:
cd Desktop && touch index.html
Then we edit the web page file and code a simple website for demo. We open the html/php file in mousepad or any other text editor.
mousepad index.html
Then we write a simple html code for an website like following:
demo html website code
Here is site is created for demo, tht's why it is so simple. We can host larger web applications. Then we save (CTRL+S) and close this file. This file is in our Desktop, so we start a php based localhost server in our Desktop using following command:
php -S
Now the development server of php will be start as we can see in the following screenshot:
php development server started
Now we check our hosted localhost website, by navigating from our browser.
Example localhost website
Here we had started localhost server using php on 8080 port. We can also use port 80 (if it is not already running), but it will require root permission (sudo php -S We can also use python server or apache server or any other localhost web server to host localhost website.

Connecting Tor service with our Localhost

Then we leave this terminal window as it is(running localhost server). Then we open another terminal and type following command on new terminal:
sudo -u debian-tor tor
Let wait a bit and let it configure to 100%. This will Establish a Tor circuit, It may require couple of minutes depending on our system performance and internet speed. The screenshot is following:
Establishing a Tor circuit
All set, our dark web is hosted. Hey wait, where is the .onion link ?
.onion link is generated randomly. To see our hosted demon dark website's .onion we open another terminal window (3rd terminal,because we can't close or use those terminals, otherwise connection will lost.) and type following command to see our Dark Web address:
sudo cat /var/lib/tor/hidden_service/hostname
The screenshot is following:
onion link of our own dark web
Now we can access this .onion website with Tor browser from anywhere and any device. Learn more about Tor and Tor Browser read our this tutorial.
This is a demo website for education purpose, but we can host any kind of website on deep web that is not illegal. But we should not abuse this to host illegal websites that voids our federal laws. That will be crime and we are not responsible for that.

Love our articles? Make sure to follow our free email subscription to get all our articles directly on inbox. We are also available on Twitter and GitHub, we post article updates there.

To join our family, join our Telegram Group. We are trying to build a community for Linux and Cybersecurity.

For anything we always happy to help everyone on the comment section. As we know our comment section is always open to everyone. We read each and every comment and we always reply.

Kali Linux


Post a Comment
  • AnonymousApril 29, 2020 at 1:04 PM

    It's cool and simple, thankyou.

    Delete Comment
    • Unknown photo
      UnknownJune 13, 2020 at 7:05 PM

      Teach me

      Delete Comment
      • julie lars photo
        julie larsJune 24, 2020 at 10:09 PM

        Hello there! Good post! Please inform us when I will see a follow up! iphone psd

        Delete Comment
      • Alex smith photo
        Alex smithApril 22, 2021 at 10:07 PM

        Thank you again for all the knowledge you distribute,Good post. I was very interested in the article, it's quite inspiring I should admit. I like visiting you site since I always come across interesting articles like this one.Great Job, I greatly appreciate that.Do Keep sharing! Regards,

        Delete Comment
        • Mindest photo
          MindestApril 23, 2021 at 4:30 PM

          Thanks for another excellent post. Where else could anybody get that type of info in such an ideal way of writing? In my opinion, my seeking has ended now. convert pdf to docx

          Delete Comment
          • Ahsan Ali photo
            Ahsan AliMay 5, 2021 at 10:54 PM

            Thank you again for all the knowledge you distribute,Good post. I was very interested in the article, it's quite inspiring I should admit. I like visiting you site since I always come across interesting articles like this one.Great Job, I greatly appreciate that.Do Keep sharing! Regards,
            uk spinning bike

            Delete Comment
            • usama photo
              usamaMay 27, 2021 at 2:50 PM

              Great post, you have pointed out some fantastic points , I likewise think this s a very wonderful website. bitcoin to paypal

              Delete Comment
              • Alex smith photo
                Alex smithJune 3, 2021 at 2:54 PM

                Your blog is fabulous, superior give good results... Seen a large number of definitely will understand everybody even in the event they do not take the time to reveal.
                refomas baños zaragoza

                Delete Comment
                • naginamirliquat photo
                  naginamirliquatJune 3, 2021 at 7:06 PM

                  I am unable to read articles online very often, but I’m glad I did today. This is very well written and your points are well-expressed. Please, don’t ever stop writing. best ethereum miner

                  Delete Comment
                  • Alex smith photo
                    Alex smithJune 19, 2021 at 5:37 PM

                    Excellent information on your blog, thank you for taking the time to share with us. Amazing insight you have on this, it's nice to find a website that details so much information about different artists.
                    residence permit turkey

                    Delete Comment