Skip to content

anubhavanonymous/HostOnion

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

63 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

HostOnion Logo

πŸ§… HostOnion

Host a Hidden Service on Tor with a .onion Address β€” from your terminal.





πŸš€ About

HostOnion turns your device into a temporary Deep Web server by hosting your PHP/HTML site as a Tor Hidden Service β€” complete with a unique .onion address β€” in seconds.

It automatically:

  • Starts a local PHP server
  • Configures Tor hidden service
  • Generates a unique .onion URL
  • Routes all traffic securely through the Tor network

Once stopped, the hidden service goes offline. No lingering exposure.


πŸ†• What's New in v2.5

Feature Details
🐍 Full Python 3 rewrite Cleaner, more stable codebase
πŸ“ Custom site folder Point to any local site folder
🌐 Full PHP support Not just static HTML
πŸ”Œ Custom port --port flag for manual port selection
πŸ” Auto port detection Finds a free port if none is specified
πŸ” Onion reset --new flag to regenerate your .onion address
πŸ“± Termux + Linux Works on both Android Termux and POSIX Linux

πŸ“¦ Requirements

  • Python 3
  • PHP
  • Tor

Install on Termux

pkg install python php tor

Install on Linux (Debian/Ubuntu)

sudo apt install python3 php tor

βš™οΈ Installation

git clone https://github.com/anubhavanonymous/HostOnion
cd HostOnion

πŸ–₯️ Usage

Basic Usage

python3 hostonion.py your_site_folder

Try the Example Site

python3 hostonion.py examplesite

Custom Port

python3 hostonion.py your_site_folder --port 8080

Generate a New .onion Address

python3 hostonion.py your_site_folder --new

Press CTRL+C to stop the service.


πŸ“Ÿ Example Output

πŸ§… HostOnion v2.5 - PHP + CLI + Reset

Author: Anubhav Kashyap
GitHub: github.com/anubhavanonymous | Telegram: @anubhavanonymous

[+] Starting PHP server on port 9000 (folder: examplesite)...
[+] Starting Tor hidden service...

[+] Onion URL: http://xxxxxxxxxxxxxxxx.onion
[+] PHP running on port 9000
[+] Press CTRL+C to stop.

πŸ–ΌοΈ Screenshot

HostOnion Screenshot


🧠 How It Works

Your Site Folder
      β”‚
      β–Ό
PHP Built-in Server (localhost:PORT)
      β”‚
      β–Ό
Tor Hidden Service (torrc config)
      β”‚
      β–Ό
Unique .onion Address ← Users on Tor Browser access here
  1. Starts PHP built-in server on localhost
  2. Writes a Tor torrc config pointing to that port
  3. Generates a hidden service directory
  4. Launches Tor
  5. Waits for the .onion address to be assigned
  6. Displays your unique .onion URL

πŸ“Œ Notes

  • Originally built for Termux users β€” works on low-end Android devices
  • Now also supports Linux and other POSIX systems
  • The service is temporary β€” it goes offline when the script stops
  • Each run reuses the same .onion address unless --new is passed

⚠️ Disclaimer

This tool is for educational purposes only. The author is not responsible for any misuse. Always comply with your local laws and Tor's terms of use.


πŸ‘¨β€πŸ’» Author

Anubhav Kashyap

GitHub Telegram


⭐ Star this repo if you found it useful!