How to use svn behind proxy

If your Linux host is behind a corporate proxy, and you are trying to access a svn repository located outside the corporate network, you will need to configure proxy settings in svn, so that svn traffic can traverse the proxy properly.

While most Linux applications that require network access respect http_proxy environment variable, subversion ignores http_proxy variable. Thus, in order to use svn behind proxy, you instead need to rely on svn-specific configuration file.

In subversion, you can find svn configuration files in the following two different locations: /etc/subversion, and ~/.subversion. The former stores "system-wide" svn configurations, while the latter contains "user-specific" svn configurations that override system-wide default settings.

In order to allow you to use svn behind proxy, edit ~/.subversion/servers as follows.

$ vi ~/.subversion/servers
http-proxy-host =
http-proxy-port = 8000
http-proxy-username = user
http-proxy-password = pass
http-proxy-exceptions = *

If you would like to configure a http proxy for svn system-widely, edit /etc/subversion/servers similarly.

One thing to clarify is that depending on the filtering rules of your proxy, you may not be able to use all available transport protocols for svn (e.g., http://, https://, svn://). If the svn repository to access only supports svn protocol (i.e., svn://), and your proxy blocks the port number (e.g., 3690) used by svn protocol, you cannot access the repository even with the above proxy settings, unless you create a separate tunnel through the proxy.

Subscribe to Xmodulo

Do you want to receive Linux FAQs, detailed tutorials and tips published at Xmodulo? Enter your email address below, and we will deliver our Linux posts straight to your email box, for free. Delivery powered by Google Feedburner.

Support Xmodulo

Did you find this tutorial helpful? Then please be generous and support Xmodulo!

The following two tabs change content below.
Dan Nanni is the founder and also a regular contributor of He is a Linux/FOSS enthusiast who loves to get his hands dirty with his Linux box. He likes to procrastinate when he is supposed to be busy and productive. When he is otherwise free, he likes to watch movies and shop for the coolest gadgets.

Leave a comment

Your email address will not be published. Required fields are marked *