Apache Subversion (SVN) on Ubuntu 26.04 LTS on Azure User Guide
Overview
Apache Subversion (SVN) is the centralised version control system from the Apache Software Foundation. It keeps one authoritative repository with a complete, ordered history of every change: teams check out a working copy, commit revisions, branch and tag, and roll back to any earlier state. Because history and access control live on the server, Subversion suits large binary assets, path-based permissions and organisations that want one governed source of truth.
The cloudimg image serves one repository over HTTPS through Apache httpd and mod_dav_svn at /svn/repo. A repository user, cloudimg, gets a password made uniquely on your VM's first boot, and the VM gets its own self-signed TLS certificate. Every request needs authentication: there is no anonymous read or write.
What is included:
-
Apache Subversion 1.14.5 (
svn,svnadmin,svnlook) andmod_dav_svnfrom Ubuntu 26.04's universe component, Apache httpd 2.4.66 from Ubuntu's main component, soaptkeeps them current -
One FSFS repository at
/srv/svn/repo, ready to commit. It holds one revision: first boot commits a smallREADME.txtto prove the repository works end to end -
The repository user
cloudimg, whose password is made on first boot and written to/root/svn-credentials.txt(root only); Apache keeps only a bcrypt hash of it -
A self-signed TLS certificate made on first boot for your VM's address, and
cloudimg-set-public-addressto issue a new one for another address or a DNS name -
Mandatory authentication on every path (
Require valid-user); an unauthenticated/healthzendpoint for load-balancer probes -
Ubuntu 26.04 LTS with unattended security upgrades left on
-
cloudimg's support team on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours
Subversion and mod_dav_svn are in Ubuntu's community-maintained universe component: their updates come from the Ubuntu community through the normal archive, and unattended upgrades apply them when they are published.
Prerequisites
-
An active Azure subscription and an SSH public key
-
A virtual network and subnet in your target region (the Portal creates them for you if needed)
-
Network Security Group rules allowing TCP 22 (SSH) from your own network and TCP 443 (HTTPS) from the clients that will use the repository. TCP 80 is optional: it serves a landing page and sends a plain-HTTP
/svnrequest on to HTTPS
Recommended virtual machine size: Standard_B2s (2 vCPU, 4 GB RAM) for a team repository. Use a larger size, and a larger OS disk, for many concurrent users or a large repository.
Step 1: Deploy from the Azure Portal
Sign in to the Azure Portal, choose Create a resource, search the Marketplace for Apache Subversion (SVN) on Ubuntu 26.04 LTS by cloudimg and select Create. On Basics pick your subscription, resource group, region and size; under Administrator account choose SSH public key and paste your key; under Inbound port rules allow SSH (22) and HTTPS (443). Then Review + create and Create.
Step 2: Deploy from the Azure CLI
Accept the Marketplace terms once per subscription, then create the VM and open HTTPS:
IMAGE_URN="cloudimg1647283583153:apache-subversion-ubuntu-26-04:default:latest"
az vm image terms accept --urn "$IMAGE_URN"
az vm create \
--resource-group <your-rg> \
--name svn \
--image "$IMAGE_URN" \
--size Standard_B2s \
--admin-username azureuser \
--ssh-key-values ~/.ssh/id_ed25519.pub \
--public-ip-sku Standard
az vm open-port --resource-group <your-rg> --name svn --port 443 --priority 1010
az vm create already allows SSH (TCP 22) in the VM's network security group; the last command opens TCP 443 for the repository.
Step 3: Connect to your VM
ssh azureuser@<vm-public-ip>
Step 4: Confirm Subversion is installed and serving
Apache serves the repository on :443 and a landing page on :80. Check the service, the versions, the listeners and the repository:
systemctl is-active apache2
svn --version --quiet
dpkg-query -W -f='${Package} ${Version}\n' subversion libapache2-mod-svn apache2
ss -tln | grep -E ':(80|443) '
sudo svnlook youngest /srv/svn/repo
sudo svnlook log -r 1 /srv/svn/repo
active
1.14.5
apache2 2.4.66-2ubuntu2.9
libapache2-mod-svn 1.14.5-6build1
subversion 1.14.5-6build1
LISTEN 0 511 *:443 *:*
LISTEN 0 511 *:80 *:*
3
cloudimg first-boot verification
On a new VM svnlook youngest prints 1: revision 1 is first boot's own check. The output above is from our build machine, where the image's checks and this guide's Step 7 had already added revisions 2 and 3. Your package versions may be newer: apt and unattended upgrades keep them current.

Step 5: Read your per-VM credentials
The repository user is cloudimg; its password was made on this VM's first boot and written to a file only root can read:
sudo cat /root/svn-credentials.txt
# Apache Subversion (SVN) - made on first boot by svn-firstboot.service
# These credentials are unique to this VM. Store them somewhere safe.
SVN_URL=https://<vm-public-ip>/svn/repo
SVN_USERNAME=cloudimg
SVN_PASSWORD=<SVN_PASSWORD>
#
# Check out the repository (accept the self-signed certificate on first use):
# svn checkout https://<vm-public-ip>/svn/repo --username cloudimg
# The repository requires authentication for ALL access: there is no anonymous
# read or write. For production, use a CA-signed certificate (see the guide):
# https://www.cloudimg.co.uk/guides/apache-subversion-svn-on-ubuntu-26-04-azure/
Nothing is baked into the image: until first boot ran, Apache's password file held a locked entry that matches no password, and every VM gets its own password and certificate.
Check the address in the credentials and the certificate
First boot asks Azure's instance metadata service for the VM's public IP and puts it in SVN_URL and in the certificate. Check which address it found:
sudo grep '^SVN_URL=' /root/svn-credentials.txt
cat /var/lib/cloudimg/public-address-source
SVN_URL=https://<vm-public-ip>/svn/repo
loadbalancer
imds or loadbalancer means the address is your public IP. If it says private, the VM had no public IP at first boot (or Azure did not report it), and SVN_URL shows the VM's private address, which works only inside the virtual network. Once the VM has a public IP, or when you have a DNS name for it, point the VM at it; this rewrites SVN_URL and issues a new certificate for that address:
sudo cloudimg-set-public-address # the public IP Azure reports now
sudo cloudimg-set-public-address svn.example.com # or a DNS name that points at the VM
public address: <old-address> -> svn.example.com
updated /root/svn-credentials.txt
certificate issued for svn.example.com (DNS:svn.example.com,IP:127.0.0.1,IP:<vm-private-ip>)
restarted apache2
Your password does not change.
Step 6: Confirm every request needs authentication
An anonymous request and a wrong password are both refused with 401; only this VM's password is accepted. The commands below read the password from the credentials file and pass it to curl on standard input, so it never appears on a command line:
SVN_PASS=$(sudo grep '^SVN_PASSWORD=' /root/svn-credentials.txt | cut -d= -f2-)
curl -ks -o /dev/null -w 'anonymous request : HTTP %{http_code}\n' https://127.0.0.1/svn/repo/
curl -ks -o /dev/null -w 'wrong password : HTTP %{http_code}\n' -u cloudimg:wrong-password https://127.0.0.1/svn/repo/
curl -ks -o /dev/null -w 'per-VM credentials : HTTP %{http_code}\n' -K - https://127.0.0.1/svn/repo/ <<<"user = \"cloudimg:$SVN_PASS\""
curl -s -o /dev/null -w 'plain HTTP /svn : HTTP %{http_code} -> %{redirect_url}\n' http://127.0.0.1/svn/repo/
anonymous request : HTTP 401
wrong password : HTTP 401
per-VM credentials : HTTP 200
plain HTTP /svn : HTTP 301 -> https://127.0.0.1/svn/repo/

Step 7: Check out the repository and commit a change
From an SSH session on the VM, check out the repository, add a file and commit it, all over HTTPS with your per-VM credentials. Because the first-boot certificate is self-signed and the URL here is 127.0.0.1, these commands accept it explicitly with --trust-server-cert-failures, and pass the password with --password-from-stdin:
SVN_PASS=$(sudo grep '^SVN_PASSWORD=' /root/svn-credentials.txt | cut -d= -f2-)
T="--non-interactive --trust-server-cert-failures=unknown-ca,cn-mismatch,expired,not-yet-valid,other --no-auth-cache"
WORK=$(mktemp -d)
svn checkout $T --username cloudimg --password-from-stdin https://127.0.0.1/svn/repo "$WORK/repo" <<<"$SVN_PASS"
NOTE="release-notes-$(date -u +%Y%m%d-%H%M%S).txt"
echo "First commit from cloudimg" > "$WORK/repo/$NOTE"
svn add $T "$WORK/repo/$NOTE"
svn commit $T --username cloudimg --password-from-stdin -m "Add $NOTE" "$WORK/repo" <<<"$SVN_PASS"
svn log $T --username cloudimg --password-from-stdin -l 2 https://127.0.0.1/svn/repo <<<"$SVN_PASS"
rm -rf "$WORK"
On a new VM the checkout is at revision 1 and your commit is revision 2. Output from our build machine, where the image's own check and an earlier run of this step had already committed revisions 2 and 3:
A /tmp/tmp.tVNLqbl4uU/repo/README.txt
A /tmp/tmp.tVNLqbl4uU/repo/release-notes-20261202-162129.txt
A /tmp/tmp.tVNLqbl4uU/repo/validate.txt
Checked out revision 3.
A /tmp/tmp.tVNLqbl4uU/repo/release-notes-20261202-162621.txt
Adding tmp/tmp.tVNLqbl4uU/repo/release-notes-20261202-162621.txt
Transmitting file data .done
Committing transaction...
Committed revision 4.
------------------------------------------------------------------------
r4 | cloudimg | 2026-12-02 16:26:21 +0000 (Wed, 02 Dec 2026) | 1 line
Add release-notes-20261202-162621.txt
------------------------------------------------------------------------
r3 | cloudimg | 2026-12-02 16:21:30 +0000 (Wed, 02 Dec 2026) | 1 line
Add release-notes-20261202-162129.txt
------------------------------------------------------------------------

