[Tutorial] How To Install Flarum On CyberPanel

  1. Create Website on Cyber Panel, my suggestion on sub domain (subdomain.domain.tld)

  2. SSH Login to server and check update
    sudo apt update && sudo apt upgrade

  3. Install composer
    sudo curl -s https://getcomposer.org/installer | php

  4. Move composer.phar to the /usr/local/bin/ directory.
    sudo mv composer.phar /usr/local/bin/composer

  5. Verify Composer Installation by checking its version.
    composer -V
    Composer version 2.3.7 2022-06-06 16:43:28

  6. Change sudo user to root
    sudo su -

  7. Change to subdomain.domain.tld directory
    cd /home/subdomain.domain.tld/public_html

  8. Remove all files on the directory
    rm *

  9. Install Flarum
    composer create-project flarum/flarum . --stability=beta
    Continue as root/super user [yes]?

  10. Change owner and group for all files and directory

    * = all files
    .[^.]* = for all hidden files
  11. Create database for Flarum on Cyber Panel

  12. Go to subdomain.domain.tld/public and fill the setup form.

How to remove /public from the domain?

  1. Open public_html/config.php and find
    'url' => 'https://subdomain.domain.tld/public',
    Change to
    'url' => 'https://subdomain.domain.tld',

  2. Goto Cyber Panel manage website find Rewrite Rules and paste this and save.

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

Flarum Website

Thank you

1 Like

Thanks for your tutorial.

I’m getting a 403 (ERR_TOO_MANY_REDIRECTS) error when trying to access the website and I’m unable to complete the installation.

In step 10 I used this? Is this correct?
chown -R www-data:www-data * && chown -R www-data:www-data .[^.]*

Sorry for the late reply.

Did you follow the How to remove /public from the domain? Before the installation is complete?

Not www-data. Normally Cyberpanel will create user base on domain name, eg: domain45645. See your logs folder to find out your USERNAME:GROUPNAME.

1 Like

You can also install Composer as root, and then SU to the owner of the domain and continue the rest of the installation that way.

1 Like

Using Fix Permissions options in File Manager menu also worked perfectly.