> ## Content Index
> Fetch the complete content index at: https://blog.alphavps.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# How to Set Up a WebDAV Server on Ubuntu 24.04 VPS
- URL: https://blog.alphavps.com/how-to-set-up-a-webdav-server-on-ubuntu-24-04-vps/
- Published: 2026-02-02T08:25:48.000Z
- Updated: 2026-09-08T15:18:08.000Z
- Author: Karim Buzdar
- Tags: Tutorials, Ubuntu, Web Servers, Backups & Storage

WebDAV (Web Distributed Authoring and Versioning), an extension of the HTTP protocol, allows you to create, delete, and modify files on your server. This is a great tool for web developers and teams who want a secure file management system that can be accessed via a browser or OS. WebDAV allows users to access files remotely as if the server were local.

This guide will show you how to configure a WebDAV Server on Ubuntu 24.04 using Apache. It includes configuration, user authentication, and secure SSL encryption.

## How to Set Up a WebDAV Server on Ubuntu 24.04 VPS 

Setting up a WebDAV on Ubuntu 24.04 is an easy way to share and manage files across multiple devices. By combining Apache WebDAV, Digest authentication, and SSL encryption, you can create a flexible, safe, and secure remote storage environment. 

To set up a WebDAV server on Ubuntu 24.04 VPS, follow the steps below:

### Step 1: Install Apache Web Server

WebDAV is a module of the Apache web server, so install Apache first:

```bash
sudo apt install apache2
```

![](https://blog.alphavps.com/content/images/2025/11/data-src-image-d694501c-6438-4bb9-850e-168df18a13d7.png)

Start the Apache service by enabling it.

```bash
sudo systemctl enable apache2
sudo systemctl start apache2
```

![](https://blog.alphavps.com/content/images/2025/11/data-src-image-a2c29a37-736b-43c3-98c0-18e8d59143bb.png)

Apache is at the core of your WebDAV installation. By installing and enabling Apache, you can ensure that the server is prepared to host and serve HTTP files. Check to see if Apache is running.

```bash
sudo systemctl status apache2
```

![](https://blog.alphavps.com/content/images/2025/11/data-src-image-af755643-ea65-4c48-a18a-886390fea548.png)

You're ready to move on if it's active.

### Step 2: Enable WebDAV Modules in Apache

Apache modules dav, auth\_digest, and dav\_fs provide WebDAV functionality. Enable them by:

```bash
sudo a2enmod dav dav_fs auth_digest
sudo systemctl restart apache2
```

![](https://blog.alphavps.com/content/images/2025/11/data-src-image-9bdada41-6551-444d-b43a-681949a2bf1b.png)

- dav – Enables WebDAV functionality
- Dav\_fs – Stores files in WebDAV format on the filesystem
- auth\_digest – Adds secure user authentication

### Step 3: Create a WebDAV Directory

You will need to create a WebDAV directory. This creates a WebDAV directory and assigns ownership to Apache's user. It also secures the directory with limited permissions.

```bash
sudo mkdir -p /var/www/webdav
sudo chown www-data:www-data /var/www/webdav
sudo chmod 750 /var/www/webdav
```

![](https://blog.alphavps.com/content/images/2025/11/data-src-image-6c26b097-145e-4fa2-a548-a63092d28fc9.png)

### Step 4: Configure Authentication for WebDAV

To secure your WebDAV server, create a password file for authentication. First, install the Apache utilities package:

```bash
sudo apt install apache2-utils
```

![](https://blog.alphavps.com/content/images/2025/11/data-src-image-cc4c519e-958e-4130-a585-12a8a393e570.png)

Create a password file, and then add a user.

```bash
sudo htdigest -c /etc/apache2/webdav.passwd "WebDAV Restricted" webuser
```

![](https://blog.alphavps.com/content/images/2025/11/data-src-image-a47df934-8493-4b83-ae4d-42833324584e.png)

You will be asked to enter a passcode.

- webdav.passwd stores user credentials.
- The authentication realm must match the Apache configuration.
- webuser is the username for WebDAV.

### Step 5: Configure the WebDAV Virtual Host

Create a new WebDAV configuration file:

```bash
sudo nano /etc/apache2/sites-available/webdav.conf
```

Add the following configuration to your system:

```bash
<VirtualHost *:80>
    ServerAdmin admin@example.com
    ServerName example.com
    DocumentRoot /var/www/webdav
    <Directory /var/www/webdav>
        Options Indexes FollowSymLinks
        AllowOverride None
        DAV On
        AuthType Digest
        AuthName "WebDAV Restricted"
        AuthUserFile /etc/apache2/webdav.passwd
        Require valid-user
    </Directory>
    ErrorLog ${APACHE_LOG_DIR}/webdav_error.log
    CustomLog ${APACHE_LOG_DIR}/webdav_access.log combined
</VirtualHost>
```

![](https://blog.alphavps.com/content/images/2025/11/data-src-image-5c4467fb-7b85-4898-b1c6-1bf860b04d53.png)

This configuration will enable WebDAV in your domain and secure access with Digest authentication. It records access and errors to make troubleshooting easier. Save and close the file.

Reload Apache and enable the new site:

```bash
sudo a2ensite webdav.conf
sudo systemctl reload apache2
```

![](https://blog.alphavps.com/content/images/2025/11/data-src-image-30c47c53-ed60-4e79-a43b-9614db72294d.png)

### Step 6: Secure WebDAV with HTTPS (SSL/TLS)

Secure your WebDAV with HTTPS. Install Certbot for a free SSL Certificate:

```bash
sudo apt install certbot python3-certbot-apache
```

![](https://blog.alphavps.com/content/images/2025/11/data-src-image-02b66e43-2f06-4f79-bb0e-d1b822601ced.png)

You can request a certificate to secure your domain.

```bash
sudo certbot --apache -d example.com
```

![](https://blog.alphavps.com/content/images/2025/11/data-src-image-575cc0dc-2249-4a24-b764-c842386a5f45.png)

Follow the instructions on the screen to finish SSL installation.

This will configure Apache to use HTTPS automatically and redirect all HTTP traffic to HTTPS. Your WebDAV connections will be encrypted and secured.

### Step 7: Adjust Firewall Settings

Allow HTTPS traffic and HTTP through the firewall.

```bash
sudo ufw allow 'Apache Full'
sudo ufw reload
```

![](https://blog.alphavps.com/content/images/2025/11/data-src-image-468f62e7-b1f7-4d5a-9c4e-8eecdeffa5cc.png)

### Step 8: Access Your WebDAV Server

You can now access your WebDAV Server from a web browser or as a network drive mapped to the browser:

**Web Browser:**Log in to your WebDAV account at https://example.com/.

![](https://blog.alphavps.com/content/images/2025/11/data-src-image-74a8a2de-7a97-4a8a-8cf6-74906e777422.png)

### Step 9: Verify and Test WebDAV

Check log files to verify successful file transfers and connections.

```bash
sudo tail -f /var/log/apache2/webdav_access.log
```

![](https://blog.alphavps.com/content/images/2025/11/data-src-image-3aeda794-a754-43f1-9ae3-3a1f2461d75d.png)

To confirm that everything is working, try uploading, renaming, or deleting files remotely.

## Conclusion

Install Apache with sudo install apache2 --y, then enable the required modules using sudo dav\_fs a2enmod auth\_digest. Create a WebDAV folder using sudo: mkdir-p /var/www/webdav. Set permissions by sudo: chown www data:www data /var/www/webdav. Then, create authentication credentials using sudo htdigest -c /etc/apache2/webdav.passwd "WebDAV Restricted" webuser.

Configure the WebDAV site by editing /etc/apache2/sites-available/webdav.conf to enable DAV, set the authentication type, and specify the password file. Reload Apache and enable the site using sudo a2ensite Webdav.conf. Install an SSL certificate with Certbot using sudo certbot -apache d yourdomain.com. Finally, allow Apache through the firewall using sudo ufw. Allow 'Apache Full' and access your WebDAV server at https://yourdomain.com using the username and password you created.

Once configured, a WebDAV server will act as a private cloud or a lite file hosting system. WebDAV allows you to manage websites, backups, or shared documents.

If you want to start an online project and need [**Storage VPS**](https://alphavps.com/storage-vps.html?ref=blog.alphavps.com), **contact us** and our experts will offer you a solution that meets your needs and goals.