Skip to end of metadata
Go to start of metadata

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 15
  • Asterisk 16 from the Debian Buster package repository
  • PHP 7.3, standard with Debian Buster
  • 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 10 installation. All necessary packages will be installed through the following commands.

Prerequisite recommended OS update

Add the backports repo specifically so that the odbc-mariadb package is available. Then update the OS to current.

Install all the necessary packages

  • apt-get install -y build-essential linux-headers-`uname -r` openssh-server apache2 mariadb-server mariadb-client bison flex php php-curl php-cli php-pdo php-mysql php-pear php-gd php-mbstring php-intl php-bcmath 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 libical-dev libneon27-dev libsrtp2-dev libspandsp-dev sudo subversion libtool-bin python-dev unixodbc dirmngr sendmail-bin sendmail asterisk debhelper-compat cmake libmariadb-dev odbc-mariadb php-ldap

Install Node.js

Install this required Pear module

  • pear install Console_Getopt

Prepare Asterisk

  • systemctl stop asterisk
  • systemctl disable asterisk
  • cd /etc/asterisk
  • mkdir DIST
  • mv * DIST
  • cp DIST/asterisk.conf .
  • sed -i 's/(!)//' asterisk.conf
  • touch modules.conf
  • touch cdr.conf

Configure Apache web server

  • sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php/7.3/apache2/php.ini
  • sed -i 's/\(^memory_limit = \).*/\1256M/' /etc/php/7.3/apache2/php.ini
  • sed -i 's/^\(User\|Group\).*/\1 asterisk/' /etc/apache2/apache2.conf
  • sed -i 's/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.conf
  • a2enmod rewrite
  • service apache2 restart
  • rm /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.so
    FileUsage = 1
    EOF
     
  • cat <<EOF > /etc/odbc.ini
    [MySQL-asteriskcdrdb]
    Description = MySQL connection to 'asteriskcdrdb' database
    Driver = MySQL
    Server = localhost
    Database = asteriskcdrdb
    Port = 3306
    Socket = /var/run/mysqld/mysqld.sock
    Option = 3
    EOF

Download FFMPEG static build for sound file manipulation

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.

  • fwconsole ma installall

Uninstall digium_phones

Broken with PHP 7.3 (April 2020).

  • fwconsole ma uninstall digium_phones

Apply the current configuration

  • fwconsole reload

Set symlinks to the correct sound files

  • cd /usr/share/asterisk
  • mv sounds sounds-DIST
  • ln -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 Server
    After=mariadb.service
    [Service]
    Type=oneshot
    RemainAfterExit=yes
    ExecStart=/usr/sbin/fwconsole start -q
    ExecStop=/usr/sbin/fwconsole stop -q
    [Install]
    WantedBy=multi-user.target
    EOF
     
  • systemctl daemon-reload
  • systemctl enable freepbx

Asterisk and FreePBX 15 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 https://community.freepbx.org/



10 Comments

  1. Bill Simon why was this reverted???

  2. As the original author of the wiki, I was being engaged in the FreePBX community forum with questions on installing FreePBX 15 and Asterisk 16 on Debian 10/PHP 7.3. However, I was not able to verify the updates you made on the wiki; further, some forum comments showed that the updates were confusing or inaccurate. So I reverted to a version that I am able to continue to support, and updated it to ensure it is working as of today. If you would like to write a similar wiki page for installation with Asterisk source or alternate platforms, please do so on a new page. Thanks!

  3. First thanks. This wiki helping me so much.

    After "touch modules.conf" and "touch cdr.conf" i do "chmod 777 *.conf" (temporary 777 (wink) ) and somewhere i need kill asterisk to use fwconsole reload or restart ...

    1. I'm glad you find it useful. Just before the steps you mentioned there is "systemctl stop asterisk" and "systemctl disable asterisk" which stops the asterisk process and takes it out of systemd control so that fwconsole can control it.

  4. after systemctl stop asterisk etc you wrote

    • ./start_asterisk start

    This launch asterisk

    • ./install -n

    Install freepbx but keep asterisk up. So then fwconsole reload etc doesnt work

    1. Works for me. If you have trouble please start a discussion on the forum. https://community.freepbx.org 

      1. all its ok, i tried now (smile)

  5. I built a cloud PBX following this 2 years ago and it worked perfectly. But something has changed either in the Debian repo or the Freepbx mirror. Got a new VPS and followed just like last time but on the Freepbx install section this happens...

    ./start_asterisk start


    STARTING ASTERISK
    Asterisk Started
    [email protected]ATL-PBX:/usr/local/src/freepbx# ./install -n
    Assuming you are Database Root
    Checking if SELinux is enabled...Its not (good)!
    Reading /etc/asterisk/asterisk.conf...Done
    Checking if Asterisk is running and we can talk to it as the 'asterisk' user...Error!
    Error communicating with Asterisk. Ensure that Asterisk is properly installed and running as the asterisk user
    Asterisk does not appear to be running
    Try starting Asterisk with the './start_asterisk start' command in this directory

           Asterisk starts without errors but ./install -n ERRORs out

    for verbosity

    bash -x start_asterisk start
    + ROOT_UID=0
    + E_NOTROOT=67
    + echo

    + '[' 0 -ne 0 ']'
    + case "$1" in
    + run_asterisk
    + echo

    + echo 'STARTING ASTERISK'
    STARTING ASTERISK
    ++ awk '{print length($0)}'
    ++ pidof asterisk
    + pid_length=19
    + '[' 19 '!=' 0 -a 19 '!=' '' ']'
    + echo 'Asterisk is already running'
    Asterisk is already running



    I have tried to find an answer. All the google links I've found reference a CentOS install and missing home directory which should not apply to a Debian 10 install. I have even wiped the VPS with a fresh OS install and followed your github post...

    https://gist.github.com/billsimon/453d59a0e4c06fbe8ba31cc7ca5ee7c9



    which is the same info.

    Any suggesstions? 

    1. Hi Cerebro please post your question on the forums: https://community.freepbx.org/