Running your own CalDAV server

Posted at 05 Jun 2014
Tags: caldav, server, privacy

I thought that the first anniversary of the Snowden disclosures is a good time for a small report on how to run your own CalDAV server for calendars and contacts sharing. A few weeks ago I moved away from Google calendar in order to reclaim my personal information and since then I researched and tried out different CalDAV server software. Here’s a small write-up of my results.


tl;dr – it’s worth installing Baïkal as a CalDAV / CardDAV service on your own server.

A CalDAV/CardDAV server lets you synchronize your appointments, notes and contacts across several devices, for example your laptop and smartphone. It is based on the WebDAV protocol, which allows modifying information on a server and keeping track of these modifications.

I searched the web for open-source solutions that run on a standard Linux system. It should be lightweight because I didn’t want to install bloated “groupware” stuff on my server that eats up all RAM. That’s why I dropped OwnCloud, Kolab and many others. I wanted an active community and up-to-date releases, that’s why DAViCal and Darwin Calendar Server were not an option neither.

In the end, I tried out Radicale at first, because it is really lightweight as it only supports pure CalDAV/CardDAV access without fancy web-interfaces or the like. It also only requires Python and WSGI to run it within an Apache webserver environment. It worked well at first, but then I noticed that often appointments were missing in my calendar client – which is of course extremely annoying. The author of Calypso (a – unfortunately still premature – Radicale fork) had the same issue and found out the reason:

[…] It stores the whole calendar in a single file, re-parsing it whenever a request is made, so a calendar with just hundreds of entries caused the server to slow down enough that evolution would time-out when talking to it. […]

I then switched over to Baïkal, which offers some more features, is written in PHP, and uses SQLite or MySQL as database backend. It furthermore only requires the PHP extension for cURL. It comes along with a web interface for administration purposes, which can be luckily disabled after initial setup.

The most important thing is to allow access to the CalDAV service only via HTTPS. If no “trusted” SSL certificate is available, generating a self-signed certificate is perfectly okay for private purposes. It might require to also install this certificate on some client devices, though, as for example with Firefox OS.

What might be vexing at the beginning is that Baïkal does not support importing calendar data, e.g. via .ics files. One has to do this manually via the client program as described in this github issue discussion. Despite from that, Baïkal runs pretty well and stable so far and I don’t miss any comfort as compared to Google calendar – besides the “comfort” of potentially being spied at.

If you spotted a mistake or want to comment on this post, please contact me: post(-at-)mkonrad(-dot-)net.
← “The Internet is full
View all posts
git lol(a) -- useful git alias for a pretty commit timeline on the console” →