Your own addressbook and calendar cloud: Share contacts, agendas and tasks with CardDAV/CalDAV

Feb. 28, 2020

If you use different devices and computers to get things done, you might want to synchronise contacts, agendas and tasks. You can use any of the 'big cloud' services for this, like Apple iCloud, Microsoft Office 365 and Google Gmail. But, if you prefer not to share your addressbook and calendar with big American companies, you can do it yourself.

Why do it yourself?

Although it is very convenient to use a big cloud service for addressbook and calendar syncing, there are good reasons why you might want to do it yourself:

control: if you run the Addressbook/Calendar cloud, you control how it works, how much it costs, who has access to it, etc.

privacy: although the big companies claim they 'value your privacy', they offer no garanties that nobody will look at your data. I like my addressbook (with appointments, project details, etc) and contacts (names, numbers, birthdays) to be private.

freedom: if you use open protocols to run your Addressbook/Calendar cloud, you can use it on all your devices.

How to do it: CardDAV/CalDAV

For maximum freedom and flexibility in the choosing the devices you use, you need to select a common denominator when looking for solutions that allow the sharing of addressbooks and calendars. Luckily such a solution exists in the CardDAV and CalDAV open standards.

Both CardDAV and CalDAV are extensions on the WebDAV standard. Web Distributed Authoring and Versioning (WebDAV) itself is an extension of the standard HTTP protocol. It's a protocol that allows multiple clients (devices/computers/apps) to share a resource (file/addressbook/calendar/etc).

CardDAV

The CardDAV protocol is an addressbook sharing protocol. It was originally proposed as standard by Apple in 2007, RFC 6352. The protocol uses WebDAV to share contact data in the "vCard" file format. You can best think of a vCard as a virtual business card. CardDAV allows you to share your collection of virtual business cards between your devices.

CalDAV

The CalDAV protocol is a calendar sharing protocol. Just like CardDAV it was originally proposed as standard by Apple, RFC 6638. It uses WebDAV to share appointment data in the iCalendar-format. The "Internet Calendaring and Scheduling Core Object Specification" is an open standard itself, RFC 5545, that is widely supported. CalDAV allows multiple devices and apps to access your calendar, allowing cooperative planning and information sharing.

CardDAV/CalDAV requires a server

To work with CardDAV/CalDAV you need a server that acts as central repository of your addressbook/calendar data. Unlike 'peer-to-peer' connections (where you would link your phone to your computer), the CardDAV/CalDAV protocol is designed to work using the internet. The central server allows devices and apps to independently connect and synchronise data.

CardDAV/CalDAV server connecting with devices and apps

As the protocol is based on (efficient) web technology, the requirements for the server are minimal. You don't need powerful processors or huge amounts of storage memory. Some people run their CardDAV/CalDAV from a cheap Raspberry Pi computer. Alternatively you could use a small VPS, a NAS or an old computer.

CardDAV/CalDAV server software

The CardDAV/CalDAV server software consists of two parts: the server operating system and the actual CardDAV/CalDAV server. Because of its open standard definition, you are free to choose the operating system yourself. GNU/Linux is a common choice as server operating system. Different distributions often come with a ready-to-go 'app store'-like software repository, allowing you to install server apps with ease.

Operating system

In harmony with my other cloud services, I often choose Debian GNU/Linux. It is an operating system that is free from commercial pressure, prioritising freedom over business interests. Because of this, it is an excellent and stable basis for any server endeavour.

CardDAV/CalDAV server implementations

On the server operating system you'll need to install server software that implements the CardDAV/CalDAV standards. You should check out the different servers yourself: CardDAV servers and CalDAV servers.

After analysing the different CardDAV/CalDAV server options, I distilled the following three options:

Apple Calendar-Server: As the original CardDAV/CalDAV specification was written by Apple, they developed a complete server and made it open source. Although this sounds great, the development of Calendar Server is stopped (in lieu of Apple iCloud). There is a "Notice of Archival" on the Calendar Server github page. It still works, but its future is uncertain.

ownCloud: A popular 'do it all' solution that implements CardDAV/CalDAV is ownCloud. It's aptly named, as it allows you to 'own your entire cloud'. Its main downside is that it tries to do everything, including email and file sharing - maybe too much, depending on your needs.

Radicale server: Designed as a small but powerful free and open source CardDAV/CalDAV server, Radicale does just that: calendar and addressbook sharing. Its development is alive, propelled by the French company Kozea that does a lot of work for public healthcare. In my opinion, this CardDAV/CalDAV server is both lean and healthy, making it an excellent choice.

Install Radicale on Debian/GNU Linux

Installing Radicale on Debian is as easy as 'apt-get install radicale'. You should check out the detailed installation instructions on the Debian Wiki: install radicale on debian.

The basic Radicale installation works well with simple usernames and password (from a file on the server). But, being free and open source software, there are options to integrate Radicale with different forms of authentication and security:

authenticating Radicale usernames and passwords against an IMAP server: If you already manage a mail server, you might want to take advantage of its existing username and password management. You can 'piggyback' the CardDAV/CalDAV user management on top of you existing infrastructure through authentication plugins. There are (good) working plugins for using Radicale with IMAP, available with source code.

running Radicale behind a NGINX proxy: You can harden Radicale, from a cyber security perspective, by running it behind a battle proof NGINX reverse proxy server. You'll get all the advantages NGINX offers, including automated TLS/SSL certificates through Let's Encrypt. Instructions to get you started with this are available in the Radicale Documentation for both Apache as NGINX.

Connecting to your CardDAV/CalDAV server: clients

Once you have your CardDAV/CalDAV server running, you need to configure your devices to connect to it. You can do this in different ways, depending on the type of device you use.

Apple macOS: Setting up your Mac to connect to a CardDAV/CalDAV server is easy. Just add it as an account to macOS, see instructions for CardDAV and CalDAV

Apple iOS/iPadOS: Just like the mac, setting up your iPhone or iPad to connect to a CardDAV/CalDAV server is easy. Just add it as an account, under "Settings". Instructions for CardDAV and CalDAV.

Android: For best integration you should use a synchronisation app that connects the Android calendar and contact databases to the CardDAV/CalDAV server. I have good experiences with CardDAV-Sync and CalDAV-Sync

Windows: Although Microsoft has built-in support for CardDAV/CalDAV in Windows 10, it does not allow you to configure it use any other service than iCloud, unless you perform funky hacks. If you use Outlook you can use an open source Caldavsynchronizer.org plugin to connect to your server.

GNU/Linux: If you're using free software on PC you have plenty of options to configure it to connect to the CardDAV/CalDAV server. If you run GNOME as desktop environment you should check out these instructions.

Conclusion

Convenience is a beautiful thing, until it stings you in the back. The "big cloud services" operated by the American tech giants provide easy (and free) ways to synchronise your personal agenda and address books. If you like to take control over your own personal (or work) data, you should consider setting up your own addressbook and calendar server.

It's not really that hard to do it yourself, and if you need help you can always ask someone to assist you. Once you have it up and running, you'll have more control of your data, better privacy and freedom in choosing your devices and apps. Not bad, right?