WebDAV โ
Store backups on any WebDAV-compatible server โ Nextcloud, ownCloud, Apache, Nginx, or any other WebDAV endpoint.
Overview โ
WebDAV (Web Distributed Authoring and Versioning) is an extension of HTTP that allows clients to manage files on remote servers. Benefits:
- ๐ Works over HTTP/HTTPS โ no special ports or protocols
- ๐ HTTPS encryption in transit by default
- ๐ Native support in Nextcloud, ownCloud, Synology, and many NAS devices
- ๐ Simple username/password authentication
Configuration โ
| Field | Description | Default |
|---|---|---|
| Name | Friendly name | Required |
| URL | WebDAV server URL | Required |
| Username | WebDAV username | Required |
| Password | WebDAV password | Optional |
| Path Prefix | Subdirectory for backups | Optional |
Setup Examples โ
Nextcloud โ
- Ensure WebDAV is enabled (it is by default)
- Create a dedicated user or use an existing account
- Configure in DBackup:
- URL:
https://nextcloud.example.com/remote.php/dav/files/USERNAME/ - Username:
backupuser - Password: Your password or an app password
- Path Prefix:
backups/server1
- URL:
App Passwords
For security, create a dedicated app password in Nextcloud under Settings > Security > App passwords instead of using your main password.
ownCloud โ
- WebDAV is enabled by default
- Configure in DBackup:
- URL:
https://owncloud.example.com/remote.php/dav/files/USERNAME/ - Username:
backupuser - Password: Your password
- Path Prefix:
backups
- URL:
Synology NAS (WebDAV) โ
- Install the WebDAV Server package from Package Center
- Enable HTTPS in WebDAV Server > Settings
- Configure in DBackup:
- URL:
https://synology-ip:5006 - Username:
backupuser - Password: Your password
- Path Prefix:
backups
- URL:
Apache (mod_dav) โ
- Enable modules:
a2enmod dav dav_fs - Configure a WebDAV directory in your Apache config:
apache
<Directory /var/www/webdav>
Dav On
AuthType Basic
AuthName "WebDAV"
AuthUserFile /etc/apache2/.htpasswd
Require valid-user
</Directory>- Create the htpasswd file:
htpasswd -c /etc/apache2/.htpasswd backupuser - Restart Apache:
sudo systemctl restart apache2 - Configure in DBackup:
- URL:
https://server.example.com/webdav - Username:
backupuser - Password: Your htpasswd password
- URL:
Nginx (nginx-dav-ext-module) โ
- Install Nginx with DAV support
- Add a WebDAV location block:
nginx
location /webdav {
alias /var/www/webdav;
dav_methods PUT DELETE MKCOL COPY MOVE;
dav_ext_methods PROPFIND OPTIONS;
dav_access user:rw group:rw all:r;
auth_basic "WebDAV";
auth_basic_user_file /etc/nginx/.htpasswd;
create_full_put_path on;
autoindex on;
}- Create htpasswd:
htpasswd -c /etc/nginx/.htpasswd backupuser - Restart Nginx:
sudo systemctl restart nginx - Configure in DBackup:
- URL:
https://server.example.com/webdav - Username:
backupuser - Password: Your htpasswd password
- URL:
Directory Structure โ
After backups, your WebDAV server will contain:
/your-prefix/
โโโ mysql-daily/
โ โโโ backup_2024-01-15T12-00-00.sql.gz
โ โโโ backup_2024-01-15T12-00-00.sql.gz.meta.json
โ โโโ ...
โโโ postgres-weekly/
โโโ ...Docker Configuration โ
The WebDAV adapter uses the webdav npm package and requires no additional system dependencies. It works out of the box in both Docker and local development environments.
Troubleshooting โ
Connection Failed โ
401 UnauthorizedSolutions:
- Verify username and password are correct
- For Nextcloud/ownCloud, try using an app password
- Ensure the WebDAV endpoint URL is correct
Forbidden โ
403 ForbiddenSolutions:
- Check file/folder permissions on the server
- Verify the user has write access to the target directory
- Check if server-side security rules (e.g., fail2ban) are blocking requests
Not Found โ
404 Not FoundSolutions:
- Verify the WebDAV URL is correct
- For Nextcloud: ensure URL includes
/remote.php/dav/files/USERNAME/ - Check that the WebDAV service is enabled on the server
SSL Certificate Errors โ
UNABLE_TO_VERIFY_LEAF_SIGNATURESolutions:
- Use a valid SSL certificate (e.g., Let's Encrypt)
- For self-signed certificates in development, set
NODE_TLS_REJECT_UNAUTHORIZED=0(not recommended for production)
File Size Limits โ
Some WebDAV servers impose upload size limits:
Solutions:
- Apache: Increase
LimitRequestBodydirective - Nginx: Increase
client_max_body_sizedirective - Nextcloud: Adjust
upload_max_filesizeandpost_max_sizein PHP config
Security Best Practices โ
- Use HTTPS โ Always use TLS-encrypted connections
- App passwords โ Use dedicated app passwords instead of main account passwords
- Dedicated user โ Create a separate account for backups with minimal permissions
- Path isolation โ Restrict the backup user to a specific directory
- Firewall rules โ Limit which IPs can access the WebDAV endpoint
- Enable backup encryption โ Use DBackup's encryption profiles for at-rest encryption
Comparison with Other Destinations โ
| Feature | WebDAV | SFTP | SMB | S3 | Local |
|---|---|---|---|---|---|
| Setup complexity | Easy | Medium | Easy | Easy | Easiest |
| Works over internet | โ | โ | โ | โ | โ |
| HTTPS encryption | โ | N/A (SSH) | โ | โ | N/A |
| Nextcloud/ownCloud | โ | โ | โ | โ | โ |
| NAS support | โ | โ | โ | โ | โ |
| Self-hosted | โ | โ | โ | โ | โ |
| No CLI dependency | โ | โ | โ | โ | โ |