WebDAV container setup
Introduction
A tiny container running WebDAV to create, change and move documents on a server. From a Synology NAS, I make backups to a Linux server where this WebDAV container is running and is set as the backup destination.
Setup
-
Create the folders needed by the container
Run the following commands inside your home folder:
# Open your terminal applicationcd ~mkdir -p webdav/datamkdir -p webdav/configcd webdav -
Create the script needed to run the container
Save the following script as
webdav_run.sh
:webdav_run.sh # To create this script use your text editor application, for example NanoIDu=$(id -u $(logname)) # Saves the logged in user id in the IDu variableIDg=$(id -g $(logname)) # Saves the logged in user group in the IDg variabledocker run -d \-p 0.0.0.0:873:80 \--hostname=webdav \--name=webdav \-v $PWD/data:/webdav \-v $PWD/config:/config \-e TZ="Europe/Amsterdam" \-e USER_UID=$IDu \-e USER_GID=$IDg \-e WHITELIST='192.168.1.*|172.16.1.*' \-e READWRITE=true \jgeusebroek/webdav# IMPORTANT: Please read the instructions belowInstructions:
- Optional Replace
docker
withpodman
if needed - Required Replace port number
873
of0.0.0.0:873
(on the left side of:
) with a port number that is available if needed - Optional Replace
$PWD/data
with the location of your data if needed. This can be a fileserver mount - Required Remove the
-v $PWD/config:/config \
line if you want to use the default userwebdav
and passwordvadbew
. Else you need to use thehtpasswd
package and follow the instructions here - Required Replace
Europe/Amsterdam
with your own timezone - Required Replace
192.168.1.*|172.16.1.*
with a list of IP’s in the form of a regular expression which are then whitelisted
- Optional Replace
-
Run the script to create the container
Run the following command:
# Open your terminal applicationsudo sh webdav_run.shThe image
jgeusebroek/webdav
is automatically pulled and the container is created. -
Check the results
If needed you can check if the container is running properly.
Now you can use WebDAV to create, change and move documents on a server.
No comments found for this note.
Join the discussion for this note on Github. Comments appear on this page instantly.