Setting up WebDAV with Docker on Windows

This guide walks you through setting up a WebDAV server via Docker Desktop on Windows in a trusted secure environment. You can serve up a folder on your computer via WebDAV and any TiddlyWiki file in it will automatically be able to save itself.

This was written for some friends and is being shared here in case others might find it helpful.

If you want to set up an internet facing WebDAV server you will also need to setup access permissions and a reverse proxy.

Steps:

  1. Download and install Docker Desktop

  2. Open Docker Desktop and locate the search bar at the top:

  3. Search for: nginx-webdav-nononsense and click on Run:

  4. Wait for the popup: Run a new container and open the Optional settings:

  5. Fill in the settings as shown below and then click Run.

    • Replace the Host path with the location of the folder you want to serve over WebDAV. Note that the example shows how the Windows path c:/Users/Saq/webdav needs to be entered as //c/Users/Saq/webdav.
    • using 8081 as the host port means your WebDAV server will be available in the browser at the URL: localhost:8081. You can use 80 as the host port to access the server at localhost
  6. You will see something along these lines, click on Containers:

  7. You will now see you running container, i.e. your WebDAV server. Click on the indicated button to open your server URI in the browser:

  8. Open settings for Docker Desktop and makes sure it automatically runs every time you start Windows:

  9. In Windows Explorer, open the folder you are serving over WebDAV and copy a TiddlyWiki file to it. You can have as many TiddlyWiki files, or other files such as images, as you desire. If your server is available at localhost, then a file called mywiki.html will be available at localhost/mywiki.html

Please feel free to amend and improve upon this guide.

8 Likes

Thanks for the detailed guide.

Are there any particular advantages or differences of this solution compared to rclone, as described in https://tiddlywiki.com/#Saving%20via%20WebDAV?
Without additional setup, both of these will allow to access the served content only from the host machine, right?

rclone is fantastic and does the trick for many use cases including WebDAV. Using Docker is preferable if you are going to use it for other things anyway, or if you are particularly averse to using the commandline.

If you want the server available on your local network:

  • on rclone you can use the --addr argument, for example rclone serve webdav some_directory --addr :8080
  • Serving this docker image over the network just requires running it from the command line the very first time, passing it the necessary arguments. You may in fact be able to do it from the GUI by using 0.0.0.0:8080 as the host port, I have always done it from the CLI.

However, you should really consider configuring access permissions when serving over the network unless you are on a network that you completely trust.

Documentation for the docker image:

2 Likes