These are my packages for FreePBX on CentOS 8.

Please read carefully the README file. Really, you should give it attention.
If, after having read it, you still want to try this, then go on.

The environment is a normal CentOS 8 Stream server. Powertools and Epel repositories need to be enabled.

I run it with SELinux enabled. SELinux in general does (in my opinion) make a Linux environment much uglier then it used to be, but it works. 

Dependencies needed: 

A web server. Normally it will be Apache, but Lighttpd and Nginx (but I don't use it) can be used too. In general, you'll have to deal with the requirement of running FreePBX under the asterisk user and group, which indeed is the first motivation which lead me to making all of this.
If you choose Apache, you can use php-fpm or mod_php to handle php files. I wrote two brief guides included here, APACHE*. Take the one you prefer, and adapt it to your personal taste. In my case, I use mpm-itk to handle the asterisk user thing. I personally use Apache with mod_php now.
If you go for Lighttpd, you can start with the brief guide included here. I make a separate lighttpd instance called lightfreepbx, which runs with the asterisk user.
If you choos Nginx, there is plenty of examples around the net.
Make your choice, and go on.

We need php, at least 7.4. So enable it, or via dnf module install php:7.4 if you had no php in your new server, or dnf module switch-to php:7.4 if you had installed a different version. Other possibilities are the Remi packages, which enable you to have different php flavours cohexisting on your machine. Again, make the choice that suits you best, and go on. I personally use CentOS php:7.4 now.

Then integrate some packages we'll likely need:
dnf install @php php-pear php-cgi php-common php-curl php-mbstring php-gd php-mysqlnd php-gettext php-bcmath php-zip php-xml  php-json php-process php-snmp

We obviously need a db. dnf module install mariadb, if you don't already have it. Enable and start it.
I personally always run mysql_secure_installation after installing it, give the root user a password and remove test db and anonymous access. Again, the details are up to you.

We need Node. If you don't have it, dnf module install nodejs will install version 10, which seems ok for us.

If you're going to use SELinux, set some bools:
setsebool -P httpd_can_network_connect 1
setsebool -P httpd_enable_homedirs 1

Moreover for SELinux, you'll need to enable a policy module to allow all the mess FreePBX is requiring Apache to do:-)))). I provide an example here as freePBXAsterisk.te. Taking into account this type of topic, I give it in source form: you'll have to review it for your needs, and then compile it into .pp form and apply. Note that a somewhat vast part of it is required for the dashboard, which digs into the system searching for mail, disk, memory, nic statistis, all of which violate some SELinux policies. So the need for a custom policy module.

Permit to the asterisk user to use cron by modding the /etc/pam.d/crond like this:
--- crond.orig  2022-01-23 17:43:31.000000000 +0100
+++ crond       2022-01-23 18:46:15.990315256 +0100
@@ -6,6 +6,7 @@
 # are used for credential setting
 auth       include    system-auth
 account    required   pam_access.so
+account    sufficient pam_localuser.so file=/etc/passwd.asteriskonly
 account    include    system-auth
 session    required   pam_loginuid.so
 session    include    system-auth

And create /etc/passwd.asteriskonly
egrep '^(root|asterisk):' /etc/passwd > /etc/passwd.asteriskonly

Until now, they are all standard things. Now let's go with my packages. If you're reading these notes, I think you already have the Lux repository enabled. If not, enable it.

Install asterisk components:

dnf install asterisk asterisk-ael asterisk-alembic asterisk-alsa asterisk-calendar asterisk-curl asterisk-dahdi asterisk-devel asterisk-fax asterisk-festival asterisk-iax2 asterisk-ldap asterisk-lua asterisk-mgcp asterisk-minivm asterisk-mobile asterisk-mysql asterisk-portaudio asterisk-radius asterisk-sip asterisk-skinny asterisk-snmp asterisk-sounds-core-en asterisk-sounds-core-en-alaw asterisk-sounds-core-en-g722 asterisk-sounds-core-en-g729 asterisk-sounds-core-en-gsm asterisk-sounds-core-en-siren14 asterisk-sounds-core-en-siren7 asterisk-sounds-core-en-sln16 asterisk-sounds-core-en-ulaw asterisk-sounds-core-en-wav asterisk-sounds-core-it asterisk-sounds-core-it-alaw asterisk-sounds-core-it-g722 asterisk-sounds-core-it-g729 asterisk-sounds-core-it-gsm asterisk-sounds-core-it-siren14 asterisk-sounds-core-it-siren7 asterisk-sounds-core-it-sln16 asterisk-sounds-core-it-ulaw asterisk-sounds-core-it-wav asterisk-sqlite asterisk-unistim asterisk-voicemail asterisk-pjsip asterisk-voicemail-plain

Install at least the minimum freepbx modules

dnf install freepbx freepbx-pm2

Start asterisk with no configuration provided: systemctl start asterisk

check it is running with systemctl status asterisk

Now let's go, activate freepbx by using the install script (-f is needed because of package constraints: we ship default freepbx.conf and amportal.conf, and upon finding them, install would think that it's already installed; the carious options given here are just to confirm our defaults, leave tham so at least until you know what you're doing):
/usr/share/freepbx/admin/modules/framework/install --dbuser=root --dbpass=_the_pass_you_gave_it_ --webroot=/usr/share/freepbx  --astvarlibdir=/usr/share/asterisk --astagidir=/usr/share/asterisk/agi-bin --astrundir=/run/asterisk --ampbin=/usr/share/asterisk/bin --ampplayback=/var/cache/asterisk/playback -n -vvv -f

It should greet you with "You have successfully installed FreePBX".

Now, enable the minimum modules:
fwconsole ma install core
fwconsole ma install dashboard
fwconsole ma install sipsettings
fwconsole ma install voicemail
fwconsole ma install pm2
fwconsole reload

Then you should go to the web interface to check if everything is working well.

