Flarum is a free open source PHP forum platform.
- A web server: Apache (with mod_rewrite) or Nginx
- PHP 5.6+ with the following extensions: mbstring, pdo_mysql, openssl, json, gd, dom, fileinfo
- MySQL 5.5+
- SSH (command-line) access
Also, Flarum requires Composer. Composer is already pre-installed on all our shared hosting servers now, so there is no need to install it manually.
To install Flarum:
1. Enable required PHP extensions.
OpenSSL - already enabled on all our shared servers.
To enable other extensions go to cPanel > Software section > Select PHP Version menu. Make sure that the following extensions are selected and click Save:
2. Create a database, database user and password for Flarum installation using MySQL database menu of cPanel. You can find more details on how to create and manage databases here. We will use nctests_flarum database and user as an example.
3. Connect to your account via SSH (contact our Support to enable SSH access). To access the hosting account via SSH you need to download and install an SSH client, for example PuTTY, and connect to the server using:
username - your cPanel username
password - your cPanel password
servername- name of the server where your hosting account is located (you can find it using this tutorial)
port - 21098
Once you are logged in to your hosting account, you can navigate to the necessary folder using 'cd' command. In this article we will create and install Flarum to a subfolder called 'flarum', which is located in the public_html folder.
In our case, the command will look like this:
cd public_html && mkdir flarum && cd flarum
cdpublic_html changes the working directory to public_html
mkdir flarum created a new folder inside a public_html folder
cdflarum changes the working directory to the flarum folder, where we will have our installation.
Once inside the flarum folder, run the following command to install Flarum:
composer create-project flarum/flarum . --stability=beta
You will see the process of the installation and updating dependencies:
It may take several minutes for the process to be completed.
4. Next, access the installation in a browser (e.g. yourdomain.tld/flarum). You should see the Flarum installation page.
Enter the database details you created in step 2 and admin details you want to use:
It may take a few minutes for the installation to be over. Once everything is done you should be redirected to the main page of the website: