Installing Subversion (SVN) on Linux is easiest when you treat it as three tasks: install binaries, create a repository, and publish it over HTTP with authentication. This guide is for engineers who want a reliable server setup and a quick way to verify that users can import and check out code.
Originally published on 2010-06-27; fully revised and updated.

Choose an installation approach first
The original post built SVN from source (version 1.6.9). That still teaches the mechanics, but most teams should start with distro packages for maintainability and security updates.
| Approach | Best for | Pros | Trade-offs |
|---|---|---|---|
| Package manager (apt/dnf/yum/zypper) | Most production servers | Fast install, easier updates, integrated service files | Version tied to distro repos |
| Build from source tarballs | Legacy compatibility or custom builds | Full control over compile options and version | More dependencies, harder patching/upgrades |
SVN server setup workflow
flowchart TD
A[Select install method] --> B[Install Subversion binaries]
B --> C[Create repository with svnadmin]
C --> D[Configure Apache mod_dav_svn]
D --> E[Create auth and access files]
E --> F[Restart Apache]
F --> G[Import initial project]
G --> H[Checkout from client]
Install Subversion binaries
Option A: Install from distro packages (recommended)
# Debian/Ubuntu
sudo apt update
sudo apt install -y subversion apache2 libapache2-mod-svn apache2-utils
sudo a2enmod dav dav_svn authz_svn
sudo systemctl restart apache2
# RHEL/CentOS/Rocky/Alma
sudo dnf install -y subversion httpd mod_dav_svn
sudo systemctl enable --now httpdCode language: PHP (php)
Option B: Build from source (legacy style from the original article)
The original instructions used Subversion 1.6.9 tarballs and dependency tarballs. Use this only when you specifically need source compilation.
mkdir -p /usr/local/softwares/svn
cd /usr/local/softwares/svn
# Historical URLs from the original post
wget http://subversion.tigris.org/downloads/subversion-1.6.9.tar.gz
wget http://subversion.tigris.org/downloads/subversion_deps-1.6.9.tar.gz
tar -xvzf subversion-1.6.9.tar.gz
tar -xvzf subversion_deps-1.6.9.tar.gz
cd subversion-1.6.9
./autogen.sh
./configure --with-berkeley-db=/usr/local/softwares/svn/db-4.6.21
make
sudo make installCode language: PHP (php)
Create a repository and import initial content
sudo mkdir -p /srv/svn
sudo svnadmin create /srv/svn/repos
# Set ownership to your web server user:
# Debian/Ubuntu usually uses www-data
# RHEL-family usually uses apache
WEB_USER=www-data
sudo chown -R "$WEB_USER":"$WEB_USER" /srv/svn/repos
# Initial import from a local project folder
svn import -m "Initial import" /path/to/project file:///srv/svn/reposCode language: PHP (php)
Publish the repository through Apache with authentication
To serve SVN over HTTP(S), configure mod_dav_svn, then add user authentication and path authorization.
# Example: /etc/httpd/conf.d/subversion.conf (RHEL)
# or /etc/apache2/mods-available/dav_svn.conf (Debian)
<Location /svn/repos>
DAV svn
SVNPath /srv/svn/repos
AuthType Basic
AuthName "Subversion repository"
AuthUserFile /etc/svn-auth-file
AuthzSVNAccessFile /etc/svn-access-file
Require valid-user
</Location>Code language: PHP (php)
# Create first SVN user
sudo htpasswd -cm /etc/svn-auth-file test
# Authorization rules (read/write to all authenticated users)
printf "[/]\\n* = rw\\n" | sudo tee /etc/svn-access-file > /dev/null
# Restart Apache
sudo systemctl restart apache2 # Debian/Ubuntu
sudo systemctl restart httpd # RHEL familyCode language: PHP (php)
Verify access from CLI and clients
# List repository contents over HTTP
svn list http://localhost/svn/repos --username test
# Checkout a working copy
svn checkout http://localhost/svn/repos /path/to/checkout --username testCode language: PHP (php)
The original article also mentioned SmartSVN. Any modern SVN-compatible client can use the same repository URL once Apache authentication is working.
Common pitfalls and best practices
- Prefer distro packages unless you have a strict reason to compile from source.
- Confirm module and service names for your distro (apache2 vs httpd, module package names, config paths).
- Use a dedicated repository path (for example, /srv/svn) rather than build directories.
- Apply least privilege in svn-access-file instead of granting global write to everyone.
- If browser access fails, check Apache logs, SELinux context, and firewall rules.
I’m Rajesh Kumar, a DevOps, SRE, DevSecOps, Cloud, and Platform Engineering expert passionate about sharing practical knowledge, real-world experiences, and industry best practices. I have worked at Cotocus and regularly write about technology, travel, investing, health, product reviews, and digital marketing through my various platforms.
I publish technical articles at DevOps School, travel stories at Holiday Landmark, stock market insights at Stocks Mantra, health and fitness guidance at My Medic Plus, product reviews at TrueReviewNow, and SEO and digital marketing strategies at Wizbrand.
Find Trusted Cardiac Hospitals
Compare heart hospitals by city and services — all in one place.
Explore Hospitals