How to Install Dotclear on Debian 13 (Trixie) with Apache and MariaDB
Set up a Dotclear 2.40 blog on Debian 13 (Trixie) with Apache, MariaDB and PHP 8.4, secure it with HTTPS and tighten file permissions afterwards.
By the end of this guide you will have a Dotclear 2.40 blog running on Debian 13 (Trixie) with Apache, MariaDB and PHP, served under your own domain with HTTPS. The same steps work on Debian 12 (Bookworm); the only difference is the PHP version the distribution ships. Debian 9 (Stretch) is long out of support and its PHP 7.0 cannot run current Dotclear.
Dotclear is an open-source blogging engine released under the AGPL v3. The current release needs PHP 8.2 to 8.5 with the mbstring, simplexml, intl and GD modules, plus MySQL/MariaDB, PostgreSQL or SQLite. Debian 13 ships PHP 8.4 and Debian 12 ships PHP 8.2, so both meet the requirement with stock packages.
Requirements
- A Debian 13 or Debian 12 server and a user with
sudorights. - A domain name pointing at the server. The examples use
example.com. - Ports 80 and 443 open in your firewall.
Step 1: Install Apache, MariaDB and PHP
Install the web server, the database server and the PHP modules Dotclear asks for. The php-xml package provides SimpleXML:
sudo apt update
sudo apt install apache2 mariadb-server libapache2-mod-php php php-mysql php-mbstring php-xml php-intl php-gd php-curl unzip wgetConfirm the PHP version and that the modules are loaded:
php -v
php -m | grep -E 'mbstring|SimpleXML|intl|gd|mysqli'Step 2: Create the database
On Debian, the MariaDB root account authenticates through the system socket, so open the client with sudo:
sudo mariadbCreate a database and a user that can only reach it. Replace the password with a long random one:
CREATE DATABASE dotclear CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
CREATE USER 'dotclearuser'@'localhost' IDENTIFIED BY 'replace-with-a-strong-password';
GRANT ALL PRIVILEGES ON dotclear.* TO 'dotclearuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;Step 3: Download Dotclear
Dotclear offers two install methods: a one-file loader script that fetches the archive through the browser, and the standard archive. On a server with shell access the archive is simpler and does not require the whole web root to be writable. Download the latest stable release and unpack it; the archive contains a single dotclear directory:
cd /tmp
wget https://download.dotclear.org/latest.zip -O dotclear.zip
sudo unzip -q dotclear.zip -d /var/www/The installation wizard writes the configuration file inc/config.php, and Dotclear later writes to its cache and media directories, so hand the tree to the Apache user:
sudo chown -R www-data:www-data /var/www/dotclearLeave the default site in /var/www/html alone; Dotclear gets its own virtual host instead of replacing it.
Step 4: Configure the Apache virtual host
Create /etc/apache2/sites-available/dotclear.conf:
<VirtualHost *:80>
ServerName example.com
DocumentRoot /var/www/dotclear
<Directory /var/www/dotclear>
Options FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/dotclear-error.log
CustomLog ${APACHE_LOG_DIR}/dotclear-access.log combined
</VirtualHost>Enable the site and the rewrite module, check the syntax and reload Apache:
sudo a2ensite dotclear
sudo a2enmod rewrite
sudo apache2ctl configtest
sudo systemctl reload apache2Step 5: Enable HTTPS
You are about to send an administrator password through the browser, so get a certificate first. Certbot configures Apache for you:
sudo apt install certbot python3-certbot-apache
sudo certbot --apache -d example.comStep 6: Run the installation wizard
Open https://example.com/admin/install/ in a browser. Dotclear reports that no configuration file exists yet and offers to run the wizard. Follow that link and enter the database details:
| Field | Value |
|---|---|
| Database type | MySQLi (MariaDB uses the MySQL driver) |
| Database host name | localhost |
| Database name | dotclear |
| Database user name | dotclearuser |
| Database password | the password from step 2 |
The table prefix can stay at its default. On the next screen, create the first user, who becomes the administrator of the blog, and choose a strong password. When the wizard finishes it shows the blog address and the address of the administration interface, https://example.com/admin/.
If the wizard says it cannot write the configuration file, the ownership from step 3 is missing; run the chown command again and reload the page.
Step 7: Tighten permissions after installation
Once the blog works, the web server no longer needs to own the program code. Give the tree back to root and keep only the directories Dotclear writes to at runtime (the template cache, the media library and its working data in var) owned by Apache:
sudo chown -R root:root /var/www/dotclear
sudo chown -R www-data:www-data /var/www/dotclear/cache /var/www/dotclear/public /var/www/dotclear/varWith this layout, the built-in updater and the theme and plugin installers in the administration interface cannot write to the code directories. If you want to use them, leave /var/www/dotclear owned by www-data instead and accept the trade-off, or temporarily change ownership back before an update.
Maintenance
Dotclear announces new versions in the administration dashboard. Before every update, back up the database and the files:
sudo mariadb-dump dotclear > dotclear-$(date +%F).sql
sudo tar czf dotclear-files-$(date +%F).tar.gz -C /var/www dotclearKeep the operating system packages current with sudo apt update && sudo apt upgrade; PHP security fixes arrive that way. The project's installation documentation covers further options such as PostgreSQL and SQLite.
Frequently asked questions
What is the dotclear-loader.php script, and should I use it?
It is Dotclear's "one minute install" file: you place it in the web root, open it in a browser, and it downloads and unpacks the latest archive into a dotclear sub-directory before starting the same wizard. It is meant for shared hosting without shell access and needs the web root itself to be writable by PHP. With SSH access, unpacking the archive yourself is cleaner.
Can I use Nginx instead of Apache?
Yes. Dotclear lists Apache, Nginx, lighttpd and Caddy as suitable web servers. With Nginx you install php-fpm instead of libapache2-mod-php and pass .php requests to the FPM socket; the PHP modules and the database setup are identical.
Can Dotclear run without a database server?
Yes, it supports SQLite. Install php-sqlite3, choose SQLite in the wizard and skip step 2. That suits a small personal blog; for several authors or multiple blogs in one installation, MariaDB or PostgreSQL is the better choice.
Can one installation host several blogs?
Yes. Dotclear is multi-blog and multi-user: an administrator can create additional blogs from the administration interface and give users different permissions on each of them.