Install Flarum on Ubuntu 18.04 on AWS Linux.

Will Install FLARUM on Ubuntu 18.04 on AWS Linux in this POST. The Flarum is a community discussion software, which is simple, fast, and free. Flarum is built with PHP so it’s quick and easy to deploy.

Flarum is carefully designed to be consistent and intuitive across platforms, out-of-the-box. Customise, extend, and integrate Flarum to suit your community. Flarum’s architecture is amazingly flexible, with a powerful Extension API.

You can find the code of Flarum on GitHub. Also, they have an official website for Flarum.

Install FLARUM on Ubuntu 18.04

STEP 1: Add Repository to Install PHP 7.3

sudo add-apt-repository ppa:ondrej/php
Install Flarum on Ubuntu 18.04 on AWS Linux

While adding the repo, it will ask to Press Enter in between. So kindly press enter to proceed.

sudo apt install -y php7.3 php7.3-cli php7.3-fpm php7.3-common php7.3-mbstring php7.3-gd php7.3-xml php7.3-mysql php7.3-curl

The above command will install the PHP version 7.3 on Ubuntu 18.

STEP 2: Install MySQL Database

sudo apt install mysql-server-5.7

So, the above command will install mysql-server 5.7 into the system, then use “mysql_secure_installation” command to configure the privileges of the database and set the root password.

sudo mysql_secure_installation 

The above command will set the root password and will ask for some Privileges, whether to keep the old tables or not just type “Y” and it will set the root password. Find any difficulty with the above command follows the link.

So now let’s connect to MySQL to create a database, username and password.

sudo mysql -uroot -ppassword
>CREATE DATABASE DB_Name;
>GRANT ALL ON DB_Name.* TO 'UserName' IDENTIFIED BY 'Password';

>quit

STEP 3: Install and Configure Nginx for Flarum on Ubuntu 18

So, now let’s configure and install Nginx.

sudo apt install -y nginx
sudo vim /etc/nginx/sites-available/flarum.conf

So, now we have created a file named as “flarum.conf” and configured as the need of flarum.

server {

listen [::]:80;
listen 80;

server_name 192.168.0.103 www.domain.com;
root /var/www/flarum/public;

index index.php;

location / {
try_files $uri $uri/ /index.php?$query_string;
}

location ~* \.php$ {
fastcgi_pass unix:/run/php/php7.3-fpm.sock;
include fastcgi_params;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
}

}

Now, let’s create the soft link for the “flarum.conf” file into the sites-enabled folder which is in Nginx.

sudo ln -s /etc/nginx/sites-available/flarum.conf /etc/nginx/sites-enabled/

After we created a soft link, you can check the configuration has been done is proper or not, so use “nginx -t” command

sudo nginx -t

OUTPUT: nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

So we have configured the nginx successfully, and now reload the nginx by using “systemctl” command.

sudo systemctl reload nginx

php -r "copy('https://getcomposer.org/installer', 'composer-setup.php');"

The above command will download the composer-setup.php file and we have run the “composer-setup.php” file to get the “composer.phar” file.

php composer-setup.php
sudo mv composer.phar /usr/local/bin/compose
composer --version

OUTPUT: Composer version 2.1.3 2021-06-09 16:31:20

So, we have installed composer successfully, now create a flarum directory on /var/www/ and fetch the code for flarum via composer

sudo mkdir -p /var/www/flarum
cd /var/www/flarum
sudo composer create-project flarum/flarum . --stability=beta
Install Flarum on Ubuntu 18.04 on AWS Linux

So we have created the project for flarum, now just change the permission of the “flarum” directory and try the URL into the browser

sudo chown -R www-data:www-data /var/www/flarum
Install Flarum on Ubuntu 18.04 on AWS Linux
Install Flarum Page

Just fill the details like Title, database, username and password then click on “Install Flarum” .

Install Flarum on Ubuntu 18.04 on AWS Linux

Then login with the Username and password that we have put at the time of Install Flarum, and you will get the below page.

So, finally we have installed flarum on Ubuntu 18.04, if you have to Install Flarum on CentOS 7 then follow the link.

Give your valuable time