
Flarum is a free and open-source forum application or discussion platform that is fast and easy to use. This guide explains how to install Flarum on a one-click LAMP application on Ubuntu 20.04 and secure it with a Let's Encrypt SSL using Certbot.
Edit php.ini with Nano.
Press Ctrl + W and search for these settings, then edit the values to match these:
Save and exit the file.
Log in to the MariaDB shell.
Create a database for Flarum. Replace flarum_db with your preferred database name.
Create a new user. Replace flarum_user with your preferred username and flarum_pass with your preferred strong password.
Grant the new user all the privileges to flarum_db.
Flush Privileges.
Exit MariaDB.
Composer is a tool for dependency management in PHP. Composer will be used to install Flarum dependencies since Flarum is written in PHP.
Install Composer.
Move composer.phar to the /usr/local/bin/ directory.
Verify Composer Installation by checking its version.
Create a new Flarum directory inside the Apache web root directory.
Change directory to /var/www/html/flarum
Download the latest version of Flarum. Enter yes when prompted to continue as root/superuser, or you will encounter an error otherwise.
Install all Flarum PHP dependencies. Enter yes when prompted to continue as root/superuser, or you will encounter an error otherwise.
Change the ownership of the Flarum directory /var/www/html/flarum to www-data.
Give proper permission to the Flarum directory /var/www/html/flarum.
Create an Apache virtual host config file for Flarum.
Paste this to your flarum.conf file. Replace your-domain-name.com with your domain name.
Save and exit the file.
Enable the Flarum virtual host.
Enable the Apache rewrite module, also known as mod_rewrite.
Restart the Apache Service.
Enable the Ubuntu Firewall. Enter `y' when prompted to proceed with the operation.
Check the firewall status. Ensure that the ports that you will use (SSH - Port 22, HTTP - Port 80) are allowed.
If you don't see the ports listed above, you need to allow them.
You have finished installing Flarum.
Proceeding with this part of the guide assumes that you have your domain name.
Install Certbot for Apache.
Install Let's Encrypt SSL for your Flarum website. Replace your-domain-name.com with your domain name.
You will be asked to input your email address. You also need to read and Agree to their Terms of Service.
Choose whether you want to redirect HTTP traffic to HTTPS or not. It is recommended to redirect all HTTP traffic to HTTPS.
You should get the same output after the installation is finished.
On your SSH terminal, edit config.php from the Flarum directory.
Find 'url' then change http:// to https://. You need to replace your server's IP Address with your domain name as well. For example:
should be:
Save and exit the file.
Allow HTTPS Port (Port 443) on the firewall.
Test your SSL Configuration on SSL Labs.
You now have successfully installed and secured Flarum on your Vultr server.
For more information about Flarum, Certbot, and Let's Encrypt SSL, please see these resources:
0 Comments
Be the first to comment and share your perspective with the community.