Mar 25, 2025
Create a tor website
Creating a website on the Tor network (also known as an onion service) requires a few key steps. Below is an overview of the process:
Step 1: Set Up a Linux Server
You need a VPS or dedicated server running Linux (Debian, Ubuntu, or CentOS recommended). You should also have root or sudo access.
Step 2: Install Tor
First, update your package list and install Tor:
1 | sudo apt update && sudo apt install tor -y |
Step 3: Configure Tor for an Onion Service
Edit the Tor configuration file:
1 | sudo vi /etc/tor/torrc |
Uncomment and modify these lines:
1 | HiddenServiceDir /var/lib/tor/hidden_service/ |
- The HiddenServiceDir is where Tor will generate your
.onionaddress. - The HiddenServicePort maps the onion address to your web server.
127.0.0.1:8080means the website should run on port 8080 locally.
Save and exit .
Restart Tor to apply changes:
1 | sudo systemctl restart tor |
Now, find your .onion domain:
1 | cat /var/lib/tor/hidden_service/hostname |
Step 4: Set Up a Web Server (Nginx or Apache)
Install a web server (Nginx recommended):
1 | sudo apt install nginx -y |
Edit the Nginx configuration file:
1 | sudo vi /etc/nginx/sites-available/tor_site |
Add this content:
1 | server { |
Save and exit, then enable the site:
1 | sudo ln -s /etc/nginx/sites-available/tor_site /etc/nginx/sites-enabled/ |
Now, create an index.html file inside /var/www/tor_site/:
1 | sudo mkdir -p /var/www/tor_site |
Set the correct permissions:
1 | sudo chown -R www-data:www-data /var/www/tor_site |
Step 5: Access Your Tor Website
Your .onion address (found in /var/lib/tor/hidden_service/hostname) is now live! Open Tor Browser and visit your new Tor website.
Other
Cheap VPS Recommendations Page: