How do I setup a WebDAV Server on Windows and link it to odrive?

Update:
I’ve created a better structured and more thorough guide to setting up a WebDAV server on Windows and then syncing with it.

Note: Even if you aren’t interested in the syncing part (odrive), this guide will still quickly get you up and running with a functioning WebDAV server, using the first section



Original Post:

Here is how to setup a basic WebDAV server on Windows in about 5 minutes. Tested on Windows 10, Windows 8.1, and Windows 2012R2.

1) Open up a Powershell command prompt as administrator


2) Copy and paste the following command into Powershell and hit enter:

$feats = @("IIS-WebServerRole","IIS-WebServer","IIS-CommonHttpFeatures","IIS-HttpErrors","IIS-Security","IIS-RequestFiltering","IIS-WebServerManagementTools","IIS-DigestAuthentication","IIS-StaticContent","IIS-DefaultDocument","IIS-DirectoryBrowsing","IIS-WebDAV","IIS-BasicAuthentication","IIS-ManagementConsole");foreach ($feat in $feats) {Enable-WindowsOptionalFeature -Online -FeatureName $feat};New-SelfSignedCertificate -DnsName odrive-self-signed -CertStoreLocation cert:\LocalMachine\My;& "$env:windir\system32\inetsrv\InetMgr.exe";

This command will install the IIS modules needed for WebDAV, create a self-signed certificate to allow HTTPS, and launch the IIS Manager


3) Now that the IIS Manager is open, right-click on “Default Web Site” and select “Add Virtual Directory”

Select the location on your computer that you wish to make available via your WebDAV server (under “Physical path”), type “WebDAV” for the alias, and click “OK”.


4) Under “Default Website” select “Bindings”

Add a binding for https, port 4433, select “odrive-self-signed” as the SSL certificate, and click “OK”

Note: There is a bug in IIS that will reject to-spec MOVEs when the standard port is used, which is why I recommend a non-standard port like 4433. However, a workaround was done in the odrive move method to account for this, so it shouldn’t be a problem with odrive, but could be for other applications. :unamused:

Remove the port 80 binding once you have port 4433 in.


5) Click on “SSL Settings” under “Default Web Site”

Select “Require SSL”, “Ignore” for “Client Certificates”, and click “Apply”


6) Click on “Authentication” under “Default Web Site”

Disable “Anonymous Authentication”, and enable “Basic Authentication”


7) Click on “WebDAV Authoring Rules” under “Default Web Site”

Click on “Enable WebDAV”

Click on “Add Authoring Rule”, select “All content” under “Allow access to”, select “All Users” under “Allow access to this content to”, check “Read” and “Write” under “Permissions”, and click “OK”.


8) Click on “Restart” under “Default Web Site”


9) The final step is to link your WebDAV server to odrive.
The example below is linking to a the server over the LAN because I have not setup external access to this machine. Setting up external access is outside the scope of this write-up, but let me know if you have questions about it.

Make sure port 4433 is specified in “Server” and “Require Valid SSL Certificate” is unchecked. The username and password will be the credentials you use to login to your Windows machine where the WebDAV server is running.

That should be it!

Keep in mind that this is a very basic setup. There are many areas you can dig into to add more users, control granular user access, add storage locations, use your own SSL certificate, integrate different authentication systems (like AD), etc…

Let me know if you encounter any issues with the above instructions. I am hoping it allows folks to install and use WebDAV fairly easily.

2 Likes