Installing WebDAV with Apache in Ubuntu
Secure File Sharing with Apache + SSL + Digest Auth
In this guide, you will learn how to enable WebDAV file sharing using Apache Web Server on Ubuntu 18.04. A secure file management experience is provided by using SSL/TLS encryption and Digest Authentication in the installation. So Linux, macOS and Windows users can easily access files on your server.
What is WebDAV?
WebDAV (Web Distributed Authoring and Versioning) is an extension of HTTP and allows users to access files on a remote server through their own computers, just as if they were connecting to a local folder.
Advantages:
- Does not require extra software
- Connects directly to Windows/macOS/Linux file managers
- Provides a secure sharing infrastructure with SSL + Digest Auth
Prerequisites
Before starting the installation, you need to have the following ready:
- A server with Ubuntu 18.04 installed
- A user with sudo authority
- Apache Web Server installed
- A valid SSL certificate (Let's Encrypt) for your domain name
- Your domain name is directed to the server IP
Step 1: Enable Apache WebDAV Modules
- Activate the required modules:
sudo a2enmod dav
sudo a2enmod dav_fs
1. Restart Apache:
sudo systemctl restart apache2.service
🏗️ Step 2: Preparing Apache WebDAV Directory and Configuration
1. Create WebDAV Folder
sudo mkdir /var/www/webdav_paylasim
sudo chown www-data:www-data /var/www/webdav_paylasim
2. Create WebDAV Lock Database Index
sudo mkdir -p /usr/local/apache/var/
sudo chown www-data:www-data /usr/local/apache/var
2.1 VirtualHost Configuration
1. Open the SSL configuration file:
sudo nano /etc/apache2/sites-enabled/ornek.com-le-ssl.conf
2. Define DavLockDB
DavLockDB /usr/local/apache/var/DavLock
3. Add alias + tory configuration
Alias /dosya_deposu /var/www/webdav_paylasim
<tory /var/www/webdav_paylasim>
DAV On
</tory>
4. Verify Apache configuration and restart
sudo apachectl configtest
sudo systemctl restart apache2.service
Step 3: Add Digest Authentication for WebDAV
1. Create user password file
sudo touch /usr/local/apache/var/users.password
sudo chown www-data:www-data /usr/local/apache/var/users.password
2. Add user
sudo htdigest /usr/local/apache/var/users.password webdav_alan genix_user
- Complete the process by entering the password.
3. Add to Apache tory block
- Turn on SSL configuration again:
sudo nano /etc/apache2/sites-enabled/ornek.com-le-ssl.conf
- Add the following section:
<tory /var/www/webdav_paylasim>
DAV On
AuthType Digest
AuthName "webdav_alan"
AuthUserFile /usr/local/apache/var/users.password
Require valid-user
</tory>
- Activate the Digest module:
sudo a2enmod auth_digest
sudo systemctl restart apache2.service
Step 4: Testing WebDAV Access
1. Create test file:
sudo nano /var/www/webdav_paylasim/test-dosyasi.txt
sudo chown www-data:www-data /var/www/webdav_paylasim/test-dosyasi.txt
4.1 Access from different operating systems
1. Linux GNOME/KDE:
- Enter in the location bar:
davs://ornek.com/dosya_deposu
2. macOS Finder:
- Go → Connect to Server →
---
https://ornek.com/dosya_deposu
3. Windows:
- "Network Drive Map" →
https://ornek.com/dosya_deposu
- Every system asks you for the genix_user password.
Frequently Asked Questions
Why is Digest Authentication more secure? The password is sent as a hash instead of plain text. It is more secure than Basic Auth.
Is SSL mandatory? Yes. WebDAV transfers files and all traffic must be encrypted.
How to add new user? Create new user with the same command:
sudo htdigest /usr/local/apache/var/users.password webdav_alan yeni_kullanici
DavLockDB ne işe yarar?
-- Manages locking operations during file edits.
Can I run it from a different port? Yes. By changing VirtualHost to *:8080 for example.
Result
You have now set up a completely secure, SSL-protected, Digest Auth-locked WebDAV sharing system using Apache on Ubuntu. This structure is ideal for both individual use and small teams. You can try these advanced features immediately on your Virtual Server that you have set up on the GenixNode platform.

