Howto setup your personal CalDAV/CardDAV server
Do you like to backup or share your calendar and contacts, but you don't want to rely on proprietary companies and solutions built into your phones? You don't like to share such information? You don't want to be restricted to specific number of calendars, events or contacts? You want to be sure your provider won't close the service and lock you out from your data? Then it is time to self-host your own CalDAV and CardDAV service!
Articles of this series
2021-08-04 Howto setup your personal XMPP server
2021-07-01 Howto setup your personal CalDAV/CardDAV server
2021-02-12 Howto proxy your self-hosted services using web server
2021-01-08 Howto setup and secure web server
2020-12-30 Services you can selfhost on you personal Linux VPS
2020-09-22 Howto secure your personal Linux VPS
2020-08-21 Howto setup your personal Linux VPS
2020-07-20 Why setup your personal Linux VPS
CalDAV & CardDAV
CalDAV and CardDAV are protocols specified in RFC4791, RFC6638 and RFC6352. As years passed, more RFCs came to fill the gaps. They are free to be implemented and provide ability to synchronize calendars, events, contacts and tasks between server and multiple clients (devices). They are supported by both Android and iOS devices and there is plenty of software for every major OSes (BSDs, Linux, Windows, MacOS) that can handle these protocols.
Choosing the implementations
I personally use Radicale on server, Vdirsyncer with khal and khard on desktop and DAVx5 on Android. Check this Wikipedia list for plethora of other options.
Radicale - because it is memory efficient, python based, maintained, BSD&Linux friendly, simple and well documented. It implements only subset of all possible specs and RFCs that bundled up throughout the time, but for me, it always delivered and always worked with any client I used.
Installation instructions are straightforward, just use default package manager, or directly python installer 'pip'
python3 -m pip install --upgrade radicale
Official documentation is great. It takes you step by step through all standard scenarios like running as a Systemd service, running behind reverse proxy, or even as a WSGI service, which is my case.
Radicale instance on my OpenBSD machine, which is syncing 8 clients through both CalDAV and CardDAV, with several hundred contacts and several thousand calendar events, doesn't take more than 30MB RAM. It runs behind the web server, so I don't need to care about managing custom high ports on my firewall, or SSL certificates. Check more benefits [in my older article](https://mizik.eu/blog/how-to-proxy-your-self-hosted-services-using-web-server/) regarding this topic. During several years I use it in "production" I never had to restart or maintain it in any way. But I need to say, my scenario is very simple. One address book and one calendar for every person in my family plus one shared calendar. Give it a try and let me know if it works for you too :)