If you want to have your calendar- and contact-data synchronized and don't want to give it away to third parties, it is possible with very simple means to synchronize it at home on your own server. The flagship in this direction is OwnCloud, which also provides CalDAV and CardDAV for synchronization. However, I had always had problems with the synchronization, and so I wanted to give Baikal a try.
Baikal is a PHP written, small and robust server to synchronize calendar and contact data using CalDAV and CardDAV.
Baikal stores its data in a SQLite or MySQL database, using a SQLite database is perfectly adequate for your personal use.

Since the Apache web server is a little too powerful for a Raspberry or BeagleBone, I wanted to try Nginx (pronounced Engine X) - a small, slim and very performant web server.

Unfortunately, I've found instructions in the web, that did not work properly. Therefore, I wrote down my working solution.

Install Nginx

apt-get install nginx

Install PHP and SQLite

sudo apt-get install sqlite php5 php5-fpm php5-sqlite

Create SSL-certificate

sudo mkdir /etc/nginx/ssl
cd /etc/nginx/ssl
openssl genrsa -out privkey.pem 2048
openssl req -new -x509 -key privkey.pem -out cacert.pem -days 1095

Create a virtual host for Nginx

nano /etc/nginx/sites-available/ssl

After some trying I found this version of the virtual host working for me. So it can be used as it is - maybe the root path needs to be changed to your Installation.

server {
	listen 443;
	ssl on;
	ssl_certificate /etc/nginx/ssl/cacert.pem;	# path to your cacert.pem
	ssl_certificate_key /etc/nginx/ssl/privkey.pem;	# path to your privkey.pem
	root /var/www/;
	index index.html index.htm index.php;

	server_name localhost;

	location / {
		try_files $uri $uri/ /index.html;

	location ~ ^(.+\.php)(.*) {
		try_files $fastcgi_script_name =404;
		fastcgi_split_path_info ^(.+\.php)(.*)$;

		fastcgi_pass unix:/var/run/php5-fpm.sock;
		fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
		fastcgi_param  PATH_INFO        $fastcgi_path_info;
		fastcgi_index index.php;
		include fastcgi_params;

    	charset utf-8;

	location ~ /(\.ht|Core|Specific) {
		deny all;
		return 404;

Now the virtual host ssl needs to be activated. This goes with a "symbolic link" in the sites-enabled folder to the just created virtual host.

ln -s /etc/nginx/sites-available/ssl /etc/nginx/sites-enabled

Download an install Baikal
Now it is time to install Baikal. To do this, just download and unpack the package in the root folder of the web server.

cd /var/www
wget http://baikal-server.com/get/baikal-flat-0.2.7.zip
unzip baikal-flat-0.2.7.zip
mv baikal-flat/ baikal/
chown -R www-data:www-data baikal/

To turn now Baikal in the installation mode, you have to create the empty file ENABLE_INSTALL in the Specific folder.

touch /var/www/baikal/Specific/ENABLE_INSTALL

Now you can complete the installation of Baikal under https://meine-url.com/baikal/.
Therefore you create a Administrator account, set the time zone and disable the use of MySQL.

Then you can log in using the administrator account and create a user. When you create the user, a calendar and an address book with the name default will be automatically created for the user.

The installation is now complete.
Now you can access the data the under following addresses:

CalDav: https://meine-url.com/baikal/cal.php/calendars/[username]/default/
CardDav: https://meine-url.com/baikal/card.php/addressbooks/[username]/default/

Synchronization with Thunderbird/Lightning
To synchronize Thunderbird / Lightning with the Baikal-Server, see Article Synchronize Baikal with Thunderbird / Lightning

Synchronization with Android-devices
In order to sync with my Android devices I use CalDAV sync Free Beta. Works flawlessly. After installing CalDAV sync Free Beta:

  1. Under Settings / Account Create a new account
  2. Select CalDAV sync adapter
  3. Enter username, password and the above CalDAV address
  4. Then click Test Connection
  5. Again select the newly created CalDAV sync adapter account to enable automatic synchronization

Add comment

Please insert your mail adress. Your mail address will not be displayed.