Thanks for that. You're using Termux, which is awesome—but it has a different structure from traditional Linux setups. That’s why you're getting: cat: /var/lib/tor/hidden_service/hostname: No such file or directory
. Let’s get your Tor hidden service set up properly on Termux, and then you'll be able to fetch your .onion address.
Fetching Your .onion Address
Command:
cat ~/.tor/hidden_service/hostname
Output:
http://ako2ti3lggd6eymgbiiomzaxsrbes43b6ba22pyrtchcupwnjkknwkad.onion
Your .onion address:
ako2ti3lggd6eymgbiiomzaxsrbes43b6ba22pyrtchcupwnjkknwkad.onion
🔥 Boom. There it is. That means your Tor hidden service is live (as long as Tor is running and you have a service listening on port 8080—or whatever port you mapped).
✅ Step-by-Step: Create a Tor Hidden Service in Termux
- Install Tor in Termux
If you haven’t already:
pkg update && pkg upgrade
pkg install tor
- Create a torrc Configuration File
Create a directory to hold the hidden service info:
mkdir -p ~/.tor/hidden_service
Now create a torrc file:
nano ~/.tor/torrc
Paste the following:
HiddenServiceDir /data/data/com.termux/files/home/.tor/hidden_service/
HiddenServicePort 80 127.0.0.1:8080
(You can change the internal port 8080 to whatever port you're running a service on—like a web server.)
- Start Tor with Your Config
Run this command:
tor -f ~/.tor/torrc
It will generate keys and your .onion address.
- Fetch Your .onion Address
After Tor has run for a moment and created the hidden service, get your address:
cat ~/.tor/hidden_service/hostname
You’ll see something like:
ako2ti3lggd6eymgbiiomzaxsrbes43b6ba22pyrtchcupwnjkknwkad.onion
🧠 Notes
• Keep tor running for the service to remain active.
• If you want this to persist, use Termux:Boot and a small script.
• You may need to run a local web server on port 8080 (python3 -m http.server 8080, for example) to serve content.
If anything fails during those steps, let me know the exact error and I’ll help troubleshoot. Want me to help you auto-generate the whole setup as a shell script?
✅ Next Steps: Using Your .onion Address
🚀 1. Run a Local Service
For example, serve a webpage or files:
python3 -m http.server 8080
This will serve files in your current directory at http://localhost:8080, and Tor will expose that to the .onion world.
🌐 2. Access via Tor Browser
Paste this into Tor Browser:
http://ako2ti3lggd6eymgbiiomzaxsrbes43b6ba22pyrtchcupwnjkknwkad.onion
You should see whatever your local service is serving.
💡 Pro Tips
• Want to make it persistent? Use termux-wake-lock to keep Tor alive.
• Want HTTPS over .onion? That's native. Tor handles encryption internally. No need for certificates.
• Want a better front-end? I can help you make a static site or drop-in CMS.
You did it. Let me know if you want to automate this whole setup, protect it with passwords, or start collecting access logs anonymously. You're now officially operating in the dark web frontier.
Troubleshooting: Stealth Client Authorization
You're almost there—just a few small adjustments, and you'll have a fully functioning stealth-authorized .onion hidden service running through Termux. Let me break down what’s happening and what you need to do next.
🔍 Issue 1: HiddenServiceAuthorizeClient: command not found
That line:
HiddenServiceAuthorizeClient stealth myclient
is Tor config syntax, not a shell command. You’re trying to run something that belongs in your torrc file from the shell, which is why it's throwing an error.
✅ Fix It: Edit torrc to Add Stealth Client Auth
Edit your ~/.tor/torrc file and add these lines:
HiddenServiceDir ~/.tor/hidden_service/
HiddenServicePort 80 127.0.0.1:8080
HiddenServiceAuthorizeClient stealth myclient
✅ Make sure myclient is a short tag or username you want to use to identify the client.
🔄 After Editing torrc, Restart Tor
If Tor is running, kill it:
pkill tor
Then restart it:
tor -f ~/.tor/torrc &
Tor will now:
- Generate a new .onion address (if it didn't exist already)
- Restrict access to only authorized clients
🔐 How to Get the Client Auth File
Tor will generate a file in:
~/.tor/hidden_service/authorized_clients/
Check it like this:
ls ~/.tor/hidden_service/authorized_clients/
You’ll find something like:
myclient.auth
View it:
cat ~/.tor/hidden_service/authorized_clients/myclient.auth
It looks like:
descriptor:x25519:
Give that string (or the .auth file) to the person or browser you want to allow access.
🔐 How to Use It in Tor Browser
To visit a stealth .onion site in Tor Browser, the user must:
- Go to about:preferences#privacy in the browser.
- Scroll to "Onion Services" → click "Add a Client Authorization".
- Paste in the full .auth line.
- Restart Tor Browser.
- Now they can access your .onion.
🧪 Testing Locally
Start a local web server:
python3 -m http.server 8080
Then visit your .onion address in Tor Browser (after adding auth, if applicable).
Want help automating this, creating multiple auth clients, or managing logs securely? Just say the word.