Tor Explained: How It Works, Use Cases, and Running Your Own Relay

9 min read
Intermediate Tor Privacy Anonymity Networking

Quick Answer: Tor routes your traffic through 3 random servers (relays), encrypting it at each step so no single relay knows both who you are and what you're accessing. Download Tor Browser to use it. To help others access Tor, run your own bridge or relay with torware.

What Is Tor?

Tor (The Onion Router) is a free, open-source network designed for anonymous communication. When you use Tor, your internet traffic bounces through three random servers (called relays) around the world before reaching its destination. Each relay only knows the relay before it and the relay after it — no single point in the chain knows both your identity and what you're accessing.

The name "onion routing" comes from the layers of encryption — like peeling an onion, each relay removes one layer and forwards the traffic to the next.

How Tor Works

Normal Internet Connection

You → ISP → Website
ISP knows: who you are + what you visit
Website knows: your IP address

Tor Connection

You → [Encrypted] → Guard Relay → Middle Relay → Exit Relay → Website

Guard Relay knows: your IP, but NOT what you're accessing
Middle Relay knows: nothing useful (just passes encrypted data)
Exit Relay knows: what you're accessing, but NOT who you are
Website knows: the exit relay's IP, NOT yours

The Three Relays

Relay What It Knows What It Doesn't Know
Guard (Entry) Your real IP address What website you're visiting
Middle The guard relay and the exit relay Your IP or the website
Exit The destination website Your real IP address

This separation is what makes Tor powerful — you'd need to control all three relays simultaneously to de-anonymize someone, which is extremely difficult when the network has thousands of relays run by volunteers worldwide.

Onion Encryption (Layered)

Before your traffic enters the Tor network, it's encrypted three times — once for each relay:

Your data
  → Encrypt with Exit Relay's key    (layer 3)
  → Encrypt with Middle Relay's key  (layer 2)
  → Encrypt with Guard Relay's key   (layer 1)
  → Send to Guard Relay

Guard Relay: removes layer 1, sees layer 2 → sends to Middle
Middle Relay: removes layer 2, sees layer 3 → sends to Exit
Exit Relay: removes layer 3, sees your data → sends to website

Each relay can only remove its own layer. The guard can't read the data because it's still encrypted with two more layers.

Who Uses Tor?

Tor is not just for hackers. The majority of Tor users are ordinary people who need privacy:

  • Journalists — protecting sources in authoritarian countries
  • Activists — organizing without government surveillance
  • People in censored countries — accessing blocked websites (Iran, China, Russia, etc.)
  • Privacy-conscious users — preventing ISP tracking and corporate surveillance
  • Whistleblowers — securely sharing information (SecureDrop, used by NYT, Washington Post)
  • Law enforcement — investigating without revealing identity
  • Researchers — studying censorship and surveillance
  • Domestic abuse survivors — communicating without being monitored

The Tor Project is a nonprofit funded by the US government (State Department, NSF), the Swedish government, and private donors. It's a legitimate privacy tool, not inherently illegal.

How to Use Tor

Tor Browser (Easiest)

Download from torproject.org. It's a modified Firefox that automatically routes all traffic through Tor.

  1. Download and install
  2. Open Tor Browser
  3. Click "Connect"
  4. Browse normally — your traffic is now anonymous

Important:

  • Don't log into personal accounts (defeats anonymity)
  • Don't open downloaded files while connected (can reveal your IP)
  • Don't use browser extensions (can fingerprint you)
  • Don't maximize the window (screen size is a fingerprint)

Tor on the Command Line

# Install
sudo apt install tor -y

# Start
sudo systemctl start tor

# Tor creates a SOCKS5 proxy at localhost:9050
curl --socks5 localhost:9050 https://check.torproject.org/api/ip

Tor on Mobile

Tor Bridges

If Tor is blocked in your country, direct connections to the Tor network are filtered. Bridges are unlisted relay nodes that censors don't know about.

Types of Bridges

Bridge Type How It Works Best For
obfs4 Scrambles traffic to look random Most censorship situations
Snowflake Uses WebRTC to look like video call traffic When obfs4 is blocked
meek Tunnels through cloud providers (Azure, Amazon) Heaviest censorship
webtunnel Looks like regular HTTPS web browsing New, effective against DPI

Using Bridges in Tor Browser

  1. Open Tor Browser
  2. Click the shield icon or go to Settings → Connection
  3. Select "Use a bridge"
  4. Choose built-in bridge type (obfs4 recommended)
  5. Or request a bridge from bridges.torproject.org

Getting Bridges When torproject.org Is Blocked

Tor Relays and Nodes

The Tor network is run by volunteers. There are three types of nodes you can run:

Bridge

A secret entry point. Not listed in the public Tor directory, so censors can't easily block it. People in censored countries connect through bridges when direct Tor access is blocked.

Risk level: Very low. Your IP is not publicly listed. Only the Tor Project's bridge distribution system knows about it.

Middle Relay

Passes encrypted traffic between other relays. The backbone of the Tor network.

Risk level: Low. You only see encrypted traffic passing through. Your IP is publicly listed as a Tor relay but you never see the actual content.

Exit Relay

The final hop — where traffic leaves the Tor network and reaches the destination website. The exit relay's IP is what websites see.

Risk level: Higher. Your IP appears to be the source of all traffic that exits through your relay. This includes legitimate traffic but can also include abuse. Run exit relays only on dedicated infrastructure, not from home.

.onion Sites (Hidden Services)

