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

Install Ubuntu 12.04 Server LTS 32 or 64-bit

Commercial Modules

Commercial modules and add-ons are not currently supported on the Ubuntu platform. Commercial Modules can be purchased in the FreePBX Distro Market Place and are only supported on the FreePBX Distro platform.


Initial System Setup

Configure your root password.

sudo passwd root

Switch to the Root User

sudo -i

Update Your System

apt-get update && sudo apt-get upgrade -y 

Install Required Dependencies

apt-get install -y build-essential linux-headers-`uname -r` openssh-server apache2 mysql-server mysql-client bison flex php5 php5-curl php5-cli php5-mysql php-pear php-db php5-gd curl sox libncurses5-dev libssl-dev libmysqlclient15-dev mpg123 libxml2-dev libnewt-dev sqlite3 libsqlite3-dev pkg-config automake libtool autoconf git subversion uuid uuid-dev

Install PearDB

pear uninstall db
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

Install iksemel

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

Install and Configure Asterisk

Download Asterisk source files.

cd /usr/src

Compile and install DAHDI.

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

Compile and install LIBPRI.

cd /usr/src
tar xvfz libpri-1.4-current.tar.gz
cd libpri-*
make install

Compile and install Asterisk

cd /usr/src
tar xvfz asterisk-11-current.tar.gz
cd asterisk-*
make menuselect
make install
make config

Install Asterisk-Extra-Sounds

cd /var/lib/asterisk/sounds
tar xfz asterisk-extra-sounds-en-gsm-current.tar.gz
rm asterisk-extra-sounds-en-gsm-current.tar.gz

Install and Configure FreePBX

Download and extract FreePBX.

cd /usr/srcwget
tar vxfz freepbx-

Now create the Asterisk user and set ownership permissions.

adduser asterisk --disabled-password --gecos "Asterisk User"
chown asterisk. /var/run/asterisk
chown -R asterisk. /etc/asterisk
chown -R asterisk. /var/{lib,log,spool}/asterisk
chown -R asterisk. /usr/lib/asterisk
mkdir /var/www/html
chown -R asterisk. /var/www/

A few small modifications to Apache.

sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php5/apache2/php.ini
cp /etc/apache2/apache2.conf /etc/apache2/apache2.conf_orig
sed -i 's/^\(User\|Group\).*/\1 asterisk/' /etc/apache2/apache2.conf
service apache2 restart

Configure Asterisk database in MYSQL. 

export ASTERISK_DB_PW=amp109 
mysqladmin -u root create asterisk -p
mysqladmin -u root create asteriskcdrdb -p
mysql -u root asterisk -p < SQL/newinstall.sql 
mysql -u root asteriskcdrdb -p < SQL/cdr_mysql_table.sql 

Set permissions on MYSQL database.

mysql -u root -p -e "GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY '${ASTERISK_DB_PW}';"
mysql -u root -p -e "GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY '${ASTERISK_DB_PW}';"
mysql -u root -p -e "flush privileges;"

Restart Asterisk and install FreePBX.

./start_asterisk start
./install_amp --webroot /var/www
amportal a ma installall
amportal a reload

** If “. /install_amp” fails to run correctly, in terminal type:

./install_amp --username=asteriskuser --password=$ASTERISK_DB_PW --webroot /var/www

Finally, one last mod and start FreePBX.

ln -s /var/lib/asterisk/moh /var/lib/asterisk/mohmp3
amportal start 

Start FreePBX


http://yourlocalipaddress/html or if you prefer http://localhost/admin

After you enable and update the modules in FreePBX You might see the following error.
Symlink from modules failed 

To correct this error do the following: 

Delete the list of failed files

cd /etc/asterisk
rm ccss.conf confbridge.conf features.conf sip.conf iax.conf logger.conf extensions.conf sip_notify.conf

