Calendar (CalDAV)

The Calendar configuration hands a CalDAV account to the native Calendar app of iOS and iPadOS via a configuration profile, which removes the need for manual setup by the end user. On current iOS versions, the calendar paths belonging to the account are discovered automatically according to RFC 6764 through a redirect at /.well-known/caldav. A correctly configured server-side /.well-known/caldav redirect is therefore mandatory on current iOS versions; specifying a Principal URL alone is no longer sufficient there.

The configuration is also available for devices with User Enrollment →.


Configuration options

The following fields are available for the CalDAV account. They correspond to the keys of the Apple CalDAV payload (com.apple.caldav.account).

Account settings

  • Account description — display name of the account on the device.
  • Hostname (required) — server address as a DNS name without scheme, port and path (e.g. calendar.example.com). Plain IP addresses are not accepted.
  • Port — usually 443. The field has no preset value.
  • Use SSL — enabled by default; leave it enabled when the server is reachable via HTTPS. Without SSL enabled, an unencrypted connection is attempted on port 443, which fails.
  • Username (required) — entered manually or via placeholders such as ${user.name} or ${user.email}. Further placeholders are listed in the Available placeholders section below the form.
  • Password — if left empty, the device prompts for it during profile installation.
  • Principal URL (optional) — the full URL of the user principal including scheme and host (e.g. https://calendar.example.com/remote.php/dav/principals/users/${user.name}/).

Per account VPN

The CalDAV account can be referenced in a VPN configuration in the Per account VPN section, so that the connection to the calendar server is established through this VPN. The form of the Calendar configuration then shows the notice “This configuration is referenced by a VPN configuration.” with the link Show the referenced configuration. Setting up the VPN is described in App to VPN Mapping →.


Automatic discovery via .well-known

Current iOS versions set up CalDAV accounts according to RFC 6764. The sequence is:

  1. A PROPFIND /.well-known/caldav request to the server configured under Hostname.
  2. The server responds with a redirect (301) to its DAV endpoint (/remote.php/dav for ownCloud/Nextcloud).
  3. The DAV endpoint is used to determine the current-user-principal and, from there, the user’s calendar area.

Reliable setup therefore depends entirely on a correct /.well-known redirect. On newer iOS versions, automatic discovery can no longer be bypassed by specifying a Principal URL — without a working /.well-known redirect the setup fails, even if a Principal URL is configured.


Server-side configuration of the redirect

/.well-known/caldav and /.well-known/carddav must redirect to the server’s DAV endpoint with a 301. The target address must begin with https:// and must not contain an internal port.

For nginx:

location = /.well-known/caldav  { return 301 https://$host/remote.php/dav; }
location = /.well-known/carddav { return 301 https://$host/remote.php/dav; }

For Apache (in the vHost):

Redirect 301 /.well-known/caldav  https://calendar.example.com/remote.php/dav
Redirect 301 /.well-known/carddav https://calendar.example.com/remote.php/dav

Verification

The redirect can be checked with curl:

curl -sI https://calendar.example.com/.well-known/caldav

The response must contain a redirect with a correct location header:

HTTP/2 301
location: https://calendar.example.com/remote.php/dav

The location header must begin with https:// and must not contain an internal port (e.g. :8080).


Troubleshooting

SymptomCauseSolution
Setup fails only on newer iOS versions; older devices keep workingThe redirect points to http:// (downgrade); older iOS versions tolerated thisCorrect the redirect to https://
301 points to an internal port (e.g. :8080)Reverse proxy/TLS termination, the web server does not know its public addressSet the redirect with the full https:// address on the proxy or web server
405 Method Not Allowed on paths such as / or /principals/Automatic discovery does not take effect and falls back to default paths that do not exist on the serverConfigure the /.well-known redirect correctly (mandatory on newer iOS versions)
The discovered path is obviously wrongPrincipal URL configured with a different host or with http:// instead of https://, or Use SSL not enabledEnter the Principal URL with https:// and the server configured under Hostname, or leave it empty, and enable Use SSL

Isolating the problem on the device

For isolation, a CalDAV account can be set up directly on the device as a test under Settings → Calendar → Accounts. If the manually configured account connects while the account distributed via profile fails, the cause lies in automatic discovery (/.well-known) or in the Principal URL distributed through the profile — not in the server itself.


Use on macOS

The CalDAV configuration and the server-side /.well-known requirement apply to macOS unchanged:

Top