Blogging is a great hobby. At its most basic, it's a form of online diary that you govern without the rules and strictures of microblogging platforms such as Facebook and Twitter.

When it comes to your blog, you are your own writer and editor; you own the story you share with the world. And with a solution like DotClear, you can easily create your blog and host it from your home on a Raspberry Pi. Here's how:

What Is Dotclear and How Is It Different From Other Blogging Platforms?

Dotclear is a free and open source software that bills itself as "blog management made easy"; it predates the popular WordPress platform by one year—initially released in 2002.

The platform is unusual in the sense that a single installation supports multiple separate blogs and multiple users. Plus, it boasts built-in antispam mechanisms, a customizable layout, a fantastic comments system, and a plethora of themes and plug-ins to make your blog look more visually appealing as soon as you deploy it.

Dotclear's open-source license means that as well as downloading, using, and modifying the software, you also have the freedom to redistribute the code and to contribute to the project's future direction.

How to Install Dotclear on Your Raspberry Pi

Before you start, you should follow our guide to preparing your Raspberry Pi as a server. Once you've finished, head over to your registrar's Advanced DNS settings page.

Delete all records and create a new A record. Set the host to "@", value to your public IP address, and the TTL as low as possible.

If you are going to access your Dotclear through a subdomain, for example, blog.improbable.guru, you will instead set the A record to "blog".

namecheap dns showing two A records

With the preliminaries out of the way, log into your Raspberry Pi using Secure Shell (SSH), and make sure that all installed packages are up-to-date:

        sudo apt update
        sudo apt upgrade

Dotclear will require a database and database user in order to complete the installation. You should have already installed MariaDB, so enter it with the following command:

        sudo mariadb

Now, add the following entries one line at a time:

        CREATE DATABASE dotclear;
        CREATE USER dotclear IDENTIFIED BY 'supertopsecretpassword';
        GRANT USAGE ON *.* TO dotclear@localhost IDENTIFIED BY 'supertopsecretpassword';
        GRANT ALL privileges ON dotclear.* TO dotclear@localhost;
        FLUSH PRIVILEGES;
        quit;

Change the directory and use nano to create a new Apache configuration file:

        cd /etc/apache2/sites-available
        sudo nano dotclear.conf

In the new file, set the domain name and the directory where you will store your blog's files:

        <VirtualHost *:80>
            ServerName blog.improbable.guru
            DocumentRoot /var/www/dotclear/
        </VirtualHost>

Save the file, and exit nano with Ctrl + O followed by Ctrl + X.

Enable the new conf file and restart Apache:

        sudo a2ensite dotclear.conf
        sudo service apache2 restart

Create the directory you just specified, then move into it:

        sudo mkdir /var/www/dotclear
    
        cd /var/www/dotclear/
    

Now, download the automatic Dotclear installer:

        sudo wget https://download.dotclear.org/loader/dotclear-loader.php
    

Use the following line of code to recursively change the ownership of your current directory so that Apache can write to it:

        sudo chown -R www-data:www-data .
    

Now, open a browser and navigate to your-domain.tld/dotclear-loader.php. At this point, you will be using a non-secure HTTP connection. Don't worry; you can and will change this later.

You will be greeted by the Dotclear NetInstall wizard, the job of which is to retrieve the latest Dotclear archive and unzip it in your web space.

By default, the destination is your-domain.tld/dotclear, but if you want the blog in the root of your domain or subdomain (you probably do), delete this field. Now click on the "Retrieve and Unzip Dotclear" button.

dotclear netinstall wizard

Fill in the database details. The database hostname is localhost, the database name and database username are both dotclear, and the password is the one you set earlier. You can set the database prefix to whatever suits you. This data will be committed to a configuration file. To view its contents, enter the following:

        cat /var/www/dotclear/inc/config.php
    

On the next screen, you will be prompted to create a user account, and the wizard will ask you for your first name, last name, and email address—you can ignore these if you wish, but you will need to set a username and a password.

Secure Your Dotclear Installation

With account creation out of the way, you need to secure your connection to your Dotclear blog. Yes, the server is physically located in the same building as you, but traffic over HTTP connections is subject to man-in-the-middle (MITM) attacks, snooping by your ISP or third parties. Certbot will fetch and deploy a Let's Encrypt certificate and key and deploy them to your system.

        sudo certbot
    

Enter your email address when requested, and select your blog domain from a list when asked.

Reload your blog's admin page, and you will be redirected to a secure HTTPS connection. It's not magic, but it's close.

Managing Your Dotclear Blog

Your blog's address will be your domain address, and the admin interface is located at your-domain.tld/admin.

You will immediately notice that the dashboard is clear, uncluttered, and easy to use, with the most common activities displayed as large, square icons, adorned with understandable pictograms. These include posts, new post, new page, comments, categories, media manager, blog, appearance, widgets, menus, preferences, and help. Each of these does exactly what you expect them to do.

dotclear dashboard with a variety of buttons

You can configure the themes and manage them through the "Blog appearance" menu located on the left panel—you can add new themes from here using the "Add themes" tab.

As for theme selection, you have hundreds to choose from in styles that will suit any blog. None are paid-for, and you can install any theme with a single click. Once installed, you can edit your theme from within the Dotclear admin interface.

a selection of dotclear themes

As you can see by now, you can have a great-looking blog running on your Raspberry Pi in a matter of minutes.

dotclear demo blog with a single demo post

Using Dotclear to Create a Blog on Your Raspberry Pi Is Quick and Easy!

You can use your blog for any purpose you like. It's a great idea to start an online portfolio, show off your tech skills or demonstrate your writing chops to a wider audience. And if you're unsure where to start, consider writing a serialized novel or even a tech tips blog.

If you're not a huge fan of Dotclear, no worries. You can try out Ghost, which is another open-source blogging tool that you can easily install on your Raspberry Pi.