Skip to content

ByteBreach/torhost

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TorHost - Tor Hidden Service Setup Tool

Python Version License Platform Tor Service

One-command setup for Tor hidden services (onion services)

Table of Contents

Features

  • One-command setup - Create Tor hidden services instantly
  • Automatic Tor installation - Detects and installs Tor if missing
  • Custom port support - Expose any local port as an onion service
  • Secure by default - Uses Tor v3 onion services (latest standard)
  • Cross-distro support - Works on Debian, Ubuntu, Fedora, Arch, etc.
  • Clean output - Minimal, professional interface
  • Troubleshooting included - Helpful error messages and recovery steps

Installation

Method 1: Install from source (Recommended)

# Clone the repository
git clone https://github.com/bytebreach/torhost.git
cd torhost

# Install globally
sudo python3 setup.py install

# Or install in development mode
pip3 install -e .

Method 2: Install via pip

pip3 install torhost

Quick Start

  1. Start a local service (e.g., web server on port 8080):

    python3 -m http.server 8080 &
  2. Create a Tor hidden service:

    sudo torhost --port 8080
  3. Access your onion service:

    • Copy the onion address shown in the output
    • Open it in Tor Browser
    • Your local service is now accessible via Tor!

Usage

Basic Syntax

sudo torhost [OPTIONS]

Options

Option Description Default
--port PORT Local port to expose as onion service 8080
--help Show help message -

Running as a Module

If installed globally, use:

sudo torhost --port 3000

If not installed, use:

sudo python3 -m torhost.cli --port 3000

Examples

Example 1: Expose a web server

# Start a Python web server
python3 -m http.server 8000 &

# Create onion service for port 8000
sudo torhost --port 8000

Example 2: Expose a Node.js application

# Start Node.js app on port 3000
node app.js &

# Create onion service
sudo torhost --port 3000

Example 3: Expose SSH server

# Create onion service for SSH (port 22)
sudo torhost --port 22

Testing Your Onion Service

# Test with curl (requires tor running)
curl --socks5-hostname localhost:9050 http://your-onion-address.onion

# Or use torsocks
torsocks curl http://your-onion-address.onion

Troubleshooting

Common Issues

1. "Root privileges required"

# Always run with sudo
sudo torhost

2. "Tor not found" on non-Debian systems

# Install Tor manually for your distribution

# Arch Linux
sudo pacman -S tor

# Fedora/RHEL
sudo dnf install tor

# OpenSUSE
sudo zypper install tor

3. Onion address not generating

# Check Tor logs
sudo journalctl -u tor -n 50

# Check hidden service directory
sudo ls -la /var/lib/tor/hidden_service/

# Verify Tor is running
sudo systemctl status tor

# Restart Tor manually
sudo systemctl restart tor

4. "Connection refused" when accessing onion

  • Ensure your local service is running
  • Check firewall settings
  • Verify the port is correct
  • Test locally first: curl http://localhost:PORT

Log Files

  • Tor logs: /var/log/tor/log or journalctl -u tor
  • Hidden service directory: /var/lib/tor/hidden_service/
  • Configuration file: /etc/tor/torrc

Reporting Issues

Please report bugs and feature requests on the GitHub Issues page.

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

Acknowledgments

  • The Tor Project for making online privacy possible
  • Contributors and testers who help improve this tool
  • The open source community for inspiration and support

Made by ByteBreach

Use responsibly. Respect privacy.

About

One-command tool to create Tor v3 hidden services (onion services) easily and securely.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages