Baikal on Debian 11 | mysql + nginx

Install mysql.

Log into mysql as root.

CREATE USER 'baikal'@'localhost' IDENTIFIED BY 'password';
GRANT PRIVILEGE ON *.* TO 'baikal'@'localhost';

Log out. Log in as baikal into mysql.


Then do

apt-get install wget nginx certbot python3-certbot-nginx php php-fpm php-mysql php-xmlwriter php-dom php-mbstring

Configure letsencrypt (certbot) BEFORE you run the baikal configuration.

certbot --nginx -d cal.yourdomain.tld

Get the nginx conf file from

Set server_name.

Set 80 to 443 redirection.

Set the ssl stuff.


fastcgi_pass   unix:/var/run/php-fpm/php-fpm.sock;


fastcgi_pass   unix:/var/run/php/php-fpm.sock;

Finally your nginx config should look similar to this:

server {
  server_name  cal.yourdomain.tld;

  root  /var/www/baikal/html;
  index index.php;

  rewrite ^/.well-known/caldav /dav.php redirect;
  rewrite ^/.well-known/carddav /dav.php redirect;

  charset utf-8;

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

    #listen [::]:443 ssl ipv6only=on; # managed by Certbot
    listen 443 ssl; # managed by Certbot
    ssl_certificate /etc/letsencrypt/live/cal.yourdomain.tld/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/cal.yourdomain.tld/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot

    location ~ ^(.+\.php)(.*)$ {
    try_files $fastcgi_script_name =404;
    include        /etc/nginx/fastcgi_params;
    fastcgi_split_path_info  ^(.+\.php)(.*)$;
    fastcgi_pass   unix:/var/run/php/php-fpm.sock;
    fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
    fastcgi_param  PATH_INFO        $fastcgi_path_info;

server {
    listen 80;

    server_name cal.yourdomain.tld;

    return 302 https://$host$request_uri;

Get baikal as a zip, extract it and put the baikal folder into /var/www

Do chown -R www-data:www-data to all that stuff.

Enable mysql and nginx and reboot.

Go to https://cal.yourdomain.tld to start the configuration. Run the config process only on https, or you will run into minor issues like missing icons etc.

IMPORTANT FOR iOS-iPhone-niks:

Don’t add the calendar in the calendar app, this will fail. Go to settings >> mail >> accounts >> add_account. Add cal’s URL WITHOUT leading https://.


Leave a Reply

Please log in using one of these methods to post your comment: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.