Skip to content
Follow
Ubuntu Linux

Setting Up Apache WebDAV on Ubuntu 24.04

Richard
Written by
Richard
Feb 23, 2025 Updated Sep 15, 2026 3 min read
Setting Up Apache WebDAV on Ubuntu 24.04
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 an FTP program. WebDAV, short for Web-based Distributed Authoring and Versioning, adds file-sharing tools to standard web traffic.

Advertisement

This setup lets you treat your remote server just like a folder on your own computer on Ubuntu version 24.04. You can drag, drop, and delete files directly through your file manager or web browser.

⚡ Quick Answer

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.

Advertisement

Set up Apache WebDAV

To set up Apache WebDAV on Ubuntu 24.04, you need to install the required helper tools on your server. First, make sure Apache is already running on your machine. Then, open your terminal and run the command `sudo apt install apache2-utils` to install the package that lets you manage passwords and connections for your shared folders.

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.

Advertisement

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.

Advertisement

Create user account

To create a user account for Apache WebDAV, you need to set up a username and password that the server checks when someone tries to connect. Run the command `sudo htpasswd -Bc /etc/apache2/.htpasswd username` in your terminal to create the password file and add your first user with secure login details.

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.

Advertisement
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

To connect to the Apache WebDAV server from a Windows PC, you use the built-in network location tool to map the server like a standard folder. Open File Explorer, right-click on 'Home', select 'Add a network location', and type in your web address along with the username and password you created earlier.

Advertisement

Add a network location in Windows.

Right-click File Explorer home and select 'Add a network location.'

Network location Windows 11
Network location Windows 11

Type in the WebDAV address.

http://example.com/webdav
Network location Windows 11 address
Network location Windows 11 address

Provide the account credentials created earlier when prompted.

Advertisement
Connecting to Apache WebDAV network location on Windows 11
Connecting to Apache WebDAV network location on Windows 11

Continue and complete the setup.

Network location Windows 11 complete
Network location Windows 11 complete

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:

Advertisement
  • 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?

Was this helpful?
Richard

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.

Advertisement

📚 Related Tutorials

How to Install Apache on Ubuntu Linux
Ubuntu Linux How to Install Apache on Ubuntu Linux
How to Set Up Apache Basic Authentication in Ubuntu 24.04
Ubuntu Linux How to Set Up Apache Basic Authentication in Ubuntu 24.04
How to Install Ubuntu Linux
Ubuntu Linux How to Install Ubuntu Linux
How to Enable Checkboxes in Windows 11 File Explorer
Windows How to Enable Checkboxes in Windows 11 File Explorer

No comments yet — be the first to share your thoughts!

Leave a Comment

Your email address will not be published. Required fields are marked *