Setting Up Apache WebDAV on Ubuntu 24.04
Apache WebDAV on Ubuntu 24.04 turns your server into a shared network drive so you can open, edit, and move files from anywhere without using an FTP program. WebDAV stands for Web-based Distributed Authoring and Versioning, and it adds extra file-sharing features to standard web traffic.
Setting this up on Ubuntu 24.04 lets you treat your remote server just like a folder on your own computer. You can drag, drop, and delete files directly through your file manager or web browser.
Install the `apache2-utils` package, create a WebDAV directory, configure an Apache virtual host with `Alias` and `Location` directives, and create a user account using `htpasswd`. Finally, enable the WebDAV module, your site, and restart Apache.
Set up Apache WebDAV
The `apache2-utils` package provides the tools needed for Apache WebDAV. Open your terminal and run the command `sudo apt install apache2-utils` to install the package on your Ubuntu 24.04 system.
Note that this post assumes Apache is already installed on the Ubuntu machine. Read the linked guide below to learn how to install Apache if needed.
Install Apache on Ubuntu Linux.
Run the command below to install the Apache utility package.
Create the WebDAV directory and adjust its folder permissions so the Apache web server can interact with the `/srv/webdav` folder. This ensures Apache maintains the necessary access to read and write files within the WebDAV directory.
The `webdav.conf` file manages your WebDAV folder for Apache on Ubuntu 24.04. Create the `webdav.conf` file within the `/etc/apache2/sites-available/` directory. This file holds the specific instructions that turn on WebDAV and point Apache toward the location of stored files.
sudo nano /etc/apache2/sites-available/webdav.conf
Copy the block below, paste it into the file, and save changes.
Alias /webdav /var/www/webdav
<Location /webdav>
DAV On
SSLRequireSSL
Options None
AuthType Basic
AuthName WebDAV
AuthUserFile /etc/apache2/.htpasswd
<RequireAny>
Require method GET POST OPTIONS
Require valid-user
</RequireAny>
</Location>
Exit the file upon completion.
Create user account
Apache's basic authentication system creates a user account for WebDAV on Ubuntu 24.04. Set up a username and password using the `htpasswd` command. The command `sudo htpasswd -Bc /etc/apache2/.htpasswd username` creates a new user and securely stores login credentials for WebDAV access.
Read the post below for more details regarding Apache's basic authentication.
Set up Apache basic authentication
Run the command below to create a basic user account.
sudo htpasswd -Bc /etc/apache2/.htpasswd username
Replace username with the desired account name.
Enter and confirm a new password for the account when prompted.
Enable the Apache WebDAV module, `mod_dav.so`, alongside the virtual host file named `dav.conf` created previously. Enabling these components permits Apache to handle WebDAV requests. Restart Apache services afterward to apply modifications.
sudo a2enmod dav*
sudo a2ensite webdav
sudo systemctl restart apache2
Connect to the WebDAV
Linking your Windows PC to the WebDAV server works much like adding a standard network drive. Open File Explorer, right-click on 'Home', and select 'Add a network location.' Enter the WebDAV address, such as `http://example.com/webdav`, and provide the created username and password.
Add a network location in Windows.
Right-click File Explorer home and select 'Add a network location.'

Type in the WebDAV address.
http://example.com/webdav

Provide the account credentials created earlier when prompted.

Continue and complete the setup.

That concludes the configuration.
Conclusion:
Setting up Apache WebDAV on Ubuntu 24.04 provides a powerful way to manage files collaboratively. WebDAV permits efficient remote file management without requiring a separate FTP client. Review the key takeaways below:
- Easy File Management: WebDAV allows direct editing, creation, and deletion of files on the server.
- Authentication: Utilizing basic authentication enhances security with username and password protection.
- Cross-Platform Compatibility: While Windows requires SSL for WebDAV, workarounds are available.
- Scalability: The setup can be adapted for larger systems as needed by adjusting configurations and permissions.
- Community Resources: Numerous tutorials and guides exist for troubleshooting and expanding WebDAV capabilities.
This setup process facilitates effective file collaboration, boosting productivity by establishing a shared space for document management.
What replaced WebDAV?
Secure alternatives like FTPS and SFTP (SSH File Transfer Protocol) serve as common substitutes for WebDAV when secure file transfer is required.
Was this guide helpful?
About the Author
Richard
Tech Writer, IT Professional
Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.
No comments yet — be the first to share your thoughts!