How to Install FreePBX 16 on Debian 11 with Asterisk 16
READ FIRST
Manual installations of FreePBX is considered an EXPERTS ONLY exercise. This method of installation is enough to get CORE functionality of FreePBX. Non-commercial modules may not function as expected or detailed in the Wiki's. Certain modules and features may require additional software to be installed and configured on the server.
**** COMMERCIAL MODULES CANNOT BE INSTALLED ON THIS OS ****
This manual-install method builds a FreePBX system with the following specifications:
FreePBX 16
Asterisk 16 from the Debian Bullseye package repository
PHP 7.4, standard with Debian Bullseye
64-bit Intel/AMD (x86_64) platform
Step-by-step guide
All commands are to be run as the root user, either by directly logging in as root or by using sudo su - .
Start from a base Debian 11 installation. All necessary packages will be installed through the following commands.
Prerequisite recommended OS update
Update the OS to current.
apt-get updateapt-get upgrade
Install all the necessary packages
apt install -y util-linux apache2 mariadb-server mariadb-client php php-curl php-cli php-pdo php-mysql php-pear php-gd php-mbstring php-intl php-bcmath curl sox mpg123 lame ffmpeg sqlite3 git unixodbc sudo dirmngr postfix asterisk odbc-mariadb php-ldap nodejs npm pkg-config libicu-dev
Prepare Asterisk
systemctl stop asterisksystemctl disable asteriskcd /etc/asteriskmkdir DISTmv * DISTcp DIST/asterisk.conf .sed -i 's/(!)//' asterisk.conftouch modules.conftouch cdr.conf
Configure Apache web server
sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php/7.4/apache2/php.inised -i 's/\(^memory_limit = \).*/\1256M/' /etc/php/7.4/apache2/php.inised -i 's/^\(User\|Group\).*/\1 asterisk/' /etc/apache2/apache2.confsed -i 's/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.confa2enmod rewritesystemctl restart apache2rm /var/www/html/index.html
Configure ODBC
cat <<EOF > /etc/odbcinst.ini[MySQL]Description = ODBC for MySQL (MariaDB)Driver = /usr/lib/x86_64-linux-gnu/odbc/libmaodbc.soFileUsage = 1EOFcat <<EOF > /etc/odbc.ini[MySQL-asteriskcdrdb]Description = MySQL connection to 'asteriskcdrdb' databaseDriver = MySQLServer = localhostDatabase = asteriskcdrdbPort = 3306Socket = /var/run/mysqld/mysqld.sockOption = 3EOF
Install FreePBX
cd /usr/local/srcwget http://mirror.freepbx.org/modules/packages/freepbx/7.4/freepbx-16.0-latest.tgztar zxvf freepbx-16.0-latest.tgzcd /usr/local/src/freepbx/./start_asterisk start./install -n
Get the rest of the modules
Only a very basic system is installed at this point. You will probably want to install all the modules. Alternatively, you can skip this and pick-and-choose the individual modules you want later.
fwconsole ma installall
Note on modules that fail to install
digiumaddoninstaller, firewall, and xmpp will not install. Firewall will not work without sysadmin (a free but commercial module); xmpp will not work without MongoDB. If you want XMPP, install MongoDB from the vendor's repo first.
ucp will install but the UCP node server will not start due to an incompatibility with NodeJS 12.x. A ticket and patch have been submitted to resolve the incompatibility and this note will be removed when ucp has been updated.
Apply the current configuration
fwconsole reload
Set symlinks to the correct sound files
cd /usr/share/asteriskmv sounds sounds-DISTln -s /var/lib/asterisk/sounds sounds
Perform a restart to load all Asterisk modules that had not yet been configured
fwconsole restart
Set up systemd (startup script)
cat <<EOF > /etc/systemd/system/freepbx.service[Unit]Description=FreePBX VoIP ServerAfter=mariadb.service[Service]Type=oneshotRemainAfterExit=yesExecStart=/usr/sbin/fwconsole start -qExecStop=/usr/sbin/fwconsole stop -q[Install]WantedBy=multi-user.targetEOFsystemctl daemon-reloadsystemctl enable freepbx
Asterisk and FreePBX 16 are installed! Go to the web interface at http://YOUR-IP to finish setup.
Questions or support?
Please post your questions or ask for help on the community forums FreePBX Community Forums
Return to Documentation Home | Sangoma Support