Then on the FreePBX webUI go to the ‘Module Admin’ and uninstall and reinstall the ‘Camp On’ module. This should resolve the Symlink issue.


  1. Change asteriskuser to be asterisk

  2. Does this work on the Server or the Desktop edition, or both?  You should specify!

    Also, what about dependencies??  I'm almost certain that if I tried these commands on a server edition, it would fail for the lack of 15 different dependencies....

    1. It is a "phone server" why in the world would you install it on the desktop edition? A production system demands a production level server not a desktop. You could probably install it on the desktop edition but again why?

      Here is some basic info about the differences between desktop and server editions.

      This page does disclaim that this type of installation is for "Experts only"

      There is also a section of this document titled "Install Required Dependencies" which would seem to cover installing dependencies.

      Have you tried the procedure? If you have please help the community by listing any dependencies that may have been missed.

  3. Good technical documentation is as specific as possible.  If this was written by someone using Server, that should be indicated.  I've spent the last two days trying to get something to build on Server without success.  I'm pretty sure that whoever wrote the documentation did it on a Desktop edition, which has many dependencies that are not included on the Server version.

    I don't believe that all of those dependencies were listed when I wrote my comment.  If they were, I somehow missed them. 

    1. Martin,

      I wrote the documentation and I wrote it based on server (and I wrote it WHILE I did it) and the dependencies have been there for over a year now. You can see all of this by just simply looking at page history:

      Please keep in mind that I do know what I'm doing when it comes to technical writing and if you would have followed the documentation it wouldn't have mattered if you were on desktop or server (however on the desktop version you'd have a completely useless CPU sucking gui running).

      As is how all of these *nix distros work, you can easily turn a desktop version into a server version, you don't even have to change the yum or apt-get repo server addresses.

  4. Hi Guys,

    I'm trying to run this documentation in order to make my asterisk server working on Ubuntu 12.04 Dekstop version (on VM VirtualBox)

    I did all the steps and when trying to go to the webrowser to point to my local ipadress, i got this error message:

    Not Found

    The requested URL /admin was not found on this server.

    Apache/2.2.22 (Ubuntu) Server at Port 80Could tou please give me help ?Thanks in advance.
    1. try: freepbx/admin

  5. Firewall?

    Also, if you're running this in a VMWare, I'd recommend going with the pre-compiled, ready to go ISO that you can download from here:

  6. Firstly, Thank you for your effort.

    I have a question. In this manual, we used asterisk ver.11. but i checked asterisk ver. in freepbx.

    so i check again asterisk version in ubuntu using 'asterisk -rvvv'.

    and i saw 'Connected to Asterisk currently running on ...'

    what is Asterisk ??? Is this version possible to use video conference??

    I have to configure video conference... TT

    I'm waiting for your reply.. Thank you (smile)

  7. Thanks a lot for this work. We successfuly install FreePBX on Ubuntu server 12.04 64bits running on Windows 2008 R2 Hyper-V virtual machine... All services are working, but I think we miss someting: "http://myipaddress" get me a "It works!" page... http://myipaddress/freepbx/admin get me a "Forbiden" page... We are testing using Windows 2008 R2 IE browser... Thanks for any help. Regads, Luiz 

  8. Would the Free PBX install instructions work correctly on a later version of Ubuntu (13.10 for example) ? Paul

  9. I followed these instructions using an AWS EC2 Micro instance running Ubuntu 12.04 64bit ed.I

    Installation was going well up until:

    Set permissions on MYSQL database.


    mysql -u root -p -e "GRANT ALL PRIVILEGES ON asterisk.* TO asteriskuser@localhost IDENTIFIED BY '${ASTERISK_DB_PW}';"
    mysql -u root -p -e "GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO asteriskuser@localhost IDENTIFIED BY '${ASTERISK_DB_PW}';"
    mysql -u root -p -e "flush privileges;"


    Restart Asterisk and install FreePBX.

    ./start_asterisk start
    When I started asterisk it perpetually restarted.
    What did I do wrong?
    I had to terminate the instance, I am going to start over tomorrow but I've not found this described elsewhere.


  10. To: Fr08 That is a known AWS bug. Apparently asterisk is compiled with flags that EC2 micro instance does not support and hence asterisk crashed on start. Due to the presence of safe_asterisk the asterisk is then continuously restarted (and it crashes each time naturally).  

  11. Hi Guys


    I have a strange problem with freepbx; I followed this guide and the i've installed the pbx on my ubunti server 12.04.

    Now after the installation of freepbx and the upgrade of modules , all sip extensions failure to register..can you help me?



  12. Running Ubuntu 14.10 I had to modify /etc/apache2/sites-available/000-default.conf and change the 'DocumentRoot' value to /var/www/admin otherwise I received a 404 Page Not Found when navigating to http://<serverIP>/


    EXCELLENT write up though!! Everything worked/installed 99.99% perfectly!

    <I'm running my Ubuntu on Microsoft Azure trunking to ThinkTel and Skype for Business Server 2015!>