Thunderbird iCloud calendar sync

I understand a Thunderbird iCloud calendar sync may be a niche use case. However, if you’re stuck with it you don’t care how much of a niche it is. You’ll want clear instructions how to fix you problem, that is how to add an iCloud calendar to Thunderbird – and you’ll get just that here.

Thunderbird iCloud calendar sync
How to setup a Thunderbird iCloud calendar sync; connect TB to iCloud

Thunderbird iCloud calendar sync

There are two general approaches how to add an iCloud calendar to Thunderbird

  • The lame one: a read-only view of any iCloud calendar. I’ll mention it at the very end of this article for the sake of completeness. It’s a pity that Apple only documented this one.
  • The real one i.e. just what you’d expect: full integration, editable calendar with two-way synchronisation. Unfortunately, this is more complicated than it could and should be but I guess Apple really wants you to use their apps exclusively.

Connect an iCloud calendar to Thunderbird

Adding any remote calendar to Thunderbird is trivial. However, with an iCloud calendar it’s more complicated than usual for two reasons:

  1. You need to deal with two-factor authentication (2FA).
    If you log into iCloud Apple requires username/password plus a verification code they send to your mobile. Of course, this is not feasible if Thunderbird authenticates itself against iCloud on your behalf. Therefore you need to create an app-specific password for Thunderbird.
  2. Apple is not willing to reveal the URL to your remote calendar.
    If you don’t know the specific URL to your iCloud calendar you can’t add it to Thunderbird. Some digging is necessary to get a hold of this gold nugget.

Thus, we need to complete the above two steps before we can actually add the iCloud calendar to Thunderbird.

A) Create an app-specific password for Thunderbird

In May 2017 Apple announced:

Beginning on 15 June, app-specific passwords will be required to access your iCloud data using third-party apps such as Microsoft Outlook, Mozilla Thunderbird, or other mail, contacts and calendar services not provided by Apple.

Fortunately this is less complicated than it may sound:

  1. Sign in to your Apple ID account page.
  2. In the ‘Security’ section, click ‘Generate Password’ below ‘App-Specific Passwords’.
  3. Follow the steps on your screen.
Apple ID sign-in
Sign into your Apple account
Apple-ID generate app-specific password
Generate an app-specific password

Gotcha! Take note of the password Apple generated for you as it’s not stored anywhere. Thus, Apple won’t be able to recover it for you!

B) Discover the URL to your iCloud calendar

iCloud calendar URLs for Thunderbird (and other iCal clients) contain three pieces of information that are unique for each calendar:

https://<server-number>-caldav.icloud.com/<user-id>/calendars/<calendar-id>/

There are several ways to find the effective values for your specific calendar but none are “consumer-ready”. What I present below is the easiest I could find. Let me know if you found something more user friendly.

  • Open the iCloud calendar app in the browser of your choice.
  • Open the browser’s developer tools aka inspector. Often hitting F12 gets you there but the below table has all the details:
    Google ChromeFirefoxInternet Explorer/EdgeSafari
    MacOS⌘+⌥+i⌘+⌥+in/a⌘+⌥+i
    Windowsctrl+shift+ictrl+shift+iF12n/a
  • Open the ‘Network’ tab in the devtools
    • clear any entries that may already be there to empty the list (in Chrome: crossed-through circle icon, 2nd from left)
    • filter for ‘collections’ (enter that into the text field)
    • activate only the ‘XHR’ requests
  • Now, on the iCloud page, click the checkmark on the left side of the calendar you want to integrate into Thunderbird.
  • The inspector will record a HTTP request against URL that looks something like this https://<server-number>-calendarws.icloud.com/ca/collections/<calendar-id>?<lots-of-keys-and-values>&dsid=<user-id>&yadayada-etc. Extract server number, calendar ID and user ID and keep them somewhere handy.In my case the user ID is a 9-digit number and the calendar ID consists of 40+ alphanumeric characters and dashes.
  • Extract the three highlighted pieces of information.

Alternatives for tech-savvy folks:

C) Create calendar to Thunderbird

You’re home free! The last step is a trivial one.

