Setting Up an Onion Website in a Ubuntu Docker Container¶
Step 1: Install Docker¶
If Docker is not installed, install it using:
- Windows/Mac: Download Docker Desktop from Dockerโs official website.
- Linux (Ubuntu/Debian):
Step 2: Run an Ubuntu Docker Container¶
---name tor-hidden-service
: Names the container. - -p 8080:8080
: Maps container's web server to the local machine. Step 3: Install Required Packages Inside the Container¶
Step 4: Configure Tor for a Hidden Service¶
Add the following lines at the bottom:
Save and exit (Press CTRL+X
, then Y
, then Enter
).
Restart Tor:
Step 5: Get Your .onion Address¶
Example output:Step 6: Set Up a Web Server¶
Modify the Nginx configuration:
Change the content to: Save and exit.Restart Nginx:
Step 7: Create a Simple Web Page¶
Step 8: Test Your Onion Website¶
- Open Tor Browser.
- Visit
abcxyz123456789.onion
.
Step 9: Manage the Docker Container¶
To exit but keep the container running:
To stop the container:
To restart it: