Subversion (SVN) on Debian 6 32-bit for Dummies Tutorial

This tutorial has been only tested on Debian 6 32-bit, it should work on other operating systems. The tutorial assumes you are familiar with entering basic linux commands. You will need root access!

This tutorial was adapted from:

I will install the SVN repository at this location on my website:

Update Aptitude

sudo apt-get update

Install subversion if you haven’t already:

sudo apt-get install subversion

Install apache (this is your web server) if you haven’t already:

sudo apt-get install apache2

Install svn libraries for apache:

sudo apt-get install subversion libapache2-svn

I will now create the repository at this location /var/www/svn
This location can be reached on your internet browser at

mkdir /var/www/svn

Use svnadmin to create the repo at /var/www/svn

svnadmin create /var/www/svn

Verify this location with the following command, you should see: * Verified revision 0
svnadmin verify /var/www/svn

Now the hierarchy of the repo is create (i.e. branches/tags/trunk)
We will first go to your tmp (temporary) folder and create the structure there under a directory called svn

cd /tmp
mkdir svn
cd svn
mkdir branches
mkdir tags
mkdir trunk

The svn folder containing branches/tags/trunk is now imported to your svn repo created earlier at /vaw/www/svn
The ‘first import’ part is the comment for this revision.

svn import /tmp/svn file:///var/www/svn -m "first import"

Now we will password protect this directory so your svn repo is not public to the world. Replace username and password correspondingly.

htpasswd -cb /var/www/svn/htpasswd username password

This steps adds the subdomain to point to
You will need to know how to use vim in this step or you could use a ssh browser and download and edit this file…

cd /etc/apache2/
vim httpd.conf

Your httpd.conf file should look like this (remember to change

<pre>LoadModule dav_svn_module modules/
LoadModule authz_svn_module modules/
&lt;VirtualHost *:80&gt;
DocumentRoot /var/www/
<pre>&lt;VirtualHost *:80&gt;
        DocumentRoot /var/www/svn
        &lt;Directory /var/www/svn&gt;
                AllowOverride All
                Options MultiViews -Indexes Includes FollowSymlinks
                &lt;IfModule mod_access.c&gt;
                        Order allow,deny
                        Allow from all

        # WebDAV access
        &lt;Location /&gt;
                DAV svn
                SVNPath /var/www/svn
                AuthType Basic
                AuthName "Your message for this realm"
                AuthUserFile /var/www/svn/htpasswd
                Require valid-user

                # authentication
                &lt;LimitExcept GET PROPFIND OPTIONS REPORT&gt;
                        Require valid-user
Now we will restart your apache server for settings to take effect:
/etc/init.d/apache2 restart

If you followed all these steps then hopefully your svn repo should be setup. Test this by visiting
You should see revision 1!

To add additional users to access your repo:

htpasswd /var/www/svn/htpasswd username

Join the conversation

1 Comment

Leave a comment

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.