Setting up a subversion repository
Introduction
Subversion (short SVN) was initiated in 2000 by CollabNet to supersede the antiquated CVS. In this short article I'm not going to show you how subversion is or should be used. What I am going to show is the basic setup that I'm using most time for private development or in small teams.Installation
The shortest approach would just be to install the subversion package of your distribution. For debian this is:apt-get install subversion
or:
aptitude install subversion
On Fedora this looks like this:
yum install subversion
Alternatively you can fetch the source code from subversion.tigris.org and run
./configure
make && make install
Creating a repository
Now that subversion is installed we can start and create our first repository. For this you might want to create a subversion user and group on your system.$ su -
Password:
# adduser svn
Adding user `svn' ...
Adding new group `svn' (1002) ...
Adding new user `svn' (1002) with group `svn' ...
Creating home directory `/home/svn' ...
Copying files from `/etc/skel' ...
Enter new UNIX password:
Retype new UNIX password:
Switch to the user you've created:
# su svn
$ cd ~
Now we're going to create the repository by executing the following command:
$ svnadmin create reponame
Where reponame is of course the name of your repository. This command creates a directory with with the reponame you've given. This directory represents an empty repository.
Configuration
Before we can make the repository available for the public we have to configure it. Go into the conf directory of your newly created repository and open the file "svnserve.conf". Change the settings according to your needs. For me this looks like the following:[general]
anon-access = none
auth-access = write
password-db = passwd
realm = Some cool project
With this setting only authorized users are allowed to write whereas anonymous users cannot even get access to the repository. The users have to be added to the passwd file inside the conf directory as simple key-value pairs:
[users]
skel = secret
Starting to serve
We're ready to serve our repository. I am going to use the basic and unencrypted method here. Start the subversion server by executing:svnserve -d -r /home/svn/
This starts the subversion server in daemon mode. The parameter "-r" tells svnserve to use "/home/svn" (the home directory of the use created) as the root directory for all repositories. This allows you to serve multiple repositories simultaneously.
Checkout
If the svn server is up and running we can begin to use the repository. Let's check out a working copy of our repository:svn checkout svn://domainname.tld/reponame
Checked out revision 0.
Have fun!
Recommended books on this topic
![]() |
Version Control with Subversion by C. Michael Pilato |
![]() |
Practical Subversion, Second Edition (Expert's Voice in Open Source) by Daniel Berlin |
Comments (0) |

