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" >> /etc/torrc


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 so go ahead and configure your browser of choice to use a SOCKS proxy on 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


Senior Systems Engineer (bq_ @ irc.freenode)


markdown guide