Comprehensive Guide: Installing Multiple Tor Hidden Services on Whonix Without a Panel (CLI Method)

How to Install Multiple Tor Hidden Services on Whonix Without a Panel (CLI Method)

This guide will walk you through setting up two or more Tor hidden services on Whonix without using any control panel. We will use command-line tools to install and configure Nginx, PHP, and MySQL on the Whonix Workstation VM and set up Tor hidden services on the Gateway VM.

By the end of this guide, you will have a fully functional Tor onion server running on Whonix inside VirtualBox.


1. Understanding Whonix: How It Works and Its Advantages

What is Whonix?

Whonix is a security-focused operating system designed for anonymous browsing, hosting, and secure communication. It consists of two virtual machines:

  • Whonix-Gateway (Tor Gateway): Routes all traffic through Tor.
  • Whonix-Workstation (App VM): Runs applications and hosts hidden services.

Advantages of Whonix

Full Tor Anonymity – All traffic passes through Tor.
IP Address Protection – Your real IP is never exposed.
Isolation – Even if the workstation is compromised, the attacker cannot leak your real IP.


2. Download and Install Whonix VMs on VirtualBox

  1. Go to Whonix official website and download Whonix for VirtualBox.
  2. Install VirtualBox on your system if not already installed.
  3. Import the Whonix-Gateway and Whonix-Workstation VMs into VirtualBox.
  4. Start Whonix-Gateway and configure it:
    • Open a terminal in Whonix-Gateway and run: sudo apt update && sudo apt upgrade -y
    • Make sure Tor is running: sudo systemctl restart tor
  5. Start Whonix-Workstation and update it as well: sudo apt update && sudo apt upgrade -y

Now, both Whonix-Gateway and Whonix-Workstation are ready.


3. Setting Up Nginx, PHP, and MySQL on Whonix-Workstation

We will install and configure the LEMP stack (Linux, Nginx, MySQL, PHP) on Whonix-Workstation.

3.1 Install Nginx

Run the following command in Whonix-Workstation:

sudo apt install nginx -y

Start and enable Nginx to run on boot:

sudo systemctl start nginx
sudo systemctl enable nginx

Verify that Nginx is running:

systemctl status nginx

3.2 Install PHP

Install PHP and required modules:

sudo apt install php php-fpm php-mysql -y

Start and enable PHP-FPM service:

sudo systemctl start php7.4-fpm  # Adjust the version if necessary
sudo systemctl enable php7.4-fpm

Verify PHP installation:

php -v

3.3 Install MySQL (MariaDB)

sudo apt install mariadb-server -y

Secure MySQL installation:

sudo mysql_secure_installation

Enable and start MySQL:

sudo systemctl start mariadb
sudo systemctl enable mariadb

Verify MySQL is running:

systemctl status mariadb

3.4 Create a Database and User

  1. Login to MySQL: sudo mysql -u root -p
  2. Create a new database: CREATE DATABASE tor_site;
  3. Create a new MySQL user: CREATE USER 'tor_user'@'localhost' IDENTIFIED BY 'securepassword'; GRANT ALL PRIVILEGES ON tor_site.* TO 'tor_user'@'localhost'; FLUSH PRIVILEGES; EXIT;

4. Configuring Tor Hidden Services on Whonix-Gateway

Now, we will configure multiple Tor hidden services to point to the Nginx server on Whonix-Workstation.

4.1 Edit the Tor Configuration File

On Whonix-Gateway, open the torrc file:

sudo nano /etc/tor/torrc

Add the following lines at the bottom:

HiddenServiceDir /var/lib/tor/hidden_service1/
HiddenServicePort 80 10.152.152.10:8081

HiddenServiceDir /var/lib/tor/hidden_service2/
HiddenServicePort 80 10.152.152.10:8082

10.152.152.10 this is Whonix-Workstation VM IP

Save and exit (CTRL + X, then Y and Enter).

4.2 Restart Tor to Apply Changes

sudo systemctl restart tor

Retrieve your .onion addresses:

sudo cat /var/lib/tor/hidden_service1/hostname
sudo cat /var/lib/tor/hidden_service2/hostname

These are your Tor hidden service domains.


5. Configuring Nginx for Multiple Tor Hidden Services

On Whonix-Workstation, create Nginx configuration files:

sudo nano /etc/nginx/sites-available/hidden1

Add the following content:

server {
    listen 8081;
    server_name localhost;
    root /var/www/hidden1;
    index index.php index.html;
}

Save and exit, then create another config for the second site:

sudo nano /etc/nginx/sites-available/hidden2

Add the content:

server {
    listen 8082;
    server_name localhost;
    root /var/www/hidden2;
    index index.php index.html;
}

Enable both sites:

sudo ln -s /etc/nginx/sites-available/hidden1 /etc/nginx/sites-enabled/
sudo ln -s /etc/nginx/sites-available/hidden2 /etc/nginx/sites-enabled/
sudo systemctl restart nginx

6. Uploading Files to Server & Setting Permissions

Create directories for your sites:

sudo mkdir -p /var/www/hidden1 /var/www/hidden2
sudo chown -R www-data:www-data /var/www/hidden1 /var/www/hidden2
sudo chmod -R 755 /var/www/hidden1 /var/www/hidden2

Upload files via SCP or manually move them to the directories.


7. Testing Your Hidden Services

  1. Open Tor Browser.
  2. Enter your .onion addresses.
  3. If everything is set up correctly, you should see your websites live on Tor!

Conclusion

In this guide, we have:
✅ Installed and configured Whonix-Gateway and Whonix-Workstation.
✅ Set up Nginx, PHP, and MySQL via command line.
✅ Configured two or more Tor hidden services on Whonix-Gateway.
✅ Connected them to Nginx running on Workstation.
✅ Secured database access and file permissions.

Your anonymous Tor websites are now online and fully secured. 🚀

Check out this comprenhensive article on same topic: https://darknews.click/2024/10/setting-up-tor-hidden-services-on-linux-whonix-with-webmin-panel-a-step-by-step-guide/

Author :

0 thoughts on “Comprehensive Guide: Installing Multiple Tor Hidden Services on Whonix Without a Panel (CLI Method)

Leave a Reply

Recent Posts

program9 social network
molly9 SEO agency
server5 web hosting
molly9 free blogs
blog5 free blogs
seoworks.click seo blog
free web hosting
web analytics
seo reports tool
hetzner cloud