How to Deploy FreePBX 17 on Debian

FreePBX is an open-source graphical user interface (GUI) that manages Asterisk, a voice over IP (VoIP) server. This guide will walk you through the steps to deploy FreePBX 17 on a Debian system.

Prerequisites

  • A fresh Debian installation
  • Root or sudo access
  • Internet connection

Step 1: Update the System

First, ensure your system is up to date:

sudo apt update && sudo apt upgrade -y

Step 2: Install Dependencies

Install necessary packages and dependencies:

sudo apt install -y wget curl git gnupg2 ca-certificates lsb-release apt-transport-https

Step 3: Install MariaDB

FreePBX requires a database. Install MariaDB:

sudo apt install -y mariadb-server mariadb-client

Secure the MariaDB installation:

sudo mysql_secure_installation

Follow the prompts to set the root password and secure the installation.

Step 4: Install Apache and PHP

Install Apache web server and PHP along with required modules:

sudo apt install -y apache2 libapache2-mod-php php php-cli php-mysql php-xml php-mbstring php-json php-curl php-pear

Step 5: Install Asterisk

Download and install Asterisk:

cd /usr/src
sudo wget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-17-current.tar.gz
sudo tar zxvf asterisk-17-current.tar.gz
cd asterisk-17.*/
sudo contrib/scripts/install_prereq install
sudo ./configure
sudo make menuselect
sudo make
sudo make install
sudo make samples
sudo make config
sudo ldconfig
    

Step 6: Install FreePBX

Download and install FreePBX:

cd /usr/src
sudo wget http://mirror.freepbx.org/modules/packages/freepbx/freepbx-17.0-latest.tgz
sudo tar zxvf freepbx-17.0-latest.tgz
cd freepbx
sudo ./start_asterisk start
sudo ./install -n
    

Step 7: Configure Apache

Set up Apache for FreePBX:

sudo a2enmod rewrite
sudo systemctl restart apache2
    

Create a new Apache configuration for FreePBX:

sudo nano /etc/apache2/sites-available/freepbx.conf
    

Add the following content to freepbx.conf:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/html
    <Directory /var/www/html/>
        Options FollowSymLinks
        AllowOverride All
    </Directory>
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
    

Enable the new site and reload Apache:

sudo a2ensite freepbx.conf
sudo systemctl reload apache2
    

Step 8: Finalize Installation

Set ownership permissions and finalize the installation:

sudo chown -R asterisk:asterisk /var/www/html
sudo fwconsole chown
sudo fwconsole restart
    

Accessing FreePBX

Open a web browser and navigate to your server’s IP address. You should see the FreePBX administration interface.

Congratulations! You have successfully installed FreePBX 17 on Debian.

Other Recent Posts