Sign inSign up

archhfan/tor-docker

By archhfan

•Updated 19 days ago

The easiest way to deploy Tor on Docker. Relay, proxy or exit node, you can use it your own way.

Image
0

1.3K

archhfan/tor-docker repository overview

⁠Tor For Docker

Docker Pulls Docker Stars

You can configure your tor container with environment variables. Just write a TOR_ prefix at your environment variables, and they will be translated into a torrc file at /etc/tor/torrc inside the container. For multiple settings with the same key, just prefix a number to the environment key like: TOR_0_Foo, TOR_1_Foo...

This container can work as a relay or a proxy, whatever you want to configure. Minimum requirements are to know how torrc file works (it's very easy, looking some examples below you will now hoy to use it)

Container works as proxy and relay by default. Override the configuration with environment variables and disable them.

⁠Docker Compose Example

A little example, using tor as relay and proxy at the same time.

services:
  tor:
    image: archhfan/tor-docker:latest
    environment:
      TOR_Nickname: MyRelayNick
      TOR_ContactInfo: [email protected]
    volumes:
      - tor-data:/var/lib/tor

volumes:
  tor-data:

⁠Default Configuration

Default values of the environment variables with their respective directive.

ENV Variabletorrc DirectiveValueEffect
TOR_SocksPortSocksPort0.0.0.0:9050Opens a SOCKS listener on all interfaces for client use.
TOR_RunAsDaemonRunAsDaemon0Keeps Tor in the foreground (necessary in Docker containers).
TOR_0_ORPortORPort9001Enables IPv4 relay-to-relay (“onion routing”) on TCP port 9001.
TOR_1_ORPortORPort[::]:9001Enables IPv6 relay-to-relay on TCP port 9001.
TOR_DirPortDirPort9030Serves directory information on TCP port 9030.
TOR_DataDirDataDirectory/var/lib/torPlaces Tor’s state, keys, and caches under /var/lib/tor.

Tag summary

Content type

Image

Digest

sha256:6c9d65420…

Size

10.8 MB

Last updated

19 days ago

docker pull archhfan/tor-docker