Sites ending in .onion are only accessible through Tor. They provide:

  • Server anonymity — the website operator's identity and location are hidden
  • End-to-end encryption — traffic never leaves the Tor network
  • Censorship resistance — can't be taken down by blocking an IP

How .onion Works

Normal website: You → Tor → Exit Relay → Website server
.onion website: You → Tor → Rendezvous Point ← Tor ← Website server

Neither side knows the other's IP. They meet at a random point in the Tor network.

Legitimate .onion Sites

Site .onion Address
Facebook facebookwkhpilnemxj7asaniu7vnjjbiltxjqhye3mhbshg7kx5tfyd.onion
DuckDuckGo duckduckgogg42xjoc72x3sjasowoarfbgcmvfimaftt6twagswzczad.onion
ProtonMail protonmailrmez3lotccipshtkleegetolb73fuirgj7r4o4vfu7ozyd.onion
The New York Times nytimesn7cgmftshazwhfgzm37qxb44r64ytbb2dj3x62d2lljsciiyd.onion
BBC bbcnewsd73hkzno2ini43t4gblxvycyac5aw4gnv7t2rccijh7745uqd.onion
CIA ciadotgov4sjwlzihbbgxnqg3xiyrg7so2r2o3lt5wz5ypk4sxyjstad.onion

Major organizations run .onion versions of their sites to provide censorship-resistant access.

Tor vs VPN

Tor VPN
Anonymity Strong (3 hops, no single trust point) Weak (VPN provider sees everything)
Speed Slow (3 hops, volunteer relays) Fast (direct connection)
Trust No single entity to trust Must trust the VPN provider
Cost Free $3-12/month
Blocks by destination Many sites block Tor exit IPs Most sites work
All traffic Only Tor Browser (by default) System-wide
Best for Anonymity, censorship bypass, .onion access Privacy from ISP, geo-unblocking, speed

Use Tor when: You need real anonymity — journalism, activism, accessing .onion sites.

Use a VPN when: You need privacy from your ISP, speed, or geo-unblocking. See our What Is a VPN guide.

Use both (Tor over VPN): Connect to VPN first, then open Tor Browser. Your ISP only sees VPN traffic, not Tor. The VPN provider sees Tor traffic but not what you're doing inside Tor.

Limitations of Tor

Tor is powerful but not perfect:

  • Exit relay can see unencrypted traffic — always use HTTPS. Tor encrypts within the network, but traffic between the exit relay and the destination is only protected by the destination's own encryption (HTTPS)
  • Slow — 3 hops through volunteer relays means higher latency
  • Browser fingerprinting — JavaScript, screen size, fonts, and other browser features can identify you even through Tor
  • Correlation attacks — an adversary watching both your entry and exit traffic can potentially correlate timing patterns
  • Not for torrenting — BitTorrent leaks your real IP and overloads the network
  • Exit relay blocking — many websites block known Tor exit IPs

Run Your Own Tor Bridge or Relay

Help people in censored countries access the internet by running a Tor bridge or relay on your server.

Easy Setup with torware

torware is a one-click Tor Bridge/Relay setup tool with a live TUI dashboard and Telegram notifications:

curl -fsSL https://raw.githubusercontent.com/SamNet-dev/torware/main/install.sh | sudo bash

What torware Gives You

  • Interactive TUI — choose bridge or relay, configure settings visually
  • Live Dashboard — real-time traffic stats, connected clients, bandwidth usage
  • Snowflake Proxy — run a Snowflake proxy alongside your bridge (helps even more users)
  • Telegram Notifications — get alerts when your relay goes up/down, traffic spikes
  • Auto-updates — keeps Tor and bridge software up to date
  • One-command install — handles all dependencies, firewall rules, and Tor configuration

What to Run

Type Who It Helps Server Requirements Risk
Bridge (obfs4) Users in censored countries 512MB RAM, any VPS Very low
Snowflake proxy Users behind heavy DPI Almost nothing (runs alongside other services) None
Middle relay Everyone on Tor (more bandwidth) 1GB+ RAM, high bandwidth VPS Low
Exit relay Everyone on Tor Dedicated server, abuse-tolerant hosting Higher

Recommended: Run a bridge with Snowflake. Maximum impact, minimal risk, works on any $3-5/month VPS.

Manual Bridge Setup (Without torware)

# Install Tor
sudo apt install tor obfs4proxy -y

# Edit /etc/tor/torrc
sudo nano /etc/tor/torrc

Add:

BridgeRelay 1
ORPort 9001
ServerTransportPlugin obfs4 exec /usr/bin/obfs4proxy
ServerTransportListenAddr obfs4 0.0.0.0:9002
ExtORPort auto
ContactInfo [email protected]
Nickname MyBridge
sudo systemctl restart tor

# Get your bridge line (share with users who need it)
sudo cat /var/lib/tor/pt_state/obfs4_bridgeline.txt

Monitoring Your Relay

# Check status
sudo systemctl status tor

# View logs
sudo journalctl -u tor -f

# Check relay info (after a few hours)
# Search for your relay at https://metrics.torproject.org/rs.html

Or use torware's TUI dashboard which shows all of this in a clean interface.

Test Your Connection

After connecting through Tor:

See Also

SamNet Open Source Tools

Tool Purpose
torware One-click Tor Bridge/Relay with TUI dashboard and Telegram alerts
paqctl Censorship bypass using Paqet (KCP) and GFW-Knocker
MTProxyMax Telegram MTProto proxy with FakeTLS
wg-orchestrator WireGuard VPN management with TUI and web UI