A torrc cheat sheet is a single-page reference of the configuration directives the Tor daemon accepts, grouped by what you are trying to do: open a SOCKS proxy for applications, lock down the control port, build longer or shorter circuits, pin entry or exit countries, run a hidden service, route through bridges, tune logging, or squeeze out more performance. This covers Tor 0.4.x through the current stable in 2026, with the "as of which version" notes added where a directive changed behavior recently.
Cheat sheet
torrc Cheat Sheet
Reference for every common torrc directive in Tor 0.4.x, grouped by use case. Includes SOCKS and control ports, country pinning, hidden services, bridges, performance tuning, and logging.
Where torrc lives
The Tor daemon reads its config from a single text file. Locations vary by how you installed it.
| Install | Path |
|---|---|
| Linux (Debian/Ubuntu, Fedora, Arch packages) | /etc/tor/torrc |
| Linux (compiled from source) | /usr/local/etc/tor/torrc |
| macOS (Homebrew) | /opt/homebrew/etc/tor/torrc (Apple Silicon) or /usr/local/etc/tor/torrc (Intel) |
| Tor Browser | Browser/TorBrowser/Data/Tor/torrc inside the bundle |
| Tails / Whonix | /etc/tor/torrc (managed by the distro; user changes get overwritten on shutdown) |
After editing, reload (don't restart unless you need to):
# systemd-managed
sudo systemctl reload tor
# everything else (sends SIGHUP)
sudo pkill -HUP torA SIGHUP tells the daemon to re-read torrc without dropping current circuits.
Complete example: client-only torrc
A reasonable starting torrc for using Tor as a SOCKS proxy from a laptop:
# Listen for SOCKS5 from local apps
SocksPort 9050 IsolateDestAddr IsolateDestPort
# Local DNS resolver so I can iptables-route DNS through Tor
DNSPort 5353
AutomapHostsOnResolve 1
# Control port for nyx and per-script NEWNYM
ControlPort 9051
CookieAuthentication 1
CookieAuthFileGroupReadable 1
# Reasonable circuit settings
MaxCircuitDirtiness 600
NumEntryGuards 3
# Quiet-ish logging
Log notice file /var/log/tor/notices.log
DataDirectory /var/lib/tor
# Never be an exit
ExitPolicy reject *:*Complete example: hidden service operator
# Keep client-side knobs
SocksPort 9050
ControlPort 9051
CookieAuthentication 1
# The hidden service itself
HiddenServiceDir /var/lib/tor/myservice/
HiddenServicePort 80 127.0.0.1:8080
HiddenServicePort 443 127.0.0.1:8443
# Resilience tuning
HiddenServiceNumIntroductionPoints 6
HiddenServiceMaxStreams 50
HiddenServiceMaxStreamsCloseCircuit 1
Log notice file /var/log/tor/notices.logThe directory at HiddenServiceDir is created automatically on first start. Tor writes the public hostname to hostname and the private key to hs_ed25519_secret_key inside it. Back up the secret key — losing it means losing the .onion address forever.
Complete example: bridge user behind ISP block
UseBridges 1
ClientTransportPlugin obfs4 exec /usr/bin/obfs4proxy
# Replace with bridge lines from https://bridges.torproject.org/options
Bridge obfs4 192.0.2.1:443 0123456789ABCDEF0123456789ABCDEF01234567 cert=AAAA... iat-mode=0
Bridge obfs4 192.0.2.2:443 9876543210FEDCBA9876543210FEDCBA98765432 cert=BBBB... iat-mode=0
SocksPort 9050
Log notice file /var/log/tor/notices.logThree bridges is the sweet spot — enough redundancy that one going down doesn't cut you off, not so many that you're hammering volunteer-run infrastructure.
FAQ
The path depends on how Tor was installed. On Debian/Ubuntu and most Linux distros it's /etc/tor/torrc. On macOS Homebrew it's /opt/homebrew/etc/tor/torrc on Apple Silicon and /usr/local/etc/tor/torrc on Intel. Tor Browser keeps its own at Browser/TorBrowser/Data/Tor/torrc inside the bundle.
You can also pass tor -f /path/to/torrc to run with an arbitrary config file, which is how multi-instance setups work.
No. Send SIGHUP and Tor re-reads the file in place: sudo systemctl reload tor on systemd, or sudo pkill -HUP tor elsewhere. Existing circuits keep working; new circuits use the new settings.
A few directives (port changes, DataDirectory moves) need a full restart because they affect bound sockets or on-disk layout.
None functionally. 9050 is the default for the standalone Tor daemon you install from your package manager; 9150 is what Tor Browser ships with so it doesn't collide with a system-wide tor on 9050. If both are running, point your scripts at one or the other consciously.
Two clean options. With CookieAuthentication 1, Tor writes a binary cookie file at $DataDirectory/control_auth_cookie on startup; your script reads it and sends AUTHENTICATE <hex-cookie>. With HashedControlPassword, you set the hash in torrc and your script sends AUTHENTICATE "yourpassword".
Cookie auth is preferred locally because filesystem permissions handle access control. Use a password when the controller runs on a different host.
Yes. Each instance needs its own SocksPort, ControlPort, and DataDirectory. Start each with tor -f /etc/tor/torrc-foo and they coexist happily. This is the standard pattern for switching exit countries per command — one daemon per country, each on a different SOCKS port.
Don't, unless you have to. The control port can rotate circuits, read your guard list, and dump the descriptor cache. If you must, set HashedControlPassword, bind ControlPort to 127.0.0.1 only (the default), and SSH-tunnel from your client: ssh -L 9051:127.0.0.1:9051 user@host. Never bind ControlPort 0.0.0.0:9051.
The canonical reference is man tor on a host that has Tor installed — every directive has its earliest-version note. The web copy at torproject.org's manual page is the same content. If a directive isn't in your installed man page, your Tor is older than the directive.
See also
- Set Tor exit nodes by country (ExitNodes, ExcludeNodes): the country-pinning directives explained with worked torrc snippets, plus Five/Nine/14 Eyes blocks
- Tor Bridges Explained: obfs4, Snowflake, and meek: bridge directives and how to add them to torrc
- Host a v3 .onion Hidden Service with Tor: the hidden-service directives applied to a real onion site
- Use Tor as a SOCKS5 Proxy with curl, Python, and Node: SocksPort directives put to practical use
- Force a New Tor Circuit on Demand with NEWNYM: the ControlPort and CookieAuthentication directives in action
Sources
Authoritative references this article was fact-checked against.
- Tor Project issue tracker #17688gitlab.torproject.org
- HiddenServiceSingleHopMode discussion — Tor Forumforum.torproject.org
- v2 onion service deprecation timeline — Tor blogblog.torproject.org





