Baikal – own calendar with ToDo list (CalDav) and address book (CardDav)

Using own CalDav and CardDav server can help you with creating private platform to synchronize event and contacts between multiply devices and other services like webmails.

First let us download latest baikal version from  to /var/www/


Next extract it

tar zxvf baikal-regular-0.2.7.tgz

Move files to destination ex. /var/www/

mv baikal-regular /var/www/

Create vhost config file for Apache

# vim /etc/apache2/sites-available/ 
<VirtualHost *:80>
    DocumentRoot /var/www/

    RewriteEngine On
    RewriteRule /.well-known/carddav /card.php [R,L]
    RewriteRule /.well-known/caldav /cal.php [R,L]

    <Directory "/var/www/">
        Options None
        Options +FollowSymlinks
        AllowOverride All

or you could use more advance config file that use SSL (razem z Let’sEncrypt) + php5_fastcgi :

# php5_fastcgi + ssl baikal config file
<Directory /var/www/>
        AllowOverride None
        Require all denied

<VirtualHost *:80>
        Redirect permanent /

<IfModule mod_ssl.c>
        <VirtualHost ip_address:443>
                DocumentRoot /var/www/
                ErrorLog /var/www/
                CustomLog /var/www/ combined

                RewriteEngine On
                RewriteRule /.well-known/carddav /dav.php [R,L]
                RewriteRule /.well-known/caldav /dav.php [R,L]

                SSLEngine on
                SSLCertificateFile      /etc/letsencrypt/live/
                SSLCertificateKeyFile /etc/letsencrypt/live/

                <Directory "/var/www/">
                        Options None
                        Options +FollowSymlinks
                        AllowOverride All

                <FilesMatch ".(cgi|shtml|phtml|php)$">
                                SSLOptions +StdEnvVars
                <Directory /usr/lib/cgi-bin>
                                SSLOptions +StdEnvVars

                BrowserMatch "MSIE [2-6]" 
                                nokeepalive ssl-unclean-shutdown 
                                downgrade-1.0 force-response-1.0
                # MSIE 7 and newer should be able to use keepalive
                BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown

                <IfModule mod_fastcgi.c>
                        AddType application/x-httpd-fastphp5 .php
                        Action application/x-httpd-fastphp5 /php5-fcgi
                        Alias /php5-fcgi /usr/lib/cgi-bin/
                        FastCgiExternalServer /usr/lib/cgi-bin/ -socket /var/run/ -pass-header Authorization

# vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Now we enable required apache modules and restart it:

a2enmod rewrite
service apache2 restart

Let us change files ownership (depending on what user runs Apache default would be ex. www-data):

chown www-data:www-data -R /var/www/

Create file so baikal will enable installation panel:

touch /var/www/

Depending which vhost file we use we enter baikal via web browser

On first page setup everything the way you like, and on the next one you will be able to configure database backend, so you can pick sqlite or mysql/mariadb.


So now we go up and running dav platform for you private data.



Even if you use latest version from page, I would suggest update it to newest one from git page

For example currently the newest on git is 0.4.2 baikal version.

It is recommended to make backup of your database if you started already to use baikal.

Download newest baikal to same directory where you install the 0.2.7 version:


Extract it


Change ownership for extracted baikal and move every file outside excluding  ‘Specific‘ folder.

Enter administration panel ex. and you will see warning like this:

Upgrading Baïkal from version 0.2.7 to version 0.4.2

After login in baikal will update the database and you will be ready to use it once again.


Difference between 0.2.x and 0.4.x is in URL we tend to use card.php and cal.php are now  dav.php, and both still works but are deprecated so eventually they will stop working. I recommended to use dav.php.

Good practice would also be adding DNS record: IN SRV 0 5 443 IN SRV 0 5 443

This way autodiscover function when setting up account on your device will find your proper configuration faster.


Example use:




Thunderbird + Cardbook

Add address book > Remote

Type: CardDav 

Username: user
Password: password

Validate > Next


Android + DavDroid:

Pre-emptive authentication: Off


Leave a Reply

Your email address will not be published. Required fields are marked *