2017-10-02 19:29:23 +00:00
---
title: "WebDAV"
description: "Rclone docs for WebDAV"
2022-11-17 17:56:24 +00:00
versionIntroduced: "v1.39"
2017-10-02 19:29:23 +00:00
---
2021-07-20 18:45:41 +00:00
# {{< icon "fa fa-globe" >}} WebDAV
2017-10-02 19:29:23 +00:00
Paths are specified as `remote:path`
2020-10-13 21:49:58 +00:00
Paths may be as deep as required, e.g. `remote:directory/subdirectory` .
2017-10-02 19:29:23 +00:00
2021-10-14 13:40:18 +00:00
## Configuration
2017-10-02 19:29:23 +00:00
To configure the WebDAV remote you will need to have a URL for it, and
a username and password. If you know what kind of system you are
connecting to then rclone can enable extra features.
Here is an example of how to make a remote called `remote` . First run:
rclone config
This will guide you through an interactive setup process:
```
2021-11-01 20:34:46 +00:00
No remotes found, make a new one?
2017-10-02 19:29:23 +00:00
n) New remote
s) Set configuration password
q) Quit config
n/s/q> n
name> remote
Type of storage to configure.
Choose a number from below, or type in your own value
2018-06-25 15:03:36 +00:00
[snip]
2022-06-19 16:59:54 +00:00
XX / WebDAV
2017-10-02 19:29:23 +00:00
\ "webdav"
2018-06-25 15:03:36 +00:00
[snip]
2017-10-02 19:29:23 +00:00
Storage> webdav
URL of http host to connect to
Choose a number from below, or type in your own value
1 / Connect to example.com
\ "https://example.com"
url> https://example.com/remote.php/webdav/
2022-06-19 16:59:54 +00:00
Name of the WebDAV site/service/software you are using
2017-10-02 19:29:23 +00:00
Choose a number from below, or type in your own value
2023-03-13 04:45:54 +00:00
1 / Fastmail Files
\ (fastmail)
2 / Nextcloud
\ (nextcloud)
3 / Owncloud
\ (owncloud)
4 / Sharepoint Online, authenticated by Microsoft account
\ (sharepoint)
5 / Sharepoint with NTLM authentication, usually self-hosted or on-premises
\ (sharepoint-ntlm)
2023-11-05 12:37:25 +00:00
6 / rclone WebDAV server to serve a remote over HTTP via the WebDAV protocol
\ (rclone)
7 / Other site/service or software
2023-03-13 04:45:54 +00:00
\ (other)
vendor> 2
2017-10-02 19:29:23 +00:00
User name
user> user
Password.
y) Yes type in my own password
g) Generate random password
n) No leave this optional password blank
y/g/n> y
Enter the password:
password:
Confirm the password:
password:
2020-10-13 21:49:58 +00:00
Bearer token instead of user/pass (e.g. a Macaroon)
2019-07-17 09:11:22 +00:00
bearer_token>
2017-10-02 19:29:23 +00:00
Remote config
2024-08-16 10:05:43 +00:00
Configuration complete.
Options:
- type: webdav
- url: https://example.com/remote.php/webdav/
- vendor: nextcloud
- user: user
- pass: ** * ENCRYPTED ** *
- bearer_token:
Keep this "remote" remote?
2017-10-02 19:29:23 +00:00
y) Yes this is OK
e) Edit this remote
d) Delete this remote
y/e/d> y
```
Once configured you can then use `rclone` like this,
List directories in top level of your WebDAV
rclone lsd remote:
List all the files in your WebDAV
rclone ls remote:
To copy a local directory to an WebDAV directory called backup
rclone copy /home/source remote:backup
2023-11-18 12:36:46 +00:00
### Modification times and hashes
2017-10-02 19:29:23 +00:00
Plain WebDAV does not support modified times. However when used with
2023-03-13 04:45:54 +00:00
Fastmail Files, Owncloud or Nextcloud rclone will support modified times.
2017-10-02 19:29:23 +00:00
2019-01-27 13:33:21 +00:00
Likewise plain WebDAV does not support hashes, however when used with
2023-03-13 04:45:54 +00:00
Fastmail Files, Owncloud or Nextcloud rclone will support SHA1 and MD5 hashes.
2019-01-27 13:33:21 +00:00
Depending on the exact version of Owncloud or Nextcloud hashes may
appear on all objects, or only on objects which had a hash uploaded
with them.
2017-10-02 19:29:23 +00:00
2020-05-22 11:22:52 +00:00
{{< rem autogenerated options start " - DO NOT EDIT - instead edit fs . RegInfo in backend / webdav / webdav . go then run make backenddocs " > }}
2021-11-01 15:42:05 +00:00
### Standard options
2018-10-01 19:48:54 +00:00
2022-07-09 17:08:20 +00:00
Here are the Standard options specific to webdav (WebDAV).
2018-10-01 19:48:54 +00:00
#### --webdav-url
2021-11-01 15:42:05 +00:00
URL of http host to connect to.
E.g. https://example.com.
2018-10-01 19:48:54 +00:00
2022-03-18 12:29:54 +00:00
Properties:
2018-10-01 19:48:54 +00:00
- Config: url
- Env Var: RCLONE_WEBDAV_URL
- Type: string
2022-03-18 12:29:54 +00:00
- Required: true
2018-10-01 19:48:54 +00:00
#### --webdav-vendor
2022-07-09 17:08:20 +00:00
Name of the WebDAV site/service/software you are using.
2018-10-01 19:48:54 +00:00
2022-03-18 12:29:54 +00:00
Properties:
2018-10-01 19:48:54 +00:00
- Config: vendor
- Env Var: RCLONE_WEBDAV_VENDOR
- Type: string
2022-03-18 12:29:54 +00:00
- Required: false
2018-10-01 19:48:54 +00:00
- Examples:
2023-06-30 13:11:17 +00:00
- "fastmail"
- Fastmail Files
2018-10-01 19:48:54 +00:00
- "nextcloud"
- Nextcloud
- "owncloud"
- Owncloud
- "sharepoint"
2021-11-01 15:42:05 +00:00
- Sharepoint Online, authenticated by Microsoft account
2019-01-17 12:35:30 +00:00
- "sharepoint-ntlm"
2021-11-01 15:42:05 +00:00
- Sharepoint with NTLM authentication, usually self-hosted or on-premises
2023-11-26 15:59:12 +00:00
- "rclone"
- rclone WebDAV server to serve a remote over HTTP via the WebDAV protocol
2018-10-01 19:48:54 +00:00
- "other"
- Other site/service or software
#### --webdav-user
2021-11-01 15:42:05 +00:00
User name.
In case NTLM authentication is used, the username should be in the format 'Domain\User'.
2018-10-01 19:48:54 +00:00
2022-03-18 12:29:54 +00:00
Properties:
2018-10-01 19:48:54 +00:00
- Config: user
- Env Var: RCLONE_WEBDAV_USER
- Type: string
2022-03-18 12:29:54 +00:00
- Required: false
2018-10-01 19:48:54 +00:00
#### --webdav-pass
Password.
2020-09-02 15:59:04 +00:00
**NB** Input to this must be obscured - see [rclone obscure ](/commands/rclone_obscure/ ).
2022-03-18 12:29:54 +00:00
Properties:
2018-10-01 19:48:54 +00:00
- Config: pass
- Env Var: RCLONE_WEBDAV_PASS
- Type: string
2022-03-18 12:29:54 +00:00
- Required: false
2018-10-01 19:48:54 +00:00
#### --webdav-bearer-token
2021-11-01 15:42:05 +00:00
Bearer token instead of user/pass (e.g. a Macaroon).
2018-10-01 19:48:54 +00:00
2022-03-18 12:29:54 +00:00
Properties:
2018-10-01 19:48:54 +00:00
- Config: bearer_token
- Env Var: RCLONE_WEBDAV_BEARER_TOKEN
- Type: string
2022-03-18 12:29:54 +00:00
- Required: false
2018-10-01 19:48:54 +00:00
2021-11-01 15:42:05 +00:00
### Advanced options
2019-08-26 14:25:20 +00:00
2022-07-09 17:08:20 +00:00
Here are the Advanced options specific to webdav (WebDAV).
2019-08-26 14:25:20 +00:00
#### --webdav-bearer-token-command
2021-11-01 15:42:05 +00:00
Command to run to get a bearer token.
2019-08-26 14:25:20 +00:00
2022-03-18 12:29:54 +00:00
Properties:
2019-08-26 14:25:20 +00:00
- Config: bearer_token_command
- Env Var: RCLONE_WEBDAV_BEARER_TOKEN_COMMAND
- Type: string
2022-03-18 12:29:54 +00:00
- Required: false
2019-08-26 14:25:20 +00:00
2021-03-31 18:12:08 +00:00
#### --webdav-encoding
2022-03-18 12:29:54 +00:00
The encoding for the backend.
2021-03-31 18:12:08 +00:00
2021-11-01 15:42:05 +00:00
See the [encoding section in the overview ](/overview/#encoding ) for more info.
2021-03-31 18:12:08 +00:00
Default encoding is Slash,LtGt,DoubleQuote,Colon,Question,Asterisk,Pipe,Hash,Percent,BackSlash,Del,Ctl,LeftSpace,LeftTilde,RightSpace,RightPeriod,InvalidUtf8 for sharepoint-ntlm or identity otherwise.
2022-03-18 12:29:54 +00:00
Properties:
2021-03-31 18:12:08 +00:00
- Config: encoding
- Env Var: RCLONE_WEBDAV_ENCODING
- Type: string
2022-03-18 12:29:54 +00:00
- Required: false
2021-03-31 18:12:08 +00:00
2021-05-11 12:19:26 +00:00
#### --webdav-headers
2021-11-01 15:42:05 +00:00
Set HTTP headers for all transactions.
2021-05-11 12:19:26 +00:00
Use this to set additional HTTP headers for all transactions
The input format is comma separated list of key,value pairs. Standard
[CSV encoding ](https://godoc.org/encoding/csv ) may be used.
2022-03-18 12:29:54 +00:00
For example, to set a Cookie use 'Cookie,name=value', or '"Cookie","name=value"'.
2021-05-11 12:19:26 +00:00
You can set multiple headers, e.g. '"Cookie","name=value","Authorization","xxx"'.
2022-03-18 12:29:54 +00:00
Properties:
2021-05-11 12:19:26 +00:00
- Config: headers
- Env Var: RCLONE_WEBDAV_HEADERS
- Type: CommaSepList
- Default:
2023-06-30 13:11:17 +00:00
#### --webdav-pacer-min-sleep
Minimum time to sleep between API calls.
Properties:
- Config: pacer_min_sleep
- Env Var: RCLONE_WEBDAV_PACER_MIN_SLEEP
- Type: Duration
- Default: 10ms
#### --webdav-nextcloud-chunk-size
Nextcloud upload chunk size.
We recommend configuring your NextCloud instance to increase the max chunk size to 1 GB for better upload performances.
See https://docs.nextcloud.com/server/latest/admin_manual/configuration_files/big_file_upload_configuration.html#adjust-chunk-size-on-nextcloud-side
Set to 0 to disable chunked uploading.
Properties:
- Config: nextcloud_chunk_size
- Env Var: RCLONE_WEBDAV_NEXTCLOUD_CHUNK_SIZE
- Type: SizeSuffix
- Default: 10Mi
2024-03-10 11:22:43 +00:00
#### --webdav-owncloud-exclude-shares
Exclude ownCloud shares
Properties:
- Config: owncloud_exclude_shares
- Env Var: RCLONE_WEBDAV_OWNCLOUD_EXCLUDE_SHARES
- Type: bool
- Default: false
2024-06-14 15:04:51 +00:00
#### --webdav-owncloud-exclude-mounts
Exclude ownCloud mounted storages
Properties:
- Config: owncloud_exclude_mounts
- Env Var: RCLONE_WEBDAV_OWNCLOUD_EXCLUDE_MOUNTS
- Type: bool
- Default: false
2024-05-24 09:45:10 +00:00
#### --webdav-unix-socket
Path to a unix domain socket to dial to, instead of opening a TCP connection directly
Properties:
- Config: unix_socket
- Env Var: RCLONE_WEBDAV_UNIX_SOCKET
- Type: string
- Required: false
2024-03-10 11:22:43 +00:00
#### --webdav-description
2024-06-14 15:04:51 +00:00
Description of the remote.
2024-03-10 11:22:43 +00:00
Properties:
- Config: description
- Env Var: RCLONE_WEBDAV_DESCRIPTION
- Type: string
- Required: false
2020-05-22 11:22:52 +00:00
{{< rem autogenerated options stop > }}
2018-10-01 17:36:15 +00:00
2021-10-14 13:40:18 +00:00
## Provider notes
2018-06-25 15:03:36 +00:00
See below for notes on specific providers.
2024-02-18 06:16:23 +00:00
### Fastmail Files
2023-03-13 04:45:54 +00:00
Use `https://webdav.fastmail.com/` or a subdirectory as the URL,
and your Fastmail email `username@domain.tld` as the username.
Follow [this documentation ](https://www.fastmail.help/hc/en-us/articles/360058752854-App-passwords )
to create an app password with access to `Files (WebDAV)` and use
this as the password.
Fastmail supports modified times using the `X-OC-Mtime` header.
2021-10-14 13:40:18 +00:00
### Owncloud
2017-10-02 19:29:23 +00:00
Click on the settings cog in the bottom right of the page and this
will show the WebDAV URL that rclone needs in the config step. It
will look something like `https://example.com/remote.php/webdav/` .
Owncloud supports modified times using the `X-OC-Mtime` header.
2021-10-14 13:40:18 +00:00
### Nextcloud
2017-10-02 19:29:23 +00:00
This is configured in an identical way to Owncloud. Note that
2020-11-27 16:57:43 +00:00
Nextcloud initially did not support streaming of files (`rcat`) whereas
Owncloud did, but [this ](https://github.com/nextcloud/nextcloud-snap/issues/365 ) seems to be fixed as of 2020-11-27 (tested with rclone v1.53.1 and Nextcloud Server v19).
2017-10-23 11:13:01 +00:00
2021-10-14 13:40:18 +00:00
### Sharepoint Online
2018-04-09 08:05:43 +00:00
2018-06-25 15:03:36 +00:00
Rclone can be used with Sharepoint provided by OneDrive for Business
2018-04-09 08:05:43 +00:00
or Office365 Education Accounts.
This feature is only needed for a few of these Accounts,
mostly Office365 Education ones. These accounts are sometimes not
2019-07-28 17:47:38 +00:00
verified by the domain owner [github#1975 ](https://github.com/rclone/rclone/issues/1975 )
2018-04-09 08:05:43 +00:00
This means that these accounts can't be added using the official
API (other Accounts should work with the "onedrive" option). However,
it is possible to access them using webdav.
To use a sharepoint remote with rclone, add it like this:
First, you need to get your remote's URL:
- Go [here ](https://onedrive.live.com/about/en-us/signin/ )
to open your OneDrive or to sign in
- Now take a look at your address bar, the URL should look like this:
`https://[YOUR-DOMAIN]-my.sharepoint.com/personal/[YOUR-EMAIL]/_layouts/15/onedrive.aspx`
2020-05-19 11:02:44 +00:00
You'll only need this URL up to the email address. After that, you'll
2018-04-09 08:05:43 +00:00
most likely want to add "/Documents". That subdirectory contains
the actual data stored on your OneDrive.
Add the remote to rclone like this:
Configure the `url` as `https://[YOUR-DOMAIN]-my.sharepoint.com/personal/[YOUR-EMAIL]/Documents`
and use your normal account email and password for `user` and `pass` .
If you have 2FA enabled, you have to generate an app password.
Set the `vendor` to `sharepoint` .
Your config file should look like this:
```
[sharepoint]
type = webdav
url = https://[YOUR-DOMAIN]-my.sharepoint.com/personal/[YOUR-EMAIL]/Documents
2019-01-17 12:35:30 +00:00
vendor = sharepoint
2018-04-09 08:05:43 +00:00
user = YourEmailAddress
pass = encryptedpassword
2018-06-25 15:03:36 +00:00
```
2021-10-14 13:40:18 +00:00
### Sharepoint with NTLM Authentication
2019-01-17 12:35:30 +00:00
Use this option in case your (hosted) Sharepoint is not tied to OneDrive accounts and uses NTLM authentication.
2021-01-22 04:55:05 +00:00
To get the `url` configuration, similarly to the above, first navigate to the desired directory in your browser to get the URL,
2019-01-17 12:35:30 +00:00
then strip everything after the name of the opened directory.
Example:
If the URL is:
https://example.sharepoint.com/sites/12345/Documents/Forms/AllItems.aspx
The configuration to use would be:
https://example.sharepoint.com/sites/12345/Documents
Set the `vendor` to `sharepoint-ntlm` .
NTLM uses domain and user name combination for authentication,
set `user` to `DOMAIN\username` .
Your config file should look like this:
```
[sharepoint]
type = webdav
url = https://[YOUR-DOMAIN]/some-path-to/Documents
vendor = sharepoint-ntlm
user = DOMAIN\user
pass = encryptedpassword
```
2021-10-14 13:40:18 +00:00
#### Required Flags for SharePoint
2019-10-03 14:31:08 +00:00
As SharePoint does some special things with uploaded documents, you won't be able to use the documents size or the documents hash to compare if a file has been changed since the upload / which file is newer.
2019-10-12 11:08:22 +00:00
For Rclone calls copying files (especially Office files such as .docx, .xlsx, etc.) from/to SharePoint (like copy, sync, etc.), you should append these flags to ensure Rclone uses the "Last Modified" datetime property to compare your documents:
2019-10-03 14:31:08 +00:00
```
--ignore-size --ignore-checksum --update
```
2023-11-05 12:37:25 +00:00
## Rclone
Use this option if you are hosting remotes over WebDAV provided by rclone.
Read [rclone serve webdav ](commands/rclone_serve_webdav/ ) for more details.
rclone serve supports modified times using the `X-OC-Mtime` header.
2021-10-14 13:40:18 +00:00
### dCache
2018-06-25 15:03:36 +00:00
2019-07-17 09:11:22 +00:00
dCache is a storage system that supports many protocols and
authentication/authorisation schemes. For WebDAV clients, it allows
users to authenticate with username and password (BASIC), X.509,
Kerberos, and various bearer tokens, including
[Macaroons ](https://www.dcache.org/manuals/workshop-2017-05-29-Umea/000-Final/anupam_macaroons_v02.pdf )
and [OpenID-Connect ](https://en.wikipedia.org/wiki/OpenID_Connect )
access tokens.
2018-07-05 09:04:57 +00:00
2018-06-25 15:03:36 +00:00
Configure as normal using the `other` type. Don't enter a username or
password, instead enter your Macaroon as the `bearer_token` .
The config will end up looking something like this.
```
[dcache]
type = webdav
url = https://dcache...
vendor = other
user =
pass =
bearer_token = your-macaroon
```
2018-07-05 09:04:57 +00:00
2019-01-15 09:21:34 +00:00
There is a [script ](https://github.com/sara-nl/GridScripts/blob/master/get-macaroon ) that
2018-07-05 09:04:57 +00:00
obtains a Macaroon from a dCache WebDAV endpoint, and creates an rclone config file.
2019-07-17 09:11:22 +00:00
Macaroons may also be obtained from the dCacheView
web-browser/JavaScript client that comes with dCache.
2021-10-14 13:40:18 +00:00
### OpenID-Connect
2019-07-17 09:11:22 +00:00
dCache also supports authenticating with OpenID-Connect access tokens.
OpenID-Connect is a protocol (based on OAuth 2.0) that allows services
to identify users who have authenticated with some central service.
Support for OpenID-Connect in rclone is currently achieved using
another software package called
[oidc-agent ](https://github.com/indigo-dc/oidc-agent ). This is a
command-line tool that facilitates obtaining an access token. Once
installed and configured, an access token is obtained by running the
`oidc-token` command. The following example shows a (shortened)
access token obtained from the *XDC* OIDC Provider.
```
paul@celebrimbor:~$ oidc-token XDC
eyJraWQ[...]QFXDt0
paul@celebrimbor:~$
```
**Note** Before the `oidc-token` command will work, the refresh token
must be loaded into the oidc agent. This is done with the `oidc-add`
command (e.g., `oidc-add XDC` ). This is typically done once per login
session. Full details on this and how to register oidc-agent with
your OIDC Provider are provided in the [oidc-agent
documentation](https://indigo-dc.gitbooks.io/oidc-agent/).
The rclone `bearer_token_command` configuration option is used to
fetch the access token from oidc-agent.
Configure as a normal WebDAV endpoint, using the 'other' vendor,
leaving the username and password empty. When prompted, choose to
edit the advanced config and enter the command to get a bearer token
(e.g., `oidc-agent XDC` ).
The following example config shows a WebDAV endpoint that uses
oidc-agent to supply an access token from the *XDC* OIDC Provider.
```
[dcache]
type = webdav
url = https://dcache.example.org/
vendor = other
bearer_token_command = oidc-token XDC
```