Most people use some sort of database to store and share among their devices their contacts and calendars. They often don't know about it and let their OS vendor handle the details for them. If you care about privacy and/or power usage, you might want to handle those details yourself. While you might think that it's a lot of work, I'll show you how easy it can be.
Most contacts are stored as vCards and most calendars are stored as iCalendars. Those are usually synced via the respective open protocols CardDAV and CalDAV protocols. What this means is that you're most likely already using clients that are compatible with servers that you could host yourself to handle your contacts and scheduling data.
The easiest way to get a CalDAV/CardDAV server running that I know of is to use
Radicale, which is available in most software
repositories. Paste the following in /etc/radicale/config
and
you're already almost done:
[server] hosts = localhost:5232 [auth] type = htpasswd htpasswd_filename = /etc/radicale/usersNote that I'm only opening a port on
localhost
so that nginx can
handle the HTTPS stuff. You could open your Radicale instance to the whole world
directly if you didn't care about that.
Note that this is very bare bones, you might want to read the documentation to
tweak your instance, especially with regards to authentication.
This config uses a users
file to handle authentication (Radicale
lets anyone in by default), so let's add a user (you might need to apt
install apache2-utils
if htpasswd
isn't available on your
system): htpasswd /etc/radicale/users your_username
. Type your
password in and you're done.
On your desktop, you can either use a calendars/contacts program that speaks CalDav/CardDAV or use a utility that just syncs the data and view/modify it with another program (e.g. I use vdirsyncer to sync my contacts/calendar and respectively khard and khal to view and edit them).
If you're using iOS, you can simply add your account in the settings everything will be available in your contacts/calendars apps.
On Android, you'll need a third-party application like DAVx5 to sync your data and everything will be available in your contacts/calendars apps.
Radicale has some access
control built-in, which makes sharing accounts quite trivial. Just create
new accounts for anyone that you want to share data with and update the
rights
file accordingly. You can have a look at the examples available
in the upstream repo for inspiration and reference.
Now you have your own self-hosted CalDav/CardDAV solution, which you can use to sync your data across many devices and share with whomever you want. This data can easily be put raw in a specific location with a utility like vdirsyncer for example for backups or any other custom purposes, without relying on a third party.