Skip to main content
Katapult

How to Set Up an Apache Subversion Server on an Ubuntu 24.04 VM

19 Aug 2025 · 5 min read · Devops & Infrastructure

Introduction

This guide walks through installing Apache Subversion (SVN) on an Ubuntu 24.04 VM, serving it over HTTP with Apache, and protecting access with basic auth. You'll:

  1. Install Apache and the Subversion modules.
  2. Create one repository at /srv/svn/project.
  3. Add a user with htpasswd.
  4. Install an SVN client locally to confirm everything works.

At the end of this guide, you will have a working Subversion server ready for team use.

Prerequisite

  • Katapult VM with Ubuntu 24.04 — sign-up comes with £100 free credit
  • A non-root user with sudo access.

Provision a Virtual Machine with Katapult Compute

  • Open the Katapult dashboard, in the sidebar choose Compute ▸ Virtual machines, then click Launch virtual machine.

Katapult Dashboard

  • Select the data centre closest to your users or team.
  • For this walkthrough the ROCK-3 plan (1 vCPU, 3 GB RAM, 25 GB NVMe) is enough. You can scale up later without rebuilding.

New Katapult users start with £100 free credit, so spinning up the 1 vCPU / 3 GB RAM VM needed for this guide (just £15 per month) costs you nothing while you test the stack.

  • Under Distributions pick Ubuntu 24.04. Although, this guide can be replicated in any Linux distro.
  • Keep the public IPv4 & IPV6 addresses that Katapult assigns.
  • Click Launch virtual machine. Provisioning takes less than a minute.
  • Once the VM is ready, you can SSH in like this:
ssh root@<VM_IP>
  • Once the VM is ready, copy the root password shown in the VM details page and log in as root.
ssh root@<VM_IP>
  • After logging in as root, create a new user with sudo privileges. Replace with your desired username:
# Create a new user

adduser <username>

# Add the user to the sudo group

usermod -aG sudo <username>

# Verify by switching to the new user and running a sudo command


su - <username>
whoami
  • Copy the IPv4 address shown in the VM details page—you'll enter it in the Laravel Forge dashboard.

That's it! your fresh Ubuntu 24.04 VM is ready.

Update the VM, Install Apache & Subversion

Before you point a client at the VM, give the operating system a quick refresh and pull in the packages that turn Apache into an SVN host:

sudo apt update && sudo apt upgrade -y
sudo apt install -y apache2 libapache2-mod-svn subversion

Configure Users, Permissions and Create a Repository

Next, we need to create a dedicated user and a first repository for SVN. Keeping the repository tree under its own system account (svn) avoids permission headaches later:

# 1. Create a system group and user just for Subversion
sudo addgroup --system svn
sudo adduser  --system --ingroup svn --home /srv/svn --shell /usr/sbin/nologin svn

# 2. Create the parent directory (if it doesn't exist)
sudo mkdir -p /srv/svn

# 3. Create a repository called "project"
sudo svnadmin create /srv/svn/project

# 4. Hand ownership to the svn user and group
sudo chown -R svn:svn /srv/svn

# 5. Give the group full access
sudo chmod -R 770 /srv/svn

# 6. Let Apache (www-data) join that group
sudo usermod -aG svn www-data
sudo systemctl restart apache2   # applies the new group membership

Tell Apache to Serve the Repository

Drop a short config file that maps /svn to the directory you just created, enables the DAV handler, and wires in basic authentication:

sudo tee /etc/apache2/conf-available/svn.conf >/dev/null <<'EOF'
<Location /svn>
    DAV svn
    SVNParentPath /srv/svn
    AuthType Basic
    AuthName "SVN Repository"
    AuthUserFile /etc/svn-auth-file
    Require valid-user
</Location>
EOF

# enable the config and the DAV module, then reload Apache
sudo a2enconf svn
sudo a2enmod dav_svn
sudo systemctl reload apache2