In Thunderbird open the ‘Calendar’ tab, then right-click on the left side in the calendar list and select ‘New Calendar’.

Create a calendar in Thunderbird

In the next dialog select ‘On the Network’ and hit ‘Continue’. The calendar URL you extracted in the previous step needs to be entered in the following dialog after you select ‘CalDAV’ as your calendar format.

Again, the URL is https://<server-number>-caldav.icloud.com/<user-id>/calendars/<calendar-id>/. The actual values for the <xxx> tokens is what you collected in step B.

Thunderbird will then ask you for a password at which point you enter the app-specific iCloud password generated in step A).

Congratulations, well done!

The lame approach, adding a read-only calendar

As I said earlier it’s fairly straight-forward to add an iCloud calendar to Thunderbird in read-only mode but who would want that? FWIW here’s how:

  1. Open the calendar app on the Mac.
  2. Right-click a specific calendar.
  3. Select ‘Share Calendar’.
  4. Click the ‘Public Calendar’ checkbox in the dialog.

The URL displayed after the last step can then be used to create an iCalendar (ICS), not CalDAV, in Thunderbird that is read-only.

32 thoughts on “Thunderbird iCloud calendar sync

  1. Thanks for your interesting post. I gave it a try and it happened to work.

    Though, in some unclear circumstances, the calendar server seems to be disconnected.

    The only workaround I found, was to unsubscribe from the icloud calendar and recreate it. In some cases I need to repeat the operation several times, until I am requested to log in again.

    Any explanation for this behaviour ?

  2. Nice! This works quite well, the only problem I see is that sometimes reminders don’t seem to be dismissable. A small nuisance, but by disabling the reminder dialog (and sound) this is solved (sort of).

  3. Tried it and was able to set up 2 calendars, however Thunderbird never asked for a password and the calendars both show momentarily unavailable and don’t seem to change. So not working. Any ideas? I pasted the entire URL in for location which is what you said to do. Except at first you said to extract just the server number, calendar ID and user ID. This was just a bit confusing. Anyway seems that something went wrong.

  4. There is also a drop down to associate an email address with the new calendar during the setup. Does that make any difference?

    1. I think you used the wrong URL for the calendar, at least that was it when I first tried it (it also didn’t ask for the password).
      The URL you need to use is: https:/xxx-caldav.icloud.com/xxx/calendars/xxx/
      (using the info you gathered in the described steps).

      The e-mail address is only important for the replies (e.g. when you accept an invitation); the one you selected will be used to send the reply from.

  5. This part is very confusing.
    “The calendar URL you extracted in the previous step needs to be entered in the following dialog after you select ‘CalDAV’ as your calendar format”

    I copy and pasted the url. That did not work.

    Thanks to Hayo Baan for this.
    The URL you need to use is: https:/xxx-caldav.icloud.com/xxx/calendars/xxx/
    (using the info you gathered in the described steps).

    I got it to work after adjusting the url.

    Thanks to OP Marcel Stör and Hayo Baan.

    1. I’m still convinced that if you follow the tutorial carefully everything should be clear. However, your comments show I may be wrong. I, therefore, slightly adjusted the text that might have caused some confusion.

      1. I have been trying for over a year to setup iCloud calendar in Thunderbird. This tutorial enabled my success! Knowing how to extract the info for the correct URL had been the challenge. Not for the faint of heart or casual everyday user, but do-able by anyone who will carefully follow these instructions. Thank you!

  6. I did exactly as noted with the URL in the format you specified with the extracted three pieces of info info that I was able to get following your instructions – doesn’t work though – gets a greyed out Calendar even after multiple attempts – any suggestions? Thanks

    1. Bryan, did you create an application password like described and did Thunderbird ask for it? If not, it probably has an older, invalid, password saved for the calendar. Go to Preferences|Security|Saved Passwords and remove the existing calendar passwords and then try again.

    2. I had a similar experience with one calendar that I found in an Info.plist file. I suspect it is an old one that I have deleted. Others work – the one called ‘home’ should be the easiest to connect to, I think.

  7. Hi there – yes got it working thanks – in the URL the you use to determine the three tokens, the order of the second and third tokens is the reverse of that in the URL required when setting up the new calendar in Mozilla- once I reordered the last two tokens it was fine. Thanks. Bryan

  8. Newbies should be aware that the option to generate app-specific passwords is only available if the user has activated two-factor authentication for their Apple ID. Only one extra step, sure, but worth mentioning.

  9. Doesn’t seem to be working for me – I’ve followed the instructions exactly, but the iCloud Calendar checkbox immediately and automatically gets unchecked after Thunderbird starts. Error console says

    [calCachedCalendar] replay action failed: null, uri=, result=2147500037, operation=[xpconnect wrapped calIOperation] calCachedCalendar.js:330:29

    Any ideas?

  10. Thanks for the detailed write-up, much appreciated. The only part that I was getting confused was in specifying the .caldav.icloud.com/etc…..
    In my set-up it was in fact just a port no., in the format of “pXX” where XX were two digits. I was expecting a very long identifier as the for the other and .

  11. Hello! After all this steps
    My server number has only one letter and two numbers but despite this fact thunderbird accepted everything but in the end he asked me for USERNAME and PASSWORD for that URL… Should I write in this windows my Apple ID and password or what? I have my generated password but everything what I writing is wrong… :/
    Thanks for Help

  12. Thanks very much for this. I did try a recursive grep in the Info.plist files but I couldn’t see the wood for the forest. I wasn’t familiar with the devtools in Firefox and wasn’t sure what was meant by ‘clear any entries’. Eventually, I stumbled across the little ‘x’ on the RHS that does just that (might be helpful to add it to your useful screenshot?).
    I think there might be a typo around the region of ‘server number’ as most I’ve seen referred to seem to be three characters, not 40.
    Some of my calendar IDs are easily legible (eg: ‘home’, ‘category167844’) but others are a long string of numbers, capital letters and dashes (about 36 in total). Seems no rhyme or reason to it.
    It’s a pity someone can’t write a Lightning add-on to link to iCloud – I have a couple of neat ones for my Android phone. The calendar link automatically finds all the calendars and even picks up the colours I use for them on my Mac. Another for iCloud Contacts. (Smooth Sync for Cloud Calendar, if anyone is interested). I was very happy to pay the £2 for each of them and would be happy to pay for a Lightning add-on.

  13. A bit tricky at first, but after reading some comments I managed to get it done, and it works perfectly well!! Many thanks!!

  14. Hi- thanks for this- after repeated attempts I can not get the icloud calendar to stay on (select “switch on” in properties, the rick appears on the right hand side then disappears- and the URL has been triple checked- any thoughts?

    Thanks again

  15. Great article and thanks for working all that out….so desperately needed to get away from iMail and the default Apple Calendar apps and into a single ‘does it all’ app like Thunderbird, but couldn’t work this out. Well done and a huge thanks from me!

  16. Hello
    Thank you for this tutorial.
    Unfortunately I’m not able to find the URL adress without more little help.
    The adress I obtain is : https://p11-calendarws.icloud.com/ca/collections/work?clientBuildNumber=5246Project87&clientId=74U78E98-T67E-32U0-720U-74YT0ROF8E63&clientMasteringNumber=74YR639&clientVersion=5.1&dsid=6501894302&endDate=2018-11-04&lang=fr-fr&methodOverride=PUT&requestID=9&startDate=2018-09-30&usertz=US%2FPacific
    (I’ve change the « codes » but it’s the form I have.)
    My is p11
    My is 6501894302
    And my is ?? I don’t know
    Is it : work?clientBuildNumber=5246Project87&clientId=74U78E98-T67E-32U0-720U-74YT0ROF8E63&clientMasteringNumber=74YR639&clientVersion=5.1
    Or just 74U78E98-T67E-32U0-720U-74YT0ROF8E63
    Or another thing ?

  17. Why don’t mozilla just fix it properly so it’s dead set easy to set up just like all the other email clients I have tried everything and the dam thing never syncs I always have a blank calander just properly fix it guys.

Leave a Reply