How to install Flarum

Flarum is a free open source PHP forum platform.

System requirements:
  • 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:
Mbstring
pdo_mysql
openssl
json
gd
dom
fileinfo



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 (make sure to enable SSH access first). 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

cd public_html - changes the working directory to public_html
mkdir flarum - creates a new folder inside the public_html folder
cd flarum - 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. After this, the installation link can be accessed via the yourdomain.tld/flarum/public link, since Flarum includes a public directory which contains only publicly-accessible files.

NOTE: Also, it is possible to create the installation on the yourdomain.tld/flarum link. For this, create the .htaccess file in the /public_html/flarum/ folder and add the following rule there:

RewriteEngine on
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]

Now, you can use the yourdomain.tld/flarum URL in the web browser.

5. Next, access the installation in a browser (e.g. yourdomain.tld/flarum or yourdomain.tld/flarum/public). 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:







That's it!




Need any help? Contact our HelpDesk


Updated
Viewed
24631 times

Need help? We're always here for you.

notmyip