How to Install Flarum on Debian 13 (Trixie)

Flarum is a simple, fast, and free forum software that’s beautifully designed and easy to use. It's built with PHP and uses the Laravel framework, making it modern, lightweight, and extendable — ideal for building a vibrant online community.

Prerequisites

Before starting, make sure your Debian 13 system is up-to-date and you have:

  • A user with sudo privileges
  • A LAMP or LEMP stack (Flarum requires PHP, a web server, and MySQL/MariaDB)
  • PHP 8.1 or higher with required extensions
  • Composer (PHP dependency manager)
  • MariaDB or MySQL server
  • Basic Linux terminal knowledge

Update the System

Updates the package lists and upgrades installed packages to the latest version.

apt update && apt upgrade -y

Install Required Packages

Installs Nginx, MariaDB, PHP, Composer, and all required PHP extensions for Flarum to work.

apt install -y apache2 mariadb-server php php-cli php-curl php-mbstring php-mysql php-xml php-zip php-gd unzip curl git
apt install -y php8.2-gd

Enable Apache modules:

a2enmod rewrite
systemctl restart apache2

Install Composer

curl -sS https://getcomposer.org/installer | php
mv composer.phar /usr/local/bin/composer
chmod +x /usr/local/bin/composer

Check Composer version,

composer --version

Configure Database

Creates a new database and user with privileges Flarum needs to store forum data.

mysql -u root -p

Inside MySQL prompt:

CREATE DATABASE flarum;
CREATE USER 'flarumuser'@'localhost' IDENTIFIED BY 'strongpassword';
GRANT ALL PRIVILEGES ON flarum.* TO 'flarumuser'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Install Flarum

Downloads and sets up the latest Flarum files in the /var/www/forum directory using Composer.

mkdir -p /var/www/flarum
cd /var/www/flarum

Install Flarum using Composer:

composer create-project flarum/flarum . --stability=beta

Ensures that the web server (Nginx) can read/write necessary files.

chown -R www-data:www-data /var/www/flarum
chmod -R 755 /var/www/flarum

Configure Apache for Flarum

Create a virtual host config:

nano /etc/apache2/sites-available/flarum.conf

Add following content:

Note: Replace your_domain_or_ip with actual Domain Name/IP Address

<VirtualHost *:80>
    ServerName your_domain_or_ip
    DocumentRoot /var/www/flarum/public

    <Directory /var/www/flarum/public>
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/flarum_error.log
    CustomLog ${APACHE_LOG_DIR}/flarum_access.log combined
</VirtualHost>

Enables the new Flarum site and reloads Nginx to apply the changes.

a2ensite flarum.conf
a2dissite 000-default.conf
systemctl reload apache2

Access Flarum Web Installer

Now, visit http://yourdomain.com or your server IP in the browser to complete the installation via Flarum's web interface.

http://<your_server_ip>/

Fill out the Flarum setup form:

  • Forum Title
  • Admin Username/Password
  • Database: flarum, flarumuser, strongpassword

image

image

Conclusion

Flarum is now installed and ready on Debian 13.
You can log in and start configuring your new forum community!


CrownCloud - Get a SSD powered KVM VPS at $4.5/month!
Use the code WELCOME for 10% off!

1 GB RAM / 25 GB SSD / 1 CPU Core / 1 TB Bandwidth per month

Available Locations: LAX | MIA | ATL | FRA | AMS