Just like we have websites ending in .onion , can we have a git server running on Tor ? Theoretically it should be possible as git could be thought of as an FTP server. Has somebody done it and shared notes as to how to about doing that ? I tried various web searches with sadly nothing to show for it.

Looking forward for help.

  • Yes, you can setup a Hidden Service and stick Git behind it. This works exactly the same way as setting up any other hidden service with any thing else (eg. a webserver) behind it. Do you have some specific aspect of setting it up you need help with that's not covered by other questions on this site? A bit of clarification as to what problems you're running into, what you've already tried, etc. will help you get a better answer, quicker. Thanks for using Tor.se!
    – user5
    Dec 26, 2014 at 15:36
  • Setting up a git repo behind a hidden service will probably be the easy part. For getting your git client to connect through Tor, this may be helpful: stackoverflow.com/questions/15227130/…
    – Jobiwan
    Dec 26, 2014 at 17:31
  • 1
    There already is it seems: motherboard.vice.com/en_us/article/… May 13, 2017 at 19:49

2 Answers 2


From the Tor manual site:

Add the following lines to your torrc:

HiddenServiceDir /Library/Tor/var/lib/tor/hidden_service/
HiddenServicePort 80

You're going to want to change the HiddenServiceDir line, so it points to an actual directory that is readable/writeable by the user that will be running Tor. The above line should work if you're using the OS X Tor package. On Unix, try "/home/username/hidden_service/" and fill in your own username in place of "username". On Windows you might pick:

HiddenServiceDir C:\Users\username\Documents\tor\hidden_service
HiddenServicePort 80

Now save the torrc and restart your tor.

Accessing the hidden services is explained here

In short it says README once, than README twice:

FreeCap is an alternative. When using FreeCap set proxy protocol to SOCKS 5 and under settings set DNS name resolving to remote. This will allow you to use almost any program with Tor without leaking DNS lookups and allow those same programs to access hidden services.

Set that up correctly, you should be able to enter into a browser the tor hostname of your git server found here:

The other file Tor will create is called "hostname". This contains a short summary of your public key -- it will look something like duskgytldkxiuqc6.onion. This is the public name for your service, and you can tell it to people, publish it on websites, put it on business cards, etc.


I have set up gits in the past, and have used Tor to protect them. It works just as setting up any other service. Simply set up your server (ensure that there is not something that could expose your true IP address in it), and then forward the port to Tor.

The only problem I have had in the past with this is the fact that it isn't easy to connect to Tor from the client end. Fortunately, using a socks5 interface, we can connect.

  • Thank you for sharing that, just confirmed me that I'm not a complete idiot and the idea has merit. I actually had read that the part about forwarding the port to tor. I'll be looking out for some more answers for a week otherwise will vote you up and use the answer link therein.
    – shirish
    Dec 26, 2014 at 21:27
  • @aurora: Thanks for the answer; generally, links with little context are discouraged. Could you summarize the key points in the links you used here? This helps if those pages ever change in the future, and ensures this answer remains valid. Thanks!
    – user5
    Dec 26, 2014 at 23:15

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .