Page tree
Skip to end of metadata
Go to start of metadata


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 NOT SUPPORTED See How to Purchase FreePBX Commercial Modules****

Install CentOS 6

Initial System Setup

You MUST run all of these commands as the root user!

You MUST disable selinux.  selinux can cause strange behavior during the install

Disable selinux

In /etc/sysconfig/selinux , change the following lines:

sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/sysconfig/selinux

reboot, and verify the selinux status by running 'sestatus'. It should say:

SELinux status: disabled

SELinux did not disable!

Generally /etc/sysconfig/selinux is linked to /etc/selinux/config but in some cases they are separate files. If the above steps do not disable selinux you will need to perform one extra step:

sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/selinux/config

Update Your System

yum -y update
yum -y groupinstall core base "Development Tools"

Install Additional Required Dependencies

yum install gcc gcc-c++ lynx bison mysql-devel mysql-server php php-mysql php-pear php-mbstring php-xml tftp-server httpd make ncurses-devel libtermcap-devel sendmail sendmail-cf caching-nameserver sox newt-devel libxml2-devel libtiff-devel audiofile-devel gtk2-devel subversion kernel-devel git subversion kernel-devel php-process crontabs cronie cronie-anacron wget vim php-xml uuid-devel libtool sqlite-devel unixODBC mysql-connector-odbc libuuid-devel binutils-devel php-ldap


Keeping IPTables turned off indefinitely is strongly discouraged. You will incur the wrath of high fees and hackers

You must disable the default iptables.  You can re-enable it later, once you have made the appropriate changes.  Information on iptables can be found with a quick Google search.  If iptables is left running, it will (at very least) block you from accessing the web interface.

See the current status:   

chkconfig iptables --list

Disable iptables:

chkconfig --level 0123456 iptables off

Stop the service (this skips rebooting again):

service iptables stop

Auto Start MySQL

You must have mysql running for freepbx to operate normally.  You need to set it to start at boot time. with the following command:

chkconfig --level 345 mysqld on 

Then start mysqld if you don't plan on rebooting during the installation phase:

service mysqld start

Auto Start Apache

You will want Apache running, so you can access the FreePBX admin interface,  You need to set it to start at boot time. with the following command:

chkconfig --level 345 httpd on 

Then start apache if you don't plan on rebooting during the installation phase:

service httpd start

Install PearDB

pear channel-update
pear install db-1.7.14

You may receive a warning:

WARNING: "pear/DB" is deprecated in favor of "pear/MDB2"

At this time it is safe to ignore that message

Reboot server


Install Dependencies for Google Voice (If needed/wanted)

Install iksemel

cd /usr/src
tar xf iksemel-*.tar.gz
cd iksemel-*
make install

Add the Asterisk User

adduser asterisk -m -c "Asterisk User"

Install and Configure Asterisk

Download Asterisk source files.

cd /usr/src
wget -O jansson.tar.gz

Compile and install DAHDI and LibPRI

If you don't have any physical hardware you don't need to run these commands, however, it is still suggested to compile the modules, to allow you to add hardware later.

cd /usr/src
tar xvfz dahdi-linux-complete-current.tar.gz
tar xvfz libpri-current.tar.gz
rm -f dahdi-linux-complete-current.tar.gz libpri-current.tar.gz
cd dahdi-linux-complete-*
make all
make install 
make config
cd /usr/src/libpri-*
make install

Compile and install pjproject

If you are doing this on a 32 bit system, please note that you MUST set the following during configure:

cd /usr/src
tar -xjvf pjproject-2.4.tar.bz2
rm -f pjproject-2.4.tar.bz2
cd pjproject-2.4
CFLAGS='-DPJ_HAS_IPV6=1' ./configure --prefix=/usr --enable-shared --disable-sound \
--disable-resample --disable-video --disable-opencore-amr --libdir=/usr/lib64
make dep
make install

Compile and Install jansson

If you are doing this on a 32 bit system, please note that you MUST set the following during configure:

cd /usr/src
tar vxfz jansson.tar.gz
rm -f jansson.tar.gz
cd jansson-*
autoreconf -i
./configure --libdir=/usr/lib64
make install

Compile and install SpanDSP

If you are doing this on a 32 bit system, please note that you MUST set the following during configure:


cd /usr/src
tar -xzf spandsp-0.0.6.tar.gz
cd spandsp-0.0.6
./configure --libdir=/usr/lib64
make install

Compile and install Asterisk

