Apache-WebDAV

Apache-WebDAV

Official

Docker app from mgutt's Repository

Overview

Very simple WebDAV server based on Apache. You need a WebDAV client to transfer files. It does not include a WebUI to upload files through your browser. Specifying USERNAME and PASSWORD only supports a single user. If you want to have lots of different logins for various users, bind mount user.passwd as follows: Open the Unraid WebTerminal >_ and execute the following: mkdir /mnt/user/appdata/apachewebdav touch /mnt/user/appdata/apachewebdav/user.passwd Add a new Path to this container with the following values: Container Path: /user.passwd Host Path: /mnt/user/appdata/apachewebdav/user.passwd After starting the container, open its console and execute the following for "Basic" authentification by changing "John" to your username (it asks for your password after executing): htpasswd -B /user.passwd John or this if you choosed "Digest" authentification: htdigest user.passwd WebDAV-Login John Execute the command multiple times with different usernames to add more users.

Project

apachewebdav/apachewebdav is based on bytemark/webdav including different pull requests:

Usage

Basic WebDAV server

This example starts a WebDAV server on port 80. It can only be accessed with a single username and password.

When using unencrypted HTTP, use Digest authentication (instead of Basic) to avoid sending plaintext passwords in the clear.

docker run -d --restart always -e 'AUTH_TYPE'='Digest' -e 'USERNAME'='alice' -e 'PASSWORD'='mypassword' \
    -v '/mnt/webdav':'/var/lib/dav/data':'rw' -v '/mnt/appdata':'/var/lib/dav':'rw' \
    -p '80:80' 'apachewebdav/apachewebdav'

Via Docker Compose:

version: '3'
services:
  webdav:
    image: apachewebdav/apachewebdav
    restart: always
    ports:
      - "80:80"
    environment:
      AUTH_TYPE: Digest
      USERNAME: alice
      PASSWORD: mypassword
    volumes:
      - /mnt/appdata:/var/lib/dav
      - /mnt/webdav:/var/lib/dav/data

Secure WebDAV with SSL

We recommend you use a reverse proxy (eg, Nginx Proxy Manager) to handle SSL certificates. If you're happy with a self-signed SSL certificate, specify -e SSL_CERT=selfsigned and the container will generate one for you.

docker run -d --restart always -e 'AUTH_TYPE'='Digest' -e 'USERNAME'='alice' -e 'PASSWORD'='mypassword' \
    -v '/mnt/webdav':'/var/lib/dav/data':'rw' -v '/mnt/appdata':'/var/lib/dav':'rw' \
    -e SSL_CERT=selfsigned -p '80:80' 'apachewebdav/apachewebdav'

If you bind mount a certificate chain to /cert.pem and a private key to /privkey.pem, the container will use that instead!

Authenticate multiple clients

Specifying USERNAME and PASSWORD only supports a single user. If you want to have lots of different logins for various users, bind mount your own file to /user.passwd and the container will use that instead.

If using Basic authentication, run the following commands through the Containers Console:

touch user.passwd
htpasswd -B user.passwd alice
htpasswd -B user.passwd bob

