FreePBX is a web-based open source GUI (graphical user interface) that controls and manages Asterisk (PBX). This tutorial will help you to Install FreePBX 15 on Ubuntu 20.04/18.04/16.04 & Debian 10/9. A pre-requisite for this setup is Asterisk Server. Install Asterisk on Ubuntu 20.04/18.04 / 16.04 / Debian 9 using below guide:

How to Install Asterisk 16 LTS on Ubuntu / Debian

Step 1:  Install MariaDB Database server:

Use below links to install MariaDB on both Ubuntu 18.04 / Ubuntu 16.04 and Debian 9

sudo apt update
sudo apt -y install mariadb-server mariadb-client

Step 2: Installing Node.js 10 LTS

FreePBX has Node.js as a dependency, install it on your system by using our guide below:

Installing Node.js 10 LTS on Ubuntu / Debian

Step 3: Install and configure Apache Web Server

Install apache2 package from apt:

sudo apt -y install apache2

Then change Apache user to asterisk and turn on AllowOverride option :

sudo cp /etc/apache2/apache2.conf /etc/apache2/apache2.conf_orig
sudo sed -i 's/^\(User\|Group\).*/\1 asterisk/' /etc/apache2/apache2.conf
sudo sed -i 's/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.conf

Remove default index.html page

sudo rm -f /var/www/html/index.html

Step 4: Install PHP and required extensions

FreePBX is dependent on PHP, run the following commands to install php and required extensions.

sudo apt -y install wget php php-pear php-cgi php-common php-curl php-mbstring php-gd php-mysql php-gettext php-bcmath php-zip php-xml php-imap php-json php-snmp php-fpm libapache2-mod-php
Change php maximum file upload size:

For Debian 10:

sudo sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php/7.3/apache2/php.ini
sudo sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php/7.3/cli/php.ini

For Debian 9 / Ubuntu 16.04:

sudo sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php/7.0/apache2/php.ini
sudo sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php/7.0/cli/php.ini

For Ubuntu 20.04:

sudo sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php/7.4/apache2/php.ini
sudo sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php/7.4/cli/php.ini

For Ubuntu 18.04:

sudo sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php/7.2/apache2/php.ini
sudo sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php/7.2/cli/php.ini

Step 5: Install FreePBX 15 on Ubuntu 20.04/18.04 / 16.04 / Debian 10/9

Download the latest version of FreePBX 15:

sudo apt -y install wget

Extract the file:

tar xfz freepbx-15.0-latest.tgz
rm -f freepbx-15.0-latest.tgz

Install FreePBX 15 on Ubuntu 20.04/18.04 / 16.04 & Debian 10/9

cd freepbx
sudo ./start_asterisk start
sudo ./install -n

If you have a root password for database server, use:

sudo ./install -n --dbuser root --dbpass password

Replace password with the root database password.

Sample installation output:

Done. All modules installed.
Updating Hooks...Done
Done installing modules
Taking too long? Customize the chown command, See
Setting Permissions...
Setting base permissions...Done
Setting specific permissions...
32451 [============================]
Finished setting permissions
Generating default configurations...
Finished generating default configurations
You have successfully installed FreePBX

Enable Apache Rewrite engine and restart apache2.

sudo a2enmod rewrite
sudo systemctl restart apache2

If you have an active ufw firewall, open http & https ports

sudo ufw allow proto tcp from any to any port 80,443

You have successfully installed FreePBX 15 on Ubuntu 18.04 / 16.04 / Debian 9 server.

Step 6: Access FreePBX 15 Web Interface

Open your web browser and connect to the ip_address_or_hostname/admin of your new FreePBX server.

1. Create the first admin account

install freepbx ubuntu 18.04 set username min

When done providing admin user details, click “Create Account” to create the account. On the next page, you’ll get a login console.

freepbx 15 ubuntu 18.04 debian 9 login

You’ll get to FreePBX dashboard where you can manage your Asterisk PBX.

freepbx 15 ubuntu 18.04 debian 9 admin dashboard

You now have FreePBX 15 running on Ubuntu 20.04/18.04 / 16.04 / Debian 9.

Your support is our everlasting motivation,
that cup of coffee is what keeps us going!

As we continue to grow, we would wish to reach and impact more people who visit and take advantage of the guides we have on our blog. This is a big task for us and we are so far extremely grateful for the kind people who have shown amazing support for our work over the time we have been online.

Thank You for your support as we work to give you the best of guides and articles. Click below to buy us a coffee.


Please enter your comment!
Please enter your name here