From your workstation
On your own computer, check out with the SVN_URL from Step 5 and enter the password when asked:
svn checkout https://<vm-public-ip>/svn/repo --username cloudimg
The first time, the client shows the certificate and asks whether to accept it. Compare its fingerprint with the one on the VM (Step 8) before you accept it permanently. To trust the certificate without the prompt, copy /etc/ssl/cloudimg/cloudimg.crt from the VM to your workstation and name it in the [global] section of your Subversion servers file (~/.subversion/servers, or %APPDATA%\Subversion\servers on Windows):
[global]
ssl-authority-files = /path/to/cloudimg.crt
The svn client matches an IP address in the URL against the certificate's common name, so use the exact address in SVN_URL, or the DNS name you set with cloudimg-set-public-address.
Step 8: How the credentials are protected
There is no default password. The cloudimg password is made on first boot and stored as a bcrypt hash in Apache's password file; the plain text is only in the root-only credentials file. The certificate was made on this VM too:
sudo stat -c 'file: %n perms: %a owner: %U:%G' /root/svn-credentials.txt /etc/apache2/svn.htpasswd
sudo sed -E 's/(cloudimg:\$2[aby]\$[0-9]{2}\$.{6}).*/\1********************/' /etc/apache2/svn.htpasswd
sudo openssl x509 -in /etc/ssl/cloudimg/cloudimg.crt -noout -subject -enddate -ext subjectAltName
sudo openssl x509 -in /etc/ssl/cloudimg/cloudimg.crt -noout -fingerprint -sha1
file: /root/svn-credentials.txt perms: 600 owner: root:root
file: /etc/apache2/svn.htpasswd perms: 640 owner: root:www-data
cloudimg:$2y$05$rw9Q9j********************
subject=O=cloudimg, CN=<vm-public-ip>
notAfter=Nov 29 16:23:11 2036 GMT
X509v3 Subject Alternative Name:
IP Address:127.0.0.1, IP Address:<vm-private-ip>, IP Address:<vm-public-ip>
sha1 Fingerprint=<your VM's own fingerprint>

Step 9: Add repository users
Each repository user is an entry in Apache's password file. Add another user (you are asked for their password), and they can check out and commit like cloudimg:
sudo htpasswd -B /etc/apache2/svn.htpasswd alice
sudo systemctl reload apache2
For read-only users or per-path permissions, add an access file with AuthzSVNAccessFile (from mod_authz_svn, already enabled) to the <Location /svn/repo> block of /etc/apache2/sites-available/000-cloudimg-ssl.conf.
Step 10: Use a CA-signed certificate for production
The first-boot certificate is self-signed, so each client must accept or trust it. For production, point a DNS name at the VM, run sudo cloudimg-set-public-address <your-dns-name> so SVN_URL uses the name, and install a CA-signed certificate, for example with Certbot. Certbot proves the name over port 80, so open it first (on your workstation):
az vm open-port --resource-group <your-rg> --name svn --port 80 --priority 1020
Then on the VM:
sudo apt-get update && sudo apt-get install -y certbot python3-certbot-apache
sudo certbot --apache -d svn.example.com
Once Certbot has installed the certificate, svn checkout https://svn.example.com/svn/repo works with no certificate prompt.
Step 11: Back up the repository
Take a portable dump of the whole repository history at any time, check the repository, and copy the dump off the VM (for example to Azure Blob Storage):
sudo svnadmin dump -q /srv/svn/repo > /tmp/svn-repo-backup.dump
ls -lh /tmp/svn-repo-backup.dump
sudo svnadmin verify -q /srv/svn/repo && echo verify OK
-rw-r--r-- 1 root root 1.6K Dec 2 16:25 /tmp/svn-repo-backup.dump
verify OK
Restore into a new repository with svnadmin create and svnadmin load. The Subversion book covers repository administration and hook scripts.
Support and licensing
Apache Subversion and Apache HTTP Server are open source software under the Apache License 2.0. This image installs Ubuntu 26.04 LTS's unmodified subversion, libapache2-mod-svn and apache2 packages; cloudimg provides the packaging, the first-boot setup, the image maintenance and support. cloudimg's support team is on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours. Email support@cloudimg.co.uk or visit cloudimg.co.uk for documentation and assistance.
Apache Subversion and Apache HTTP Server are trademarks of The Apache Software Foundation. Ubuntu is a registered trademark of Canonical Ltd. cloudimg is not affiliated with, endorsed by or sponsored by either of them.