Tips on installing FreeSWITCH and FusionPBX in debian

I’ve been testing out FreeSWITCH and FusionPBX. I found it non trivial to install in debian. Here are my tips for installing.

  1. Don’t bother with the install script. I found it to be broken. And when it breaks during install, it leaves you in a state that’s very hard to understand and fix. In the end it was easier to install FreeSWITCH by hand, get that working, to the extend that you can make inter extension calls, then proceed with the FusionPBX install.
  2.  Install FreeSWITCH by following the Quick Install Guide.
  3. Commit the entire FreeSWITCH configuration to git so its easy to roll back when you reinstall FusionPBX. Switch to a new branch before making further changes.
    cd /usr/local/freeswitch
          git init
          echo 'db/*' >> .gitignore
          echo 'log/*' >> .gitignore
          echo '.svn*' >> .gitignore
          git add -A
          git commit -m "Initial Commit"
          git checkout -b try1
  4. Get the latest version of FusionPBX from svn.
    cd /usr/src
             svn checkout fusionpbx
             cd fusionpbx
             cp -a fusionpbx /var/www/fusionpbx
  5. Create a fusionpbx site for apache and enable it. Note that this makes fusionpbx appear at the root of your site. Create file called fusionpbx in your /etc/apache2/sites-available directory and put the following in it:
          <VirtualHost *:80>
            ServerAdmin webmaster@localhost
            DocumentRoot /var/www/fusionpbx
            <Directory />
                    Options FollowSymLinks
                    AllowOverride None
            <Directory /var/www/fusionpbx/>
                    Options Indexes FollowSymLinks MultiViews
                    AllowOverride None
                    Order allow,deny
                    allow from all
            ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
            <Directory "/usr/lib/cgi-bin">
                    AllowOverride None
                    Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                    Order allow,deny
                    Allow from all
            ErrorLog /var/log/apache2/error.log
            # Possible values include: debug, info, notice, warn, error, crit,
            # alert, emerg.
            LogLevel debug
            CustomLog /var/log/apache2/access.log combined
        Alias /doc/ "/usr/share/doc/"
        <Directory "/usr/share/doc/">
            Options Indexes MultiViews FollowSymLinks
            AllowOverride None
            Order deny,allow
            Deny from all
            Allow from ::1/128

    Then enable the site with a2ensite fusionpbx/

  6. after installing FusionPBX, commit the entire configuration to git to make rolling back easier. Switch to a new branch before making further changes.
  7. set up a FQDN for the box running FreeSWITCH and FusionPBX
  8. use ACL to allow www-data to make changes to the /usr/share/freeswitch directory

And after you install and you realise it didn’t quite go as planned

  1. Reset the postgresql database:
    root@fusionpbx: # su - postgres
    postgres@fusionpbx:~$ psql
    postgres=# drop database fusionpbx;
    postgres=# create database fusionpbx;
    postgres=# alter user fusionpbx with password 'XXXX';
    grant ALL PRIVILEGES ON DATABASE fusionpbx to fusionpbx;
  2. revert your FreeSWITCH configuration using git
  3. revert your FusionPBX configuration using git

10 responses to “Tips on installing FreeSWITCH and FusionPBX in debian”

  1. Thank you. These instructions are easy and works great. Earlier I tried to install with the script without success. +1 for git way of versioning the configuration.

  2. I know for a fact the arm fusionpbx script works because I write and maintain the pkg based install and I di installs daily

    • You are incorrect. The install fails repeatedly. I have yet to complete it without error following the directions on your WiKi.

      • Hello Anonymous,
        I’m sorry you weren’t able to install freeswitch following my directions. They are not really meant as a definitive set of instructions, more just some tips and things I did which worked for me at the time, to the best of my memory.
        Also, this is not a wiki, but my blog.
        Also, if you could elaborate on the troubles you are having, I might be able to help, but you are more likely to get help if you visit the freeswitch irc channel or post to the freeswitch users mailing list.
        Good luck with it!

  3. @Richard,
    Thanks for letting me know. I’m keen to try them out. Do they work on Beagle Bone Black devices?

  4. Hey Jason,
    Thank you so much for this guide!
    I installed fusionPBX nd FreeSwitch and its running perfectly well.! I actually want to change the sip-profile/internal.xml and vars.xml to enable WebRTC binding. when i make changes to the vars.xml file by enabling the and run the FreeSwitch,its throws error stating Error Creating SIP UA for profile: internal (sip:mod_sofia@;maddr=;transport=udp,tcp)
    Any help would be appreciated!!!
    Thanks in advance!!!

Leave a Reply

Your email address will not be published.