Prerequisites
Before you install Baikal, keep the following resources ready:
A machine accessible from outside your home network: this can either be a home server that has its ports open or a dedicated VPS that you are currently renting.A domain name that points to your machine: I will be using the name “yetanotherbaikalserver.xyz” for this tutorial.Root access to your machine: this is to install the utilities and programs that are needed for Baikal to work.
Considering these factors, this tutorial only focuses on installing Baikal on a Debian 11 VPS from DigitalOcean.
Installing Baikal’s Dependencies
Begin by creating a separate user account on your machine to make sure that any mistakes and errors during the process will not affect the entire system: Once done, switch to this new user by running su baikal. From here, you can now install Baikal’s dependencies by running the following command:
Configuring the Server’s Firewall
Configuring your machine’s firewall is required to ensure that your server will block any unnecessary requests to it. To set this up, run the following set of commands: The above commands will just open the port 80 and 443 for external connection and close all the network ports in the machine.
Setting Up Nginx for Baikal
While it is possible to use a variety of webservers for Baikal, this section focuses on setting it up alongside Nginx. To start, create a site configuration file under “/etc/nginx/sites-available”: From there, write a server{} block inside this new configuration file. The following is a basic setup that should work out of the box: The way it works is that Nginx is listening for any connections at port 80 for the hostname “yetanotherbaikalserver.xyz.” Once a client connects, the web server redirects this connection to Baikal’s root directory, where Nginx then opens a UNIX socket for all .php files, allowing them to run as a web application.
Obtaining and Unpacking Baikal
To download and install Baikal on your machine, first create the root web directory and switch to it: Then, use wget to pull Baikal’s latest binary release: From here, install the web application by unpacking its binary archive using the following command: Lastly, make sure that Nginx can read and write to the root Baikal directory by running chown on the “baikal” folder:
Restarting Nginx and Installing SSL
You can now enable your Nginx configuration file by creating a symbolic link to “/etc/nginx/sites-enabled.” After that, you also need to reload Nginx to apply the new settings. Run the following commands to execute these two actions: Now, enable SSL for your server by either using Let’s Encrypt or installing one manually through OpenSSL. For this instance, I’m using the certbot utility from Let’s Encrypt. To install a Let’s Encrypt certificate, run the following command:
Finalizing the Baikal Setup
To wrap up the setup process, open your web browser and access the website through your domain name. In my case, I’m going to “yetanotherbaikalserver.xyz.” Once there, Baikal will redirect you to its admin installation page, where it will ask you for a number of server-specific options that you need to set for your instance. To begin with, enter the timezone of your machine. If you are using a VPS, provide the timezone for that VPS. Since my VPS is in Singapore, I’m selecting “Asia/Singapore.” Next, select the features that you want for your instance. Check both CalDAV and CardDAV if you want to enable both calendar and address book support for your server. You also have the option to provide an email address for your instance. In order for this to work, your server must be able to send SMTP messages over TLS. I’m leaving this blank to disable email sending. Next, select the authentication format for your instance. In most cases, the Digest format should work out of the box. You also need to provide a password for the administrator account. After that, you can press “Save changes.” Lastly, Baikal will ask you for the database settings of your instance. For the most part, you do not need to modify any settings on this page. Press “Save Changes” again to finish the installation.
Adding the First Baikal User
With Baikal running, you can now create your first user by going back to the administrator panel and selecting “Users and resources.” On the next screen, select “Add user” to bring up a simple creation page where you can enter the details for the new user. For example, I can create a new user for myself.
Linking Thunderbird With Baikal
Now that you have a Baikal user account, you can link it to any scheduling program that supports CalDAV and CardDAV, such as Thunderbird. To use Baikal with Thunderbird, click the “Calendar” option on the mail client’s Home page. This will bring up a small window where the client will ask you for the location of your calendar file. Select “On the Network” and click “Next” to proceed. When Thunderbird asks you for the username of your Baikal account as well as its URL, fill in those details and press “Find Calendars.” For the URL, provide the address of your server followed by “/dav.php.” Once the client gets all the calendar files for your Baikal account, it will list them and ask you for their “Calendar Type.” Select “CalDAV” and click “Subscribe.” Your Baikal server is now ready for use. Image credit: Unsplash and Sabre All alterations and screenshots by Ramces Red Once you know which program is causing the error, run apt remove or systemctl disable to stop the program. For example, Apache is a common program that takes the same ports as Nginx. You can disable this in Debian by running the following command: sudo systemctl disable apache2.