If using Digest authentication, run the following commands. (NB: The default REALM is WebDAV. If you specify your own REALM, you'll need to run htdigest again with the new name.)

touch user.passwd
htdigest user.passwd WebDAV alice
htdigest user.passwd WebDAV bob

Once you've created your own user.passwd, bind mount it into your container with -v /path/to/user.passwd:/user.passwd.

Environment variables

All environment variables are optional. You probably want to at least specify USERNAME and PASSWORD (or bind mount your own authentication file to /user.passwd) otherwise nobody will be able to access your WebDAV server!

  • SERVER_NAMES: Comma-separated list of domains (eg, example.com,www.example.com). The first is set as the ServerName, and the rest (if any) are set as ServerAlias. The default is localhost.
  • LOCATION: The URL path for WebDAV (eg, if set to /webdav then clients should connect to example.com/webdav). The default is /.
  • AUTH_TYPE: Apache authentication type to use. This can be Basic (best choice for HTTPS) or Digest (best choice for HTTP). The default is Basic.
  • REALM: Sets AuthName, an identifier that is displayed to clients when they connect. The default is WebDAV.
  • USERNAME: Authenticate with this username (and the password below). This is ignored if you bind mount your own authentication file to /user.passwd.
  • PASSWORD: Authenticate with this password (and the username above). This is ignored if you bind mount your own authentication file to /user.passwd.
  • ANONYMOUS_METHODS: Comma-separated list of HTTP request methods (eg, GET,POST,OPTIONS,PROPFIND). Clients can use any method you specify here without authentication. Set to ALL to disable authentication. The default is to disallow any anonymous access.
  • SSL_CERT: Set to selfsigned to generate a self-signed certificate and enable Apache's SSL module. If you specify SERVER_NAMES, the first domain is set as the Common Name.
  • PUID: file owner's UID of /var/lib/dav/data
  • PGID: file owner's GID of /var/lib/dav/data
  • PUMASK: umask of /var/lib/dav/data

Install Apache-WebDAV on Unraid in a few clicks.

Find Apache-WebDAV in Community Apps on your Unraid server, review the template, and click Install. Unraid handles the Docker app or plugin setup from the published template.

Open the Apps tab on your Unraid server Search Community Apps for Apache-WebDAV Review the template variables and paths Click Install

Categories

Download Statistics

240,029
Total Downloads
10,835
This Month
5,948
Avg / Month

Total Downloads Over Time

Loading chart...

Related apps

Explore more like this

Explore all

Details

Repository
apachewebdav/apachewebdav
Last Updated2021-08-11
First Seen2021-08-11

Runtime arguments

Web UI
http://[IP]:[PORT:80]/
Network
bridge
Shell
sh
Privileged
false
Extra Params
--memory=1G

Template configuration

WebDAV SharePathrw

Container Path: /var/lib/dav/data

Target
/var/lib/dav/data
Value
/mnt/user/webdav
Webserver PortPorttcp

Container Port: 80

Target
80
Value
8384
DomainsVariable

Comma-separated list of domains (eg, example.com,www.example.com). The first is set as the ServerName, and the rest (if any) are set as ServerAlias. The default is localhost.

Target
SERVER_NAMES
Value
localhost
Base URLVariable

The URL path for WebDAV (eg, if set to /webdav then clients should connect to example.com/webdav). The default is /.

Target
LOCATION
Value
/
AuthenticationVariable

Apache authentication type to use. This can be Basic (best choice for HTTPS) or Digest (best choice for HTTP). The default is Basic.

Target
AUTH_TYPE
Value
Basic
Login TitleVariable

The string will appear in the password dialog provided by browsers.

Target
REALM
Value
WebDAV-Login
UsernameVariable

Authenticate with this username (and the password below). Will be ignored if /user.passwd is present.

Target
USERNAME
PasswordVariable

Authenticate with this password (and the username above). Will be ignored if /user.passwd is present.

Target
PASSWORD
Public methodsVariable

Comma-separated list of HTTP request methods (eg, GET,POST,OPTIONS,PROPFIND) which can be used without login. The default is to disallow any anonymous access.

Target
ANONYMOUS_METHODS
Enable SSLVariable

Set to selfsigned to generate a self-signed certificate and enable Apache's SSL module. If you specify SERVER_NAMES, the first domain is set as the Common Name.

Target
SSL_CERT
ConfigPathrw

Container Path: /var/lib/dav

Target
/var/lib/dav
Value
/mnt/user/appdata/webdav
User IDVariable

Container Variable: PUID

Target
PUID
Value
99
Group IDVariable

Container Variable: PGID

Target
PGID
Value
100
umaskVariable

Container Variable: PUMASK

Target
PUMASK
Default
0000
Value
0000