How to Install Apache Subversion on Ubuntu

“The Apache Subversion, abbreviated as SVN, is an open-source version control system released by Apache and is used by developers for tracking code changes across projects. Besides, SVN documents and organizes the project changes, and it can work across the network, especially since it supports different protocols, such as HTTPS, HTTP, and SVN.

Today’s guide covers how to install SVN on Ubuntu systems in a step-by-step manner.”

Understanding Apache Subversion

The SVN is a great tool for developers working on the same codebase as it helps track changes. Therefore, it works as a version control system and works well to version control different directories and files.

The SVN comprises two components. The first is the server which stores the repository for the subversion. At the same time, the other is the client, which is the application used in organizing updates contained in the subversion server.

Installing Apache Subversion

The Apache Subversion can be installed from the command line, but first, you must have Apache installed. The steps below will guide you throughout.

1. Install Apache2

You probably have Apache installed already. If not, update your system and then use the command below to install Apache. If not, update your system and then use the commands below to install Apache.

$ sudo apt update

$ sudo apt-get install apache2

To check the Apache status, use the following command.

$ sudo systemctl status apache2


If Apache is not running, you need to start it.

$ sudo systemctl start apache2

Apache is not enabled at boot up. However, if you wish to enable it every time you boot up your system, the command below does the magic.

$ sudo systemctl enable apache2

Also, you can confirm that Apache is up and running by typing your local host IP address on the browser. It should return the Apache welcome page, like in the image below.

2. Install Apache Subversion

Run the command below to install Apache Subversion and all its necessary dependencies.

$ sudo apt-get install subversion libapache2-mod-svn subversion-tools libsvn-dev

When prompted, like in the image below, choose the default selected option, Internet Site

Also, you will need to enter the system mail name.

Once installed, run the commands below to enable the Apache modules required to run SVN.

$ sudo a2enmod dav

$ sudo a2enmod dav_svn

Then, restart Apache2

$ sudo systemctl restart apache2

3. Apache Subversion Configuration

The configuration file for SVN needs to be edited to configure Apache with SVN.

$ sudo nano /etc/apache2/mods-enabled/dav_svn.conf

Open it with an editor of choice and uncomment the lines below.

DAV svn

SVNParentPath /var/www/svn

AuthType Basic

AuthName “Subversion Repository”

AuthUserFile /etc/apache2/dav_svn.passwd

Require valid-user

Once you’ve made the changes,  save and close the file.

The next thing is to create repositories. Start by creating a directory for the SVN. In this case, we will use the /opt directory.

$  sudo mkdir /opt/svn

Create a repository for it, and you can name it as you wish. In our case, we will name it “linuxhint.”

$  sudo svnadmin create /opt/svn/linuxhint

Also, you must change the file permissions and ownership for the SVN directory and repository using the commands below.

To change the ownership for the SVN repository:

$  sudo chown -R www-data:www-data /opt/svn/linuxhint

To change the permissions:

$ sudo chmod -R 775 /opt/svn/linuxhint

4. Create SVN Users

The first user we will create is the admin, and to create the user, we need a password file stored in the /etc directory.

$ sudo htpasswd -cm /etc/apache2/dav_svn.passwd linuxhint-admin

Replace the username appropriately.

If you need more users, for instance, to create a new user admin2, the command will be:

$ sudo htpasswd -m /etc/apache2/dav_svn.passwd admin2

The configuration is complete. Restart Apache, then proceed to test Apache Subversion.

$ sudo systemctl restart apache2

Open your browser and use the URL syntax below for testing.

$ http://your-ip>/svn/project-name

In our case, it will be:


Bingo! You’ve successfully installed and used Apache Subversion on Ubuntu.


This guide covered installing Apache Subversion, starting with installing Apache2 to the installation and configuration of SVN. Hopefully, your installation was successful, and you can extend the tutorial to configure and manage your projects. All the best!

About the author

Denis Kariuki

Denis is a Computer Scientist with a passion for Networking and Cyber Security. I love the terminal, and using Linux is a hobby. I am passionate about sharing tips and ideas about Linux and computing.