mrripon @Kulga has made an automated script that installs Flarum for you, we found it useful on our community. Use the following steps:
wget 'https://raw.githubusercontent.com/kulga/flarummanagement/master/flarum_management' -O flarum_management
chmod u+x flarum_management
./flarum_management -f sub.yourdomain.com