How to Install FreePBX 17 on Debian 12 with Asterisk 21
READ FIRST
Manual installation of FreePBX is considered an EXPERTS ONLY exercise. This method of installation is enough to get CORE functionality of FreePBX. Some 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.
This manual-install method builds a FreePBX system with the following specifications:
FreePBX 17
Asterisk 21
PHP 8.2
Maria DB (v10.11)
Node JS (v18.16)
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 12 installation. All necessary packages will be installed through the following commands.
Prerequisite recommended OS update
Update the OS to current and install the required packages
apt-get update
apt-get upgrade
apt -y install build-essential git curl wget libnewt-dev libssl-dev libncurses5-dev subversion libsqlite3-dev libjansson-dev libxml2-dev uuid-dev default-libmysqlclient-dev htop sngrep lame ffmpeg mpg123
apt -y install git vim curl wget libnewt-dev libssl-dev libncurses5-dev subversion libsqlite3-dev build-essential libjansson-dev libxml2-dev uuid-dev expect |
PHP 8.2 Installation
If the host Debian OS do not have PHP 8.2 then installed below required packages.
FreePBX 17 supports PHP 8.2 only so if you are running older PHP version or newer PHP version then please remove that version and install the PHP 8.2 version.
Removing PHP version - "apt-get purge phpX.*" where X is the PHP version for example 7 for PHP v7.2 or 8 for PHP 8.1
apt-get install -y build-essential linux-headers-`uname -r` openssh-server apache2 mariadb-server mariadb-client bison flex php8.2 php8.2-curl php8.2-cli php8.2-common php8.2-mysql php8.2-gd php8.2-mbstring php8.2-intl php8.2-xml php-pear curl sox libncurses5-dev libssl-dev mpg123 libxml2-dev libnewt-dev sqlite3 libsqlite3-dev pkg-config automake libtool autoconf git unixodbc-dev uuid uuid-dev libasound2-dev libogg-dev libvorbis-dev libicu-dev libcurl4-openssl-dev odbc-mariadb libical-dev libneon27-dev libsrtp2-dev libspandsp-dev sudo subversion libtool-bin python-dev-is-python3 unixodbc vim wget libjansson-dev software-properties-common nodejs npm ipset iptables fail2ban php-soap |
Asterisk Installation
Download asterisk source and compilation
cd /usr/src
wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-21-current.tar.gz
tar xvf asterisk-21-current.tar.gz
cd asterisk-21*/
contrib/scripts/get_mp3_source.sh
contrib/scripts/install_prereq install
./configure --libdir=/usr/lib64 --with-pjproject-bundled --with-jansson-bundled
make menuselect
make
make install
make samples
make config
ldconfig |
Create asterisk user and give permission
Configure Apache web server
Configure ODBC
Install FreePBX
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.
Set up systemd (startup script)
Troubleshooting Tips
If the Network/subnet is different then you need to run the below command to get the GUI access.
# ufw allow proto tcp from any to any port 80,443