phpMyAdmin is a free, open-source web-based tool used for managing MySQL/MariaDB databases. It allows developers and administrators to manage databases, tables, users, permissions, and execute SQL queries easily via a graphical interface.

On the other hand, Flarum is a simple, lightweight, open-source forum platform built with PHP. It’s designed to be fast, user-friendly, and extensible, making it ideal for building online communities. Flarum provides a modern and responsive user interface with features like notifications, discussions, and user management.

What is Flarum Useful For?

  • Online Communities: Easily create forums for discussions.
  • Extensible: Extend the platform with numerous extensions to add new features.
  • Responsive Design: Built with mobile devices in mind for a smooth user experience.
  • Moderation Tools: Powerful tools for managing users and content moderation.

Prerequisites

  • A server running Ubuntu 24.04.
  • Root or sudo privileges.
  • A registered domain (optional, for SSL setup).

Step 1: Create an Instance on Cloud.shape.host

Step 1.1: Access the Dashboard

  1. Log in to Cloud.shape.host.
  2. Click Create, and select Instances.
Shape.host Resources dashboard with Create > Instance highlighted.

Step 1.2: Choose a Datacenter Location

Select a datacenter closest to your target audience, such as New York, London, or Frankfurt.

Shape.host instance form with the data center location selector highlighted.

Step 1.3: Select a Plan

Choose a plan based on the resource needs of your Flarum installation: Standard, CPU-Optimized, or Memory-Optimized.

Step 1.4: Select an Operating System

Select Ubuntu 24.04 as your OS for installing Flarum.

Shape.host instance form with the operating system image selector highlighted.

Step 1.5: Configure and Launch

  1. Set the Network Type and Authentication Method (SSH key or password).
  2. Click Create Instance.
Shape.host instance form with the Create Instance button highlighted.

Step 1.6: Locate your Instance’s IP

Shape.host Resources dashboard with the server IP address highlighted.

Step 1.7: Access Your Instance

  • SSH (for Linux/macOS):
   ssh root@<your-instance-ip>

Replace <your-instance-ip> with the server’s public IP.

  • PuTTY (for Windows):
    Download PuTTY, enter the public IP, and click Open.

Step 2: Update and Upgrade the System

apt update -y
apt upgrade -y
Terminal showing APT package management commands and output.

Step 3: Install LAMP Stack and Other Dependencies

Install Apache, MariaDB, PHP, and other required dependencies:

apt install apache2 mariadb-server php php-common php-mysql libapache2-mod-php php-gd php-curl php-json php-xmlrpc php-intl php-bcmath php-zip php-apcu php-mbstring php-fileinfo php-xml php-soap php-tokenizer composer git -y
Terminal showing APT package management commands and output.

Step 4: Check Apache, MariaDB, and PHP Status

Ensure that Apache and MariaDB are enabled and running:

systemctl is-enabled apache2
systemctl status apache2

systemctl is-enabled mariadb
systemctl status mariadb
Terminal showing systemd service management commands or output.
Terminal showing systemd service management commands or output.

Verify PHP and Composer versions:

php -v
sudo -u www-data composer -v
Terminal showing php commands or output during Check Apache, MariaDB, and PHP Status.

Step 5: Configure Firewall

Allow access to Apache through the UFW firewall:

ufw allow 'Apache Full'
ufw allow ssh
ufw enable
Terminal showing firewall configuration commands and rules.

Step 6: Configure PHP Settings

Edit the php.ini file to match your environment’s requirements:

nano /etc/php/8.3/apache2/php.ini

Update the following settings:

memory_limit = 512M
upload_max_filesize = 150M
max_execution_time = 600
date.timezone = Europe/Paris

Restart Apache to apply the changes:

systemctl restart apache2
Terminal showing systemd service management commands or output.

Step 7: Secure MariaDB

Run the mariadb-secure-installation command to remove anonymous users, disable remote root login, and secure MariaDB:

mariadb-secure-installation
Terminal showing MariaDB/MySQL database security configuration prompts.
Terminal showing mariadb commands or output during Secure MariaDB.

Step 8: Create a New Database and User

Log in to MariaDB and create a database and user:

mariadb -u root -p

Run the following SQL queries:

CREATE DATABASE flarum;
CREATE USER 'flarum'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON flarum.* TO 'flarum'@'localhost';
FLUSH PRIVILEGES;
SHOW GRANTS FOR 'flarum'@'localhost';
Terminal showing SQL database and user configuration commands.

Now type quit to exit from the MariaDB server.


Step 9: Set Up Directories and Install Flarum

Create the necessary directories and change ownership to www-data:

mkdir -p /var/www/{.cache,.config,flarum}
chown -R www-data:www-data /var/www/{.cache,.config,flarum}
Terminal showing file ownership or permission commands.

Navigate to the Flarum directory and install it using Composer:

cd /var/www/flarum/
sudo -u www-data composer create-project flarum/flarum .
Terminal showing file and directory setup commands.
Terminal showing sudo commands or output during Set Up Directories and Install Flarum.

Verify the files:

ls -ah
Terminal showing composer commands or output during Set Up Directories and Install Flarum.

Step 10: Configure Apache for Flarum

Enable Apache modules:

a2enmod ssl rewrite headers
Terminal showing systemd service management commands or output.

Create a new virtual host file:

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

Insert the following configuration:

<VirtualHost *:80>
 ServerAdmin contact@example.com
 DocumentRoot /var/www/flarum/public
 ServerName example.com

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

 ErrorLog ${APACHE_LOG_DIR}/error.log
 CustomLog ${APACHE_LOG_DIR}/access.log combined

 <Directory /var/www/flarum/public/>
 RewriteEngine on
 RewriteBase /
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteRule ^(.*) index.php [PT,L]
 </Directory>
</VirtualHost>
Terminal showing web server configuration text.

Step 11: Enable the Virtual Host and Restart Apache

Enable the virtual host and verify the Apache configuration:

a2ensite flarum.conf
apachectl configtest
Terminal showing an Apache configuration test.

Restart Apache to apply the changes:

systemctl restart apache2
Terminal showing systemd service management commands or output.

Step 12: Install SSL Certificate Using Certbot

Install Certbot and the Apache plugin:

apt install certbot python3-certbot-apache
Terminal showing APT package management commands and output.

Generate an SSL certificate:

certbot --apache --agree-tos --redirect --hsts --staple-ocsp --email contact@example.com -d example.com
Terminal showing Certbot certificate commands and messages.

Step 13: Access Flarum From Your Browser

Open your browser and go to:

https://example.com/

You should see the Flarum installation wizard. Follow the instructions to set up your forum.

Flarum installer form with database and administrator settings.

Once the installation is complete, you will be shown the Flarum administration dashboard like the following:

Flarum forum home page with an empty discussion list.

Now click on your user icon and select Administration. This will show you details of your Flarum installation.

Flarum administration page showing installed extensions.

You have successfully installed phpMyAdmin and Flarum on Ubuntu 24.04 with Apache, MariaDB, PHP, and Let’s Encrypt SSL. Both phpMyAdmin and Flarum provide powerful and user-friendly interfaces for managing databases and creating online communities.

For enhanced performance and reliability, consider using Shape.Host’s Linux SSD VPS services to ensure your applications run smoothly.