Add Your First SVN User and Make a Commit

Run the following command that creates a user named "admin", create a new password for the user and stores the password in /etc/svn-auth-file.

sudo htpasswd -c /etc/svn-auth-file admin

You can also add more users later by re-running the command without -c.

Need stronger security?

You can skip HTTP Basic auth and expose the repo only through SSH tunnels or system user accounts. That approach avoids clear-text passwords and works well inside private networks.

Verify the Repository in a Browser

Before we make a commit, lets verify that our repository exists. Open your browser and visit:

http://<VM_IP>/svn/project/

Your browser should prompt for the admin credentials you just created.

On sucessfully passing the basic auth, a Subversion index page should appears, showing:

SVN - Index

Seeing this page confirms that Apache, dav_svn, and basic authentication are all wired up correctly.

Make a Commit

With the browser check complete, you can run a quick commit cycle from any SVN client:

svn checkout http://<VM_IP>/svn/project --username admin
cd project
echo "first file" > README.txt
svn add README.txt
svn commit -m "Initial commit"

On making the commit, Subversion should reply with:

Adding         README.txt
Transmitting file data .done
Committing transaction...
Committed revision 1.

Now, if you head back to http://<VM_IP>/svn/project/ you should see the file committed to SVN:

SVN - Commit

That's it! your Apache-hosted Subversion server is now reachable both in a browser and from any SVN client.

Migrating an existing Subversion repository

Whether your current SVN server lives on-prem, on another host, or in an old cloud account, the migration process is the same: dump the repository, copy the dump to your new VM, and load it.

Create a dump on the old server

SSH to the source machine (or use its control panel) and run:

svnadmin dump /path/to/old/repo > project.dump

This produces a plain-text file that contains every revision, branch, and tag.

Transfer the dump to the new VM

Next, use scp to transfer the dump to the VM:

scp project.dump <your-user>@<VM_IP>:/tmp/

Load the dump into a fresh repo

# create a repository called "project" or anything you wish 
sudo svnadmin create /srv/svn/project
sudo chown -R svn:svn /srv/svn/project

# load the history
sudo svnadmin load /srv/svn/project < /tmp/project.dump

# tidy up
rm /tmp/project.dump

Check permissions and restart Apache (if needed)

sudo chown -R svn:svn /srv/svn/project
sudo chmod -R 770      /srv/svn/project
sudo systemctl restart apache2

Point working copies at the new URL

Developers can keep their existing check-outs and simply relocate:

svn relocate \
  https://old.server.example.com/repo/project \
  http://<VM_IP>/svn/project

Multiple repositories?

Repeat the above steps for each dump file; Apache serves every repo under /svn/ automatically.

Next steps

  • Enable HTTPS – Add a domain in DNS and an SSL certificate.
  • Tighten authentication – Swap basic auth for SSH tunnels or system accounts for stronger security.
  • Backups – Schedule a daily svnadmin hotcopy /srv/svn /backups/svn-$(date +%F) and push copies off-site.
  • Hook scripts – Add post-commit hooks for CI triggers or email notifications.
  • Monitor resources – Track CPU, RAM, and disk usage; scale the Katapult VM up when needed.

Conclusion

In this guide you learned how to:

  • Provision an Ubuntu 24.04 VM on Katapult.
  • Install Apache with the Subversion modules.
  • Create a repository and secured it with basic HTTP authentication.
  • *Verify access in a browser and from a command-line client.
  • Import an existing repository using svnadmin dump and svnadmin load.\n

Running SVN on your own Katapult VM gives you full control over storage, access rules, and upgrade cadence while keeping costs low and performance high. You can expand to additional repositories, enable HTTPS, and integrate hooks or CI pipelines whenever you're ready—without waiting for a third-party platform.

About the author

Shedrack A

Technical Copywriter

Start building today with £100 free credit

Sign up and you’ll be up and running on Katapult in less than a minute.