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
.onionURL - Routes all traffic securely through the Tor network
Once stopped, the hidden service goes offline. No lingering exposure.
| 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 |
- Python 3
- PHP
- Tor
pkg install python php torsudo apt install python3 php torgit clone https://github.com/anubhavanonymous/HostOnion
cd HostOnionpython3 hostonion.py your_site_folderpython3 hostonion.py examplesitepython3 hostonion.py your_site_folder --port 8080python3 hostonion.py your_site_folder --newPress
CTRL+Cto stop the service.
π§
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.
Your Site Folder
β
βΌ
PHP Built-in Server (localhost:PORT)
β
βΌ
Tor Hidden Service (torrc config)
β
βΌ
Unique .onion Address β Users on Tor Browser access here
- Starts PHP built-in server on
localhost - Writes a Tor
torrcconfig pointing to that port - Generates a hidden service directory
- Launches Tor
- Waits for the
.onionaddress to be assigned - Displays your unique
.onionURL
- 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
.onionaddress unless--newis passed
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.
Anubhav Kashyap
β Star this repo if you found it useful!