If you are doing this on a 32 bit system, please note that you MUST set the following during configure:

cd /usr/src
tar xvfz asterisk-13-current.tar.gz
rm -f asterisk-13-current.tar.gz
cd asterisk-*
contrib/scripts/install_prereq install
./configure --libdir=/usr/lib64
make menuselect

You will be prompted at the point to pick which modules to build. Most of them will be enabled, but if you want to have MP3 support, you need to manually turn on 'format_mp3' on the first page.

After selecting 'Save & Exit' you can then continue

make install
make config

Install Asterisk-Extra-Sounds

Note that this installs the (8khz) 'wav' soundfiles and G722 (High Definition 'Wideband') audio.

mkdir -p /var/lib/asterisk/sounds
cd /var/lib/asterisk/sounds
tar xvf asterisk-core-sounds-en-wav-current.tar.gz
rm -f asterisk-core-sounds-en-wav-current.tar.gz
tar xfz asterisk-extra-sounds-en-wav-current.tar.gz
rm -f asterisk-extra-sounds-en-wav-current.tar.gz
# Wideband Audio download
tar xfz asterisk-core-sounds-en-g722-current.tar.gz
rm -f asterisk-core-sounds-en-g722-current.tar.gz
tar xfz asterisk-extra-sounds-en-g722-current.tar.gz
rm -f asterisk-extra-sounds-en-g722-current.tar.gz

Set ownership permissions

If you are doing this on a 32 bit system, please note that you MUST set the following during configure:

chown -R asterisk. /usr/lib/asterisk
chown asterisk. /var/run/asterisk
chown -R asterisk. /etc/asterisk
chown -R asterisk. /var/{lib,log,spool}/asterisk
chown -R asterisk. /usr/lib64/asterisk
chown -R asterisk. /var/www/

A few small modifications to Apache.

sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php.ini
sed -i 's/^\(User\|Group\).*/\1 asterisk/' /etc/httpd/conf/httpd.conf
sed -i 's/AllowOverride None/AllowOverride All/' /etc/httpd/conf/httpd.conf
service httpd restart

Install and Configure FreePBX

Download and extract FreePBX.

cd /usr/src
tar xfz freepbx-13.0-latest.tgz
rm -f freepbx-13.0-latest.tgz
cd freepbx
./start_asterisk start
./install -n

That's it!

You can now start using FreePBX.  Open up your web browser and connect to the IP address or hostname of your new FreePBX server.  You will see the Admin setup page, which is where you set your  'admin' account password, and configure an email address to receive update notifications. 

We hope you enjoy using FreePBX 13!

Install and Setup Commercial Modules

[Optional] Additional Installation Steps

If you wish to use Commercial Modules you will need to perform the additional steps below. 

Enable the FreePBX Commercial yum repos

wget -P /etc/yum.repos.d/ -N

yum clean all to clean out yum cache so it will find out new RPMs

yum clean all

yum install needed RPMs for Commercial Modules

yum -y install php-5.3-zend-guard-loader sysadmin fail2ban incron ImageMagick

Ensure you have the right mirrors to download and obtain commercial modules

/var/lib/asterisk/bin/freepbx_setting MODULE_REPO,

Restart Apache and Install Sysadmin

service httpd restart
fwconsole ma download sysadmin
fwconsole ma install sysadmin

For Further information see: Installation on CentOS 6.X and RHEL 6.X based systems


  1. I'm going through these steps to get this setup on a Google Cloud Engine CentOS 6.7 VM. I had trouble getting SELinux to disable following just the steps above. I had to issue this command in addition to the one in the steps to get it to work: sed -i 's/enforcing/disabled/g' /etc/selinux/config /etc/selinux/config

    Once I ran that I was able get it to stop running.

    1. Yes, I was going to update with that information but hadn't had the time. I have updated to reflect this.

    2. Hi Kevin!

      I am trying to do the same on Google Cloud Engine, however all my calls have no audio (sad)  any suggestions?

      1. Check your NAT settings on the extensions. Under Advanced make sure the NAT mode is Yes. That might fix it for you.

        1. OMG!  so simple, that worked!!

  2. Got through the entire install on my Google Cloud VM install. Was able to get to web interface, but when I set the administrator name and password I was getting the following error: "file_put_contents(/var/log/asterisk/freepbx_security.log): failed to open stream: Permission denied"

    I was able to fix this by running this command: chown -R asterisk. /var/log/asterisk/

    1. Updating the permissions for that directory should have been handled during the Set Ownership Permissions steps with the following command:

      chown -R asterisk. /var/{lib,log,spool}/asterisk

      If this command was missed I would double check the /var/lib/asterisk and /var/spool/asterisk directories as well.

      1. I must have missed that step. I thought I had done it, but I guess not.

      2. I found another issue with ownership permissions. I was getting the error "Unable to connect to remote asterisk (does /var/run/asterisk/asterisk.ctl exist?)" in the FreePBX web interface every time I tried to click "Apply Config." I fixed it by running this:

        chown -R asterisk. /var/run/asterisk/

        Maybe adding the run folder to the instructions would help?


        1. That is literally the first step in the Set Ownership Permissions section.

          1. Geez. I ran that step, too. You can delete my comment. I don't know why that permission is getting reset. I'll move my issue over to the forum.

  3. autoconf and automake are required dependencies for the jansson thing.

    Maybe just use yum groupinstall 'Development Tools'

  4. Updated to include Development Tools in case the minimal install doesn't install them.

  5. I followed these instructions.  After the first time I logged in and applied the settings, I got this error:
    PHP Fatal error: Class 'DomDocument' not found in /var/www/html/admin/libraries/Composer/vendor/fguillot/picofeed/lib/PicoFeed/Parser/XmlParser.php

    I resolved the issue by installing: php-xml

    You may want to add this to the list of modules required.

    Other than that, these steps worked great!

  6. I followed the steps but get the Apache test page when I try to access it with my browser.


    1. If you are getting the Apache test page than a step was missed. The FreePBX web files are installed during it's install process but you need to make sure all the directory permission/ownership is correct. If the ownership or permissions are incorrect the files will not write.

  7. Sorry, i'm new at this.  Where should I check or at what point should I go back to and star again from?

    1. I would check /var/www to verify nothing is there. I would do an ls -la /var/www and check it's ownership to make sure it's Asterisk.

      Make sure that the Set Ownership Permissions and the Small changes to Apache steps are followed.

      Where there any errors outputted during the install process?

  8. I started over and when I get to the final steps this is the results...line after line and it is still going

    [[email protected] src]# tar xfz freepbx-13.0-latest.tgz

    [[email protected] src]# rm -f freepbx-13.0-latest.tgz

    [[email protected] src]# cd freepbx

    [[email protected] freepbx]# ./start_asterisk start




    /usr/sbin/safe_asterisk: line 164: 12174 Illegal instruction     (core dumped) nice -n $PRIORITY "${ASTSBINDIR}/asterisk" -f ${CLIARGS} ${ASTARGS} > /dev/${TTY} 2>&1 < /dev/${TTY}

    cat: /var/run/asterisk/ No such file or directory

    /usr/sbin/safe_asterisk: line 164: 12180 Illegal instruction     (core dumped) nice -n $PRIORITY "${ASTSBINDIR}/asterisk" -f ${CLIARGS} ${ASTARGS} > /dev/${TTY} 2>&1 < /dev/${TTY}

    cat: /var/run/asterisk/ No such file or directory

    Asterisk Started

    [[email protected] freepbx]# ./install -n/usr/sbin/safe_asterisk: line 164: 12193 Illegal instruction     (core dumped) nice -n $PRIORITY "${ASTSBINDIR}/asterisk" -f ${CLIARGS} ${ASTARGS} > /dev/${TTY} 2>&1 < /dev/${TTY}

    cat: /var/run/asterisk/ No such file or directory

    1. Asterisk was not installed properly. Either not compiled properly or it's user permission/ownership is incorrect.

      Are you not just copying and pasting the commands? Better yet, can RackSpace due a custom ISO? I would suggest using the ISO to install.

  9. Rackspace can't do a custom ISO.  I did cut and paste.


    1. I would recommend then, they allow custom ISOs. I do not know what is happening here, these instructions are proven and work. You are not following them in some manner and this is the cause of the errors. 

      1. I can't see how I can mess up a cut and paste   I carefully went through each step.

  10. I used CentOS 6 PVHM the first time and now tried with 6 PV.


    1. Shawn, the Wiki comments are not for troubleshooting problems. If you are still having an issue with this you can join #freepbx on FreeNode via IRC or the community forums.

  11. Possibly someone can recommend a hosting site on par with Rack Space where I can just use an ISO.  I am looking to set this up for a client.


    1. I just recommended to you in a previous comment. They allow you to upload your own ISO.

  12. bummer...  any ideas?

    [[email protected] freepbx]# ./install -n

    PHP Fatal error: Call to undefined function FreePBX\Install\posix_geteuid() in /usr/src/freepbx/installlib/installcommand.class.php on line 169

    1. Make sure that php-posix is installed on the server.

      1. [[email protected] freepbx]# yum install php-posfixLoaded plugins: fastestmirror, securitySetting up Install ProcessLoading mirror speeds from cached hostfile * base: * extras: * updates: cosmos.illinois.eduNo package php-posfix available.Error: Nothing to do

        1. you misspelled postfix

          1. Was already editing the post when he replied. It's fixed, it's php-posix

            1. oh yeah didn't see your typo.. thought it was the other chap (smile)

            2. sweet! that did it, thanks all!

              Now I get this error,.. so close


              [[email protected] freepbx]# ./install -n

              Assuming you are Database RootChecking if SELinux is enabled...Its not (good)!No /etc/asterisk/asterisk.conf file detected. Installing...Writing /etc/asterisk/asterisk.conf...DoneChecking 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 userAsterisk appears to be running as rootTry starting Asterisk with the './start_asterisk start' command in this directory

              1. This error is pretty self explanatory. Asterisk is running as the wrong user. Did you do the permission changes? Did you run ./start_asterisk as the instructions states before running ./install -n?

                1. yes sir, and I just re-ran them just in case I missed one.. still same error.

                  BTW thanks for the help (smile)

                  1. Then make sure Asterisk is started and running as root. Because that's what's happening. If it is then do this from the server cli: asterisk -rx "core stop now"

                    Then run ./start_asterisk and ./install -n from the FreePBX directory.

                    1. THANK YOU!!!! that did it!  Up and running :0

  13. I followed these steps, including enabling the commercial modules, but get an error...

    file_put_contents(/tftpboot/phonebook.xml): failed to open stream: No such file or directory

    ...when trying to enable the Endpoint Manager module. Any ideas?

    1. When you do a manual install you have to do manual setup for additional things you want to do on the system. EPM requires a /tftpboot directory, which needs to be owned by the asterisk user.

      1. Hi Tom,


        Thanks for the reply, will the following do it?

        mkdir tftpboot

        chmod +w tftpboot

        chown asterisk.asterisk tftpboot

        nano /etc/xinetd.d/tftp and set to disable=no

        /etc/xinetd.d/tftp restart

        1. Ah.. perhaps not.

          I am now getting..

          file_put_contents(/tftpboot/cfg0300.xml): failed to open stream: Permission denied

          Any ideas what I should have entered?

          1. This discussion might be better in the forums, but I ran:
            chown -R asterisk. /tftpboot

            And that worked for me...I think. Might need the -R to make the permissions recurssive? 

            1. Kevin R I am also installing on Google Cloud - I only get one way audio, did you run into that problem?  Any suggestions or pit falls you learned with GCE?  Thanks!!!

  14. I've used these steps many times and they are very helpful!   Thanks!

    I've noticed that flite, the Text-to-Speech engine is missing after these steps.   It's referenced in the FreePBX Settings/Text to Speech Engines menu, but it doesn't actually exist in /usr/bin/flite.

    If you could please include the steps to have it installed, I'd appreciate it!

  15. On a fresh install when i try to display memory for the last hour on the dashboard I get this error:

    Any ideas?


  16. The link for iksemel is broken and needs updated:

    [[email protected] src]# wget
    --2016-12-14 16:01:37--
    Resolving, 2607:f8b0:400c:c0f::52
    Connecting to||:443... connected.
    HTTP request sent, awaiting response... 404 Not Found
    2016-12-14 16:01:37 ERROR 404: Not Found.

  17. I am using php 5.6  and centos 6.8

    I could not install Digium Add-on Modules

    Module digiumaddoninstaller successfully downloaded

    This Module Requires The Digium RPM to be installed (php-digium_register-3.0.5-1_centos6.i686.rpm). Please see this page for more information: <a target="_blank" href=""></a>Unable to install module digiumaddoninstaller:


    please help about this problem

    1. You need to install php-digium_register-3.0.5-1_centos6.i686.rpm for this to work.  Just as it told you. This is a manual install, additional modules and service such as this are installed as you need them.

      1. i have already installed this rpm by "yum install php-digium_register"   

        but getting same error


  18. pjsip-2.4 is old, i run into troubles where it was crashing asterisk randomly

    Better configure Asterisk with the --with-pjproject-bundled and skip the pjproject step from the manual