loading...

Running tor using docker

boris profile image Boris Quiroz ・1 min read

If you want to connect to tor network without using tor browser, docker is the solution!

Just copy this code into a Dockerfile:

FROM alpine:edge

RUN apk update
RUN apk add tor

RUN echo "Log notice stdout" >> /etc/torrc
RUN echo "SocksPort 0.0.0.0:9150" >> /etc/torrc

EXPOSE 9150

CMD tor -f /etc/torrc

Build it with docker build -t tor -f Dockerfile . and run it with:

docker run -d --rm --name tor -p 9150:9150 tor

But, if you don't want to do the build just run:

docker run -d --rm --name tor -p 9150:9150 boris/tor:alpine

After that, you'll have a tor proxy running in your 127.0.0.1:9150 so go ahead and configure your browser of choice to use a SOCKS proxy on 127.0.0.1:9150 and you'll go from this:

To this:

Enjoy your privacy :)

PS: Code for my Dockerfile is here and the image in Docker hub is here

Posted on by:

boris profile

Boris Quiroz

@boris

Senior Systems Engineer (bq_ @ irc.freenode)

Discussion

markdown guide