• Stars
    star
    350
  • Rank 120,244 (Top 3 %)
  • Language
    Shell
  • License
    MIT License
  • Created about 6 years ago
  • Updated almost 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Docker image for running an Apache WebDAV server

Supported tags

Quick reference

This image runs an easily configurable WebDAV server with Apache.

You can configure the authentication type, the authentication of multiple users, or to run with a self-signed SSL certificate. If you want a Let's Encrypt certificate, see an example of how to do that here.

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.

To make sure your data doesn't get deleted, you'll probably want to create a persistent storage volume (-v vol-webdav:/var/lib/dav) or bind mount a directory (-v /path/to/directory:/var/lib/dav):

docker run --restart always -v /srv/dav:/var/lib/dav \
    -e AUTH_TYPE=Digest -e USERNAME=alice -e PASSWORD=secret1234 \
    --publish 80:80 -d bytemark/webdav

Via Docker Compose:

version: '3'
services:
  webdav:
    image: bytemark/webdav
    restart: always
    ports:
      - "80:80"
    environment:
      AUTH_TYPE: Digest
      USERNAME: alice
      PASSWORD: secret1234
    volumes:
      - /srv/dav:/var/lib/dav

Secure WebDAV with SSL

We recommend you use a reverse proxy (eg, Traefik) to handle SSL certificates. You can see an example of how to do that here.

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 --restart always -v /srv/dav:/var/lib/dav \
    -e AUTH_TYPE=Basic -e USERNAME=test -e PASSWORD=test \
    -e SSL_CERT=selfsigned --publish 443:443 -d bytemark/webdav

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:

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.

More Repositories

1

docker-smtp

Docker image for sending outgoing mail
Shell
119
star
2

pi-init2

Set up a Raspberry Pi and manage any of its configuration just from the /boot partition
Go
41
star
3

configs-gitlab-docker

Configuration files for setting up GitLab on Docker, with SMTP, automatic backups & updates
Shell
24
star
4

symbiosis

A hosting environment that works with you, not against you.
Ruby
20
star
5

configs-huginn-docker

Configuration files for setting up Huginn on Docker
15
star
6

configs-webdav-docker

Configuration files for setting up your own Omni Sync server on Docker
11
star
7

bigv-python

A Module for BigV which wraps the BigV CLI
Python
8
star
8

flexnbd-c

An NBD server written for Bytemark's bigv.io service. It was designed around use of fast Linux features such as sparse files, sendfile, splice and mmap. It can do live migration of storage. Proudly powering Bytemark's Cloud Servers
C
8
star
9

bgpfeeder

A BGPv4 daemon to distribute an infrequently-changing set of static routes
Ruby
7
star
10

configs-jenkins-docker

Configuration files for setting up Jenkins on Docker
6
star
11

configs-wordpress-docker

Configuration files for setting up WordPress on Docker and automatic updates
5
star
12

go-pdns

PowerDNS pipebackend implementation in Go
Go
4
star
13

configs-matomo-docker

Configuration files for setting up Matomo on Docker, with, SSL certificates, outgoing email and automatic updates
4
star
14

custodian

A distributed protocol tester.
Ruby
4
star
15

netlinkrb

Ruby interface to Linux Netlink
Ruby
3
star
16

configs-nextcloud-docker

Configuration files for setting up Nextcloud on Docker
3
star
17

byteback

A maintenance-free Linux backup solution, using btrfs snapshots
Ruby
3
star
18

mauvealert

Ruby
2
star
19

au

Debian package builder for ruby apps
Ruby
2
star
20

bmdash

Customisable dashboard software
CSS
1
star
21

bytemark-client

Command-line client for interacting with Bytemark services
Go
1
star