paint-brush
How to Create Your Own Dark Website (.onion) on Linuxby@kalilinux
8,990 reads
8,990 reads

How to Create Your Own Dark Website (.onion) on Linux

by Kali Linux TutorialsMay 18th, 2022
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

As we know dark websites use .onion for their domain extension. The question is how can we create our own website on the Dark Web? The answer is: Very easily. No port forwarding, no spending on 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 our beloved Kali Linux system for this article but any Debian based Linux distro (Ubuntu, Linux Mint, Parrotos ,ElementaryOS) will work.

People Mentioned

Mention Thumbnail

Companies Mentioned

Mention Thumbnail
Mention Thumbnail
featured image - How to Create Your Own Dark Website (.onion) on Linux
Kali Linux Tutorials HackerNoon profile picture



As we know dark websites use .onion for their domain extension.


The question is how can we create our own website on the Dark Web?


The answer is: Very easily. No port forwarding, no spending on 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 our beloved Kali Linux system 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 to 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 lines and save the file (uncomment).


After doing this will look like the 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 a website like following:

demo html website code

Here the site is created for demo, that'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 127.0.0.1:8080


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 127.0.0.1:8080 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 127.0.0.1:80).


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 this tutorial.


Our deep website is a demo website for educational purposes, but we can host any kind of website on deep web, which is not illegal.


But we should not abuse this information to host illegal websites that break our federal laws. That will be considered a crime and we are not responsible for that.


Love our articles? Make sure to follow us on Twitter and GitHub, we post article updates there.


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


Previously published here.