Archive:FreePBX Distribution: Difference between revisions

From ThinkServer
Started update section, added section for first time web interface run
m Sam moved page FreePBX Distribution to Archive:FreePBX Distribution: Archiving page
 
(20 intermediate revisions by the same user not shown)
Line 1: Line 1:
AsteriskNOW! is a fully fledged VoIP server allowing complete customisation to your needs and works with most setups. It is an appliance, with a complete Linux setup and web manager to allow easy administration.
FreePBX Distribution is a fully fledged VoIP server allowing complete customisation to your needs and works with most setups. It is an appliance, with a complete Linux setup and web manager to allow easy administration.


On the server, we have implemented AsteriskNOW! 6.12.65-26 distribution and Asterisk 13.x series. This is the latest version of Asterisk and is a LTS release so will be supported well into the future with fixes (slated to be supported until 2018). This is a complete distribution and so needs to be installed on a machine. We will be using Linux tools to install the distribution as a virtual machine.
We have implemented FreePBX 16 and Asterisk 20. This is the latest version of Asterisk and is a LTS release so will be supported well into the future with fixes (slated to be supported until 2027). This is a complete distribution and so needs to be installed on its own machine/virtual machine. We will be setting this up on a separate virtual machine rather than the main server.


== Preparing the host machine ==
We will be configuring this system to work with the Mitel 5360 IP Phone and the Mitel 5624 VoWiFi phone so some settings are specific to the 53xx models of this phone. We will also be using Twilio as a SIP trunk so some settings are specific for this.


=== Enable Intel VT-d extensions ===
== Prerequisites ==
With this method we need Intel VT-d extensions enabled so we can add the physical network card to the virtual machine


# Enable Intel VT-d in the system BIOS. It may be called Intel Virtaulization Extensions or something similar. We must enabled both Intel VT-x and Intel VT-d. Intel VT-d is a later version of Intel VT-x and allows physical hardware to be taken over and used by a virtual machine and there other memory and performance enhancements also. Intel VT-d may only be available if you have a recent machine.
* Download the latest FreePBX ISO image. This is currently FreePBX 15 available [https://downloads.freepbxdistro.org/ISO/SNG7-PBX-64bit-2104-1.iso here directly] or at [https://www.freepbx.org/downloads/ this website]. Please do not be phased as at the moment, we will be upgrading to FreePBX 16 once FreePBX 15 is installed.
# The extensions need to be enabled in the system kernel on the host machine as by default they are not enabled. Boot the machine, login and open YaST. Type your root password if needed.
* This will need burning to a DVD or writing to a USB stick. We use a USB stick and Rufus under windows to write it to a USB stick (use DD mode). This guide will cover the USB method but the CD method is very similar.
# Under 'System', open 'Boot Loader'
# Change to the 'Kernel Parameters' tab
# After the last option on 'Optional Kernel Command Line Parameter', add <code>intel_iommu=on</code>.
# Click 'Accept'
# Reboot the machine


=== Install Virtual Machine components ===
== Booting the installation system ==
# Login and open YaST. Type your root password if needed.
# Insert the USB stick or DVD into the computer.
# Under 'Virtualization', click 'Install Hypervisor and Tools'
# Power on the machine.
# Under 'KVM Hypervisor', tick both 'KVM server' and 'KVM tools'
# Press the key to bring up the boot device menu if needed.
# Click 'Accept'. The components will install.
# Select the USB stick or DVD that is inserted.
# When finished, reboot the machine as kernel components will have been changed.
# When the boot menu appears, select 'FreePBX 15 Advanced Installation'.
# Next, select 'Advanced Installation with Normal Video'.
# Next, select 'Advanced Install with Asterisk 17 via Standard Video'. Asterisk 17 is the latest available to install from the media but we will upgrade it later. The system will now boot to the Linux installer.


== Preparing the Virtual Machine ==
== Configuring the FreePBX installation ==


=== KVM Connection ===
We will be using a dedicated computer with an empty hard drive. This will be a custom installation so that we can configure the system before it is installed. This guide will show you all the main options that need to be changed - there are other options if you wish to customise the installation but this is what I will be using to install the system.
# On the Kickstart Menu, type 'virt'. When displayed, open 'Virtual Machine Manager'
# Type in the root password if needed.
# First we need to create the connection. Click the 'File' menu then click '+ Add Connection'
# Make sure 'QEMU/KVM' is selected. No other options are needed. Then click 'Connect'
# You should now see 'QEMU/KVM' in the list with nothing underneath.


=== Adding the virtual machine ===
=== Setting the date, time and time zone ===
# To make a virtual machine, click the 'File' menu then clock 'New virtual machine'.
# As we will be installing AsteriskNOW! from a DVD image we downloaded, under 'Choose how you would like to install the operating system', select 'Local install media (ISO image or CDROM)'. In the 'Architecture' dropdown, make sure 'x86_64' is selected. Then click '> Forward'.
# Under 'Locate your install media', select 'Use ISO image' then click 'Browse'
# Click 'Browse Local'. Goto your Downloads directory and select the AsteriskNOW! image, the click 'Open'.
# Make sure the image is still selected in the list and click 'Choose Volume'.
# As this is a customised version of Linux, we cannot use the automatic detection to find the operating system. Unselect 'Automatically detect operating system based on install media' (will have 'OS type: unknown' and 'Version: unknown' underneath).
# In OS type, select 'Linux'. In Version, select 'CentOS 6.5'. Then click 'Forward'.
# Under 'Choose Memory and CPU settings', in 'Memory (RAM)', add '2048 MiB'. Under 'CPUs', make sure it says '1'. Then click 'Forward'.
# Make sure 'Enable storage for this virtual machine' is selected. Under 'Create a disk image for the virtual machine' add '20.0 GiB'. Then click 'Forward'.
# Under 'Name', type 'AsteriskNOW' (don't add the exclamation point - this causes problems later!)
# Under the 'Network Selection' dropdown, select any 'Host Device xxxxx: macvtap'. This doesn't matter which one is selected, but one must be selected to get the machine started. Press 'Finish'.
# If all is well, you should see a quick progress bar and then the machine will start, booting from the DVD image.
# At this point, select the Power dropdown menu from the top and select 'Force off'. You will see a warning, press 'Yes' to stop the machine. You will now see 'Guest not running'.


=== Configuring the machine ===
# Click '''DATE & TIME''' to select the correct time zone and set the date & time.
# In the 'Region:' box, type or select 'Europe'.
# In the 'City:' box, change 'Amsterdam' by typing of selecting 'London'.
# If you are already connected to a network, ensure that the 'Network Time' switch is 'On'. This is important as this server will be used to set the times on the phones and needs accurate time to function correctly.
# We will configure the time servers to use ones closer to us in the UK. Click the cog icon next to the 'On' switch.
# We will change the CentOS NTP servers to Google servers.  For example, double click on the first address and change <code>0.centos.pool.ntp.org</code> to <code>time1.google.com</code>. Do this for servers 0-3 and <code>time1-4</code>.
# We will add the main server IP address as a source too. This is typed in the top box and then click '+'.
# Click 'OK'.
# Click 'Done'.


# Press the 'i' button at the top to switch from display to settings
=== Setting the keyboard layout ===
# Under 'CPUs', check under 'Configuration' that the Model is 'Haswell-noTSX'.
# Click 'NIC :xx:xx:xx'. Click 'Remove' at the bottom to remove the network emulation and click 'Yes' to agree. We will be adding the separate physical network card next.
# Click '+ Add Hardware'. Click 'PCI Host Device'. You will need to find in the list the network card you want the guest to use and then click 'Finish'. It will be added down the side as 'PCI xxxx:xx:xx.x'.
# We won't be needing a sound card. Click 'Sound: ich6' and then 'Remove'. Click 'Yes' to agree.
# Goto 'IDE CDROM 1' and click 'Connect' if it is there. If not skip to the next step. Locate the AsteriskNOW image and click 'Choose Volume'.
# Goto 'Boot Options'. Make sure that the CD-ROM drive is at the top of the list.
# Once done, the machine is configured and ready to go. Click 'Apply' if it isn't greyed out. Press the screen icon next to the 'i' button at the top and then click the play button to start the machine up.


== Installing AsteriskNOW! on the virtual machine ==
# Click '''KEYBOARD'''.
# Click the '+' button to add a new keyboard layout. We must add the new keyboard layout before removing the one we don't want.
# Type 'UK' in the search box.
# Click 'English (UK)'.
# Click 'Add'.
# Select 'English (US)' from the list.
# Click the '-' button to remove this layout.
# You may test the layout in the box on the right. I usually check that the '£' and '#' symbols come up when I press these keys.
# Click 'Done'.


# On the host machine, download the latest 64-bit DVD image of AsteriskNOW! (http://www.asterisk.org/downloads/asterisknow}
=== Setting language support ===
# Attached the DVD images to a free optical drive on the virtual machine.
# Change the boot order so that the optical drive is at the top of the boot list.
# Start the virtual machine.
# When the boot menu appears, Under 'FreePBX 6.12.65 with Asterisk 13 - EXPERIMENTAL!' header, select 'Full Install -- No RAID'.
#* Disregard the experimental header. When this version was released, Asterisk 13 was new and considered experimental. Once updated, Asterisk 13 is pretty mature and not considered experimental anymore.
#* There is no need to choose RAID if using a virtual machine unless you are using a virtual machine or have an exotic setup to make the hard drives on 2 different physical hard drives.
# Once the system is booted, you will be presented with options to configure your network
#* Make sure 'Enable IPv4 support' and 'Dynamic IP configuration (DHCP)' are both selected.
#* Unselect 'Enable IPv6 support'
#* Hit 'OK'
# On the next option, select the correct time zone
#* As this virtual machine is installed on a Linux host, select 'System clock uses UTC'
#* Select Europe/London (tip: press 'E' on the keyboard to jump down to 'E' on the list.)
#* Hit 'OK'
# On the next option, type in a password to use for the system.
# After you hit 'OK', the system will start to install. This may take a long while. The installer may look as though it has frozen at certain points. However it is important to be patient as a few of the packages take a long time to install.
# When the install is finished, the machine will reboot. When it comes up with the boot menu, this will be the installation discs boot menu.
#* 'Force Off' the virtual machine. This is safe as the machine is not fully running yet.
#* From the boot order, remove the optical drive and make sure the hard drive is placed to the top.
#* Start the virtual machine again.
# On first boot, it will start downloading updates for FreePBX. This may take a while.
# Once finished, it will leave you at the command prompt. Type '<code>root</code>' for the username and the password you selected during install for password.
# That's it, AsteriskNOW! is installed!


== First time run of the web interface ==
# Click '''LANGUAGE SUPPORT'''.
# Tick 'English (United Kingdom).
#* Unfortunately, we cannot deselect 'English (United States)'.
# Click 'Done'.
 
=== Setting the hard drive partitioning ===
 
As this is a new install, we will be configuring FreePBX to use the whole drive. We would like to use the BtrFS file system so this is slightly different to usual.
 
# Click '''INSTALLATION DESTINATION'''.
# Check that the hard drive we want to use has a tick on it.
# Under 'Partitioning', select 'I will configure partitioning'.
# Click 'Done'.
# Under 'New mount points will use the following partitioning scheme', change 'LVM' to 'Btrfs'.
# If there are already any partitions on the disk, you will have to select each one and click '-' on each one until the disk is empty.
# We want to use the whole drive. At the top of the list, click 'Click here to create them automatically'. This will automatically create the correct partitions using the whole drive.
# Click 'Done'.
# A list of what will be done during the installation will appear which you can review. If you are happy, click 'Accept Changes'.
 
=== Disable kdump ===
 
I have no use for kdump so will be disabling it.
 
# Click '''KDUMP'''.
# Untick the 'Enable kdump' box.
# Click 'Done'.
 
=== Setting the network hostname ===
 
The rest of the network settings should be OK unless you have something custom to configure. We will just be changing the hostname.
 
# Click '''NETWORK AND HOSTNAME'''.
# In the hostname box, replace 'freepbx.sangoma.local' to the hostname of your network (for example freepbx.freddythechick.net).
# Click 'Apply'.
# Click 'Done'.
 
=== Starting the installation ===
 
# If there is any problems preventing installation, there will be a yellow bar at the bottom of the screen saying where the problem is and the section that has the problem will have a yellow exclamation mark. These sections will need fixing before you can continue.
# I have added a picture of what the screen should look like for reference once everything is configured.
# If you are happy with all of the settings, click 'Begin Installation'.
 
=== Entering a root password ===
 
The installation will start. While the installation continues, we need to set the root password. This will not stop the installation while you are setting this up but must be done before the installation is finished.
 
# Click '''ROOT PASSWORD'''.
# Type a password for the root user in the 'Root Password:' box.
# Retype the password in the 'Confirm:' box.
# Click 'Done'.
 
This will be an internet facing machine, even more so if exposing SSH so it is '''HIGHLY RECOMMENDED''' to type a password that fills the strength bar so that it says '''Strong'''. Use a combination of uppercase letters, lowercase letters, numbers and symbols and make the password as long as you can possibly remember. Do not use common words that may be in the dictionary or names. If you do, you will be warned with a yellow bar at the bottom and will be asked to click 'Done' again. It is '''HIGHLY RECOMMENDED''' to use a different password if you are warned of this as you will be at risk of attack.
 
=== Completing the installation ===
 
You will now be back at the installation screen - grab a cup of coffee and wait for the installation to finish.
 
Once the installation is finished, it will say 'SangomaOS 7.8 is now successfully installed and ready to use! Go ahead and reboot to start using it!'. Click the 'Reboot' button and the machine will reboot to the FreePBX terminal. Remember to remove the DVD/image from the drive!
 
== First run of the web interface ==
 
# Open a browser on a machine on the same network and go to the IP address of the machine. For example, if the machine is at <code>192.168.1.45</code>, type <code>http://192.168.1.45</code> into the address bar. If you are not sure of the address, login to the server as root and it will display the IP address of the machine. This is the first time of using the web interface so we need to set up a few items. Ignore any warnings about the server certificate - this can be set up later.
# Type a username into the '''Username''' field. Avoid common usernames, such as admin and user as these are easily guessed if your server is attacked.
# Type a password into the '''Password''' and '''Confirm Password''' fields. Make sure this is strong, especially if you plan to make the admin pages web facing at a latter date.
# Type an e-mail address into the '''Notifications Email address''' field. This is used if there are any critical errors on the server and to inform you of automatic system updates.
# You can change the '''System Identifier''' to something else if you like, this is especially handy if managing more than one FreePBX server.
# Choose your settings to enable automatic updates as you would like for your system.
# When done, click 'Setup System' in the bottom right hand corner.
# This will take you to the home page for the server. To administer the system, click 'FreePBX Administration' and log in with the details you typed just now.
# You will now be asked if you would like to activate the system with Sangoma. This is recommended to activate some of the modules we will be using later. Click 'Activate'.
# Type your e-mail address. If you already have an e-mail account with Sangoma, wait a few seconds and type your password when the box comes up. Fill in any missing details if needed then click 'Continue'. If you don't already have an account, you will have to fill in your details and click 'Create'.
# Under 'New Activation', type a location and then click 'Activate'. If you are re-installing an already activated system, you can go to 'Existing Deployment' and type the deployment number already activated there.
# Once you have clicked 'Activate', it will then display a deployment number. This means it is successfully deployed. The deployment number can be displayed later if needed.
# Click 'Skip' on the module updates for now as we need to set up the server first.
# Leave '''Sound Prompts Language''' as 'English (United Kingdom)' or change this from the drop down menu if wrong.
# Leave '''System Language''' as 'English (United Kingdom)' or change to this from the drop down menu if wrong.
# The '''Timezone''' option should already be correct from our installation. If not, it can be corrected here to 'Europe/London'.
# Click 'Submit' in the bottom left hand corner. It will take a while as it is starting to setup the system - be patient!
# Unless you want to set up the firewall, click 'Abort'.
# You may get a few adverts after this - click 'Not Now' to skip them.
# Your system is now basically set up - you will be presented with the dashboard.
# If there is a red 'Apply Now' button in the top right hand corner, press this to configure the system with the changes just implemented.


== Updating the server ==
== Updating the server ==


=== Updating the distribution ===
=== Updating using CentOS system updates (OPTIONAL) ===


The latest version of AsteriskNOW! available from the website is not the latest version of the distribution. The distribution must be updated manually to get up to the latest version.
The FreePBX distribution is based on CentOS 7.8, however, FreePBX very rarely, if ever, provide updates to the system unless they upgrade the distribution. You can configure the system to update using CentOS repositories for a more up-to-date and secure system.


We will start off on the 6.12.65 track. As of 31st December 2015, this has reached its End of Life. We will be upgrading to the 10.13.66 track which is the latest.
'''WARNING: If you are using anything the uses kernel modules (i.e. DAHDI modules), please do not use this method to update - this will cause the modules to break as they rely on the kernel supplied to operate.'''


# Login to your system as root with SSH or go to the Virtual Machine Manager, open the machine and login.
I do not use anything that relies on the kernel so shall be applying these updates.
# Type <code>cd ~</code>. This will take you to the home directory where we can download.
# Type <code>mkdir upgradescripts</code> then <code>cd upgradescripts</code>. This will make a new directory and take you into the new directory.
# Type <code>wget http://upgrades.freepbxdistro.org/stable/6.12.65/upgrade-6.12.65-100.sh</code>. This will download the script to update the distribution to the new track.
# Type <code>chmod +x upgrade-6.12.65-100.sh</code>. This changes the permissions so we can execute the file.
# Type <code>./upgrade-6.12.65-100.sh</code> to run the script.
# While the script is running, you may see some errors. These are normal and as long as the script runs through to the end, you can safely ignore these.
# When the script is finished, it will say <code>REBOOT YOUR BOX NOW</code>. Follow these instructions and type <code>reboot</code>.
#: Once the machine has rebooted, we will need to update to the latest version of the track (At the time of writing, it was 10.12.66-10, we will use this as an example. Use the latest version available at http://wiki.freepbx.org/display/PPS/FreePBX-Distro-10.13.66).
# Login in again as root.
#: We did a lot of the legwork in the last example so it makes it easier this time round.
# You should already be in the home directory so type <code>cd upgradescripts</code> to move to the <code>upgradescript</code> folder we made earlier.
# Look on the FreePBX site, then with the lastest script, type <code>wget https://upgrades.freepbxdistro.org/stable/10.13.66/upgrade-10.13.66-10.sh</code>, changing the last part to whatever the latest version is.
# Type <code>chmod +x upgrade-10.13.66-10.sh</code> to make the script executable.
# Type <code>cd /</code>. This will take us to the root directory. Due to the way this script works, you must run it from the top root directory.
# Type <code>./root/upgradescripts/upgrade-10.13.66-10.sh</code> to run the script.
# Once again, errors that don't stop the script are normal and can be ignored.
# Once you have reached <code>REBOOT YOUR BOX NOW</code>, reboot the machine by typing <code>reboot</code>.


'''NOTE'''
==== Add the CentOS 7 update repository ====


It is a good idea to keep an eye on the FreePBX website for updates from time to time. You can use the second half of the tutorial to do the minor updates at any time, substituting the example script version for the latest.
* At the terminal, type the following command:
yum-config-manager --add-repo https://www.mirrorservice.org/sites/mirror.centos.org/7/updates/x86_64/
* We need to add the GPG key for this repository to be trusted. Type the following command:
gpg --quiet --with-fingerprint /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
You should see a key displayed.
* Import the key so the system trusts it, type:
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
* We now want to clear the yum cache so that it picks up the new repository. Type:
yum clean all
* You can now follow the next step to update the system.


=== General updates ===
=== General updates ===


As with any Linux distribution, from time to time there are updates to the system. We will show you how to check these and install them.
As with any Linux distribution, from time to time there are updates to the system. This will show you how to check these and install them.


# Login to the system as root
# Login to the system at the terminal or SSH as root.
# Type <code>yum update</code>
# Type <code>yum update</code>.
# After downloading from the internet, a list may be shown showing the latest updates available. If <code>No Packages marked for Update</code> is shown, there are no updates available right now and you can continue to the next step.
# After downloading the update lists from the internet, a list may be shown showing the latest updates available. If <code>No Packages marked for Update</code> is shown, there are no updates available right now and you can continue to the next step.
# Type <code>y</code> to accept the changes. The updates will then be downloaded and installed. Some packages take a long time to install and the system will look like it has hung. Be patient, they will eventually install.
# If there are updates offered, type <code>y</code> to accept the changes. The updates will then be downloaded and installed. Some packages take a long time to install and the system will look like it has hung. Be patient, they will eventually install.
# It is recommended that once the update is finished, you reboot the machine so that any updates downloaded get used. Type <code>reboot</code>
# It is recommended that once the update is finished, you reboot the machine so that the updates are applied. Type <code>reboot</code>.


=== Updating FreePBX modules ===
=== Updating FreePBX modules ===
# From the dashboard, on the menu bar, go to '''Admin > Module Admin'''.
# Click 'Check Online' to check the internet for updated modules.
# Once done, click 'Upgrade all' on the right-hand side to mark all modules for update.
# Click 'Process' to start updating the modules.
# You will be presented with a list of modules to be updated. Scroll to the bottom and click 'Confirm'
# Some updates take a very long time to complete, please be patient! Avoid refreshing or going back or the server could be left in an inconsistent state.
# Once the current updates are complete, press 'Return' to be taken back to the Module Admin screen.
# Click the red 'Apply Config' button at the top right of the screen.
# Some updates rely on other packages to be updated first. Keep cycling through these steps until there are no more packages to update.
=== Upgrading to FreePBX 16 ===
At the moment, FreePBX 16 is not available separately so we need to upgrade to FreePBX 16 through FreePBX 15. This can only be done once the system is updated. The biggest change of this upgrade is now supporting the modern PHP 7.4 instead of the now legacy and unsupported PHP 5.6.
# From the dashboard, on the menu bar, go to '''Admin > Module Admin'''.
# Click 'Check Online' to check the internet for updated modules.
# Under the 'Admin' section, look for a module called 'PBX Upgrader'.
# Click the > to expand the entry.
# Change 'No Action' to 'Download and Install'.
# Go to the top of the page and on the right-hand side, click 'Process'.
# Click 'Confirm' to install the module.
# Once it has completed, press 'Return' to be taken back to the Module Admin screen.
# Click the red 'Apply Config' button at the top right of the screen.
# On the menu bar, go to '''Admin > 15 to 16 Upgrade Tool'''.
# Click the 'Check the requirements!' button.
# Once it has checked, if all is well, click the 'Proceed to the upgrade process'. If anything comes back with an error, this will need fixing before proceeding.
# Although you have not changed the system yet, it may complain about not using standard repositories. Under 'Non-standard Repository Servers', leave as 'Reset the repos to the defaults.
# Click 'Next'.
# Fill out any details you would like for the survey (this is optional), or press skip.
# Read the warning message and then press 'OK' when ready to upgrade.
# Please be patient, ignore any error messages and do not think the system has hung, this process can take a long time to complete. If the webpage does fail during the upgrade and you cannot access the progress of the upgrade, go to the terminal and type <code>tails -f /var/log/pbx/freepbx16-upgrade.log</code> which should allow you to follow the update. Once done, return to the dashboard.
# Now is a good time to once again reboot the system to apply all the changes.
# Once rebooted, check for module updates as per previous section.
=== Upgrading to the latest Asterisk version ===
Once all the updates have been installed on the distribution, we can upgrade the version of Asterisk to the Asterisk 18 which is the latest version as of writing.
# Login to the system at the terminal or SSH as root.
# From the terminal, type <code>asterisk-version-switch</code>.
# Select the number next to the version that you would like to install - e.g. <code>7</code> for Asterisk 18 then hit enter.
# Wait for the script to run through upgrading Asterisk.
# When returned to the terminal, restart the machine to apply the new changes.

Latest revision as of 23:14, 23 August 2024

FreePBX Distribution is a fully fledged VoIP server allowing complete customisation to your needs and works with most setups. It is an appliance, with a complete Linux setup and web manager to allow easy administration.

We have implemented FreePBX 16 and Asterisk 20. This is the latest version of Asterisk and is a LTS release so will be supported well into the future with fixes (slated to be supported until 2027). This is a complete distribution and so needs to be installed on its own machine/virtual machine. We will be setting this up on a separate virtual machine rather than the main server.

We will be configuring this system to work with the Mitel 5360 IP Phone and the Mitel 5624 VoWiFi phone so some settings are specific to the 53xx models of this phone. We will also be using Twilio as a SIP trunk so some settings are specific for this.

Prerequisites

  • Download the latest FreePBX ISO image. This is currently FreePBX 15 available here directly or at this website. Please do not be phased as at the moment, we will be upgrading to FreePBX 16 once FreePBX 15 is installed.
  • This will need burning to a DVD or writing to a USB stick. We use a USB stick and Rufus under windows to write it to a USB stick (use DD mode). This guide will cover the USB method but the CD method is very similar.

Booting the installation system

  1. Insert the USB stick or DVD into the computer.
  2. Power on the machine.
  3. Press the key to bring up the boot device menu if needed.
  4. Select the USB stick or DVD that is inserted.
  5. When the boot menu appears, select 'FreePBX 15 Advanced Installation'.
  6. Next, select 'Advanced Installation with Normal Video'.
  7. Next, select 'Advanced Install with Asterisk 17 via Standard Video'. Asterisk 17 is the latest available to install from the media but we will upgrade it later. The system will now boot to the Linux installer.

Configuring the FreePBX installation

We will be using a dedicated computer with an empty hard drive. This will be a custom installation so that we can configure the system before it is installed. This guide will show you all the main options that need to be changed - there are other options if you wish to customise the installation but this is what I will be using to install the system.

Setting the date, time and time zone

  1. Click DATE & TIME to select the correct time zone and set the date & time.
  2. In the 'Region:' box, type or select 'Europe'.
  3. In the 'City:' box, change 'Amsterdam' by typing of selecting 'London'.
  4. If you are already connected to a network, ensure that the 'Network Time' switch is 'On'. This is important as this server will be used to set the times on the phones and needs accurate time to function correctly.
  5. We will configure the time servers to use ones closer to us in the UK. Click the cog icon next to the 'On' switch.
  6. We will change the CentOS NTP servers to Google servers. For example, double click on the first address and change 0.centos.pool.ntp.org to time1.google.com. Do this for servers 0-3 and time1-4.
  7. We will add the main server IP address as a source too. This is typed in the top box and then click '+'.
  8. Click 'OK'.
  9. Click 'Done'.

Setting the keyboard layout

  1. Click KEYBOARD.
  2. Click the '+' button to add a new keyboard layout. We must add the new keyboard layout before removing the one we don't want.
  3. Type 'UK' in the search box.
  4. Click 'English (UK)'.
  5. Click 'Add'.
  6. Select 'English (US)' from the list.
  7. Click the '-' button to remove this layout.
  8. You may test the layout in the box on the right. I usually check that the '£' and '#' symbols come up when I press these keys.
  9. Click 'Done'.

Setting language support

  1. Click LANGUAGE SUPPORT.
  2. Tick 'English (United Kingdom).
    • Unfortunately, we cannot deselect 'English (United States)'.
  3. Click 'Done'.

Setting the hard drive partitioning

As this is a new install, we will be configuring FreePBX to use the whole drive. We would like to use the BtrFS file system so this is slightly different to usual.

  1. Click INSTALLATION DESTINATION.
  2. Check that the hard drive we want to use has a tick on it.
  3. Under 'Partitioning', select 'I will configure partitioning'.
  4. Click 'Done'.
  5. Under 'New mount points will use the following partitioning scheme', change 'LVM' to 'Btrfs'.
  6. If there are already any partitions on the disk, you will have to select each one and click '-' on each one until the disk is empty.
  7. We want to use the whole drive. At the top of the list, click 'Click here to create them automatically'. This will automatically create the correct partitions using the whole drive.
  8. Click 'Done'.
  9. A list of what will be done during the installation will appear which you can review. If you are happy, click 'Accept Changes'.

Disable kdump

I have no use for kdump so will be disabling it.

  1. Click KDUMP.
  2. Untick the 'Enable kdump' box.
  3. Click 'Done'.

Setting the network hostname

The rest of the network settings should be OK unless you have something custom to configure. We will just be changing the hostname.

  1. Click NETWORK AND HOSTNAME.
  2. In the hostname box, replace 'freepbx.sangoma.local' to the hostname of your network (for example freepbx.freddythechick.net).
  3. Click 'Apply'.
  4. Click 'Done'.

Starting the installation

  1. If there is any problems preventing installation, there will be a yellow bar at the bottom of the screen saying where the problem is and the section that has the problem will have a yellow exclamation mark. These sections will need fixing before you can continue.
  2. I have added a picture of what the screen should look like for reference once everything is configured.
  3. If you are happy with all of the settings, click 'Begin Installation'.

Entering a root password

The installation will start. While the installation continues, we need to set the root password. This will not stop the installation while you are setting this up but must be done before the installation is finished.

  1. Click ROOT PASSWORD.
  2. Type a password for the root user in the 'Root Password:' box.
  3. Retype the password in the 'Confirm:' box.
  4. Click 'Done'.

This will be an internet facing machine, even more so if exposing SSH so it is HIGHLY RECOMMENDED to type a password that fills the strength bar so that it says Strong. Use a combination of uppercase letters, lowercase letters, numbers and symbols and make the password as long as you can possibly remember. Do not use common words that may be in the dictionary or names. If you do, you will be warned with a yellow bar at the bottom and will be asked to click 'Done' again. It is HIGHLY RECOMMENDED to use a different password if you are warned of this as you will be at risk of attack.

Completing the installation

You will now be back at the installation screen - grab a cup of coffee and wait for the installation to finish.

Once the installation is finished, it will say 'SangomaOS 7.8 is now successfully installed and ready to use! Go ahead and reboot to start using it!'. Click the 'Reboot' button and the machine will reboot to the FreePBX terminal. Remember to remove the DVD/image from the drive!

First run of the web interface

  1. Open a browser on a machine on the same network and go to the IP address of the machine. For example, if the machine is at 192.168.1.45, type http://192.168.1.45 into the address bar. If you are not sure of the address, login to the server as root and it will display the IP address of the machine. This is the first time of using the web interface so we need to set up a few items. Ignore any warnings about the server certificate - this can be set up later.
  2. Type a username into the Username field. Avoid common usernames, such as admin and user as these are easily guessed if your server is attacked.
  3. Type a password into the Password and Confirm Password fields. Make sure this is strong, especially if you plan to make the admin pages web facing at a latter date.
  4. Type an e-mail address into the Notifications Email address field. This is used if there are any critical errors on the server and to inform you of automatic system updates.
  5. You can change the System Identifier to something else if you like, this is especially handy if managing more than one FreePBX server.
  6. Choose your settings to enable automatic updates as you would like for your system.
  7. When done, click 'Setup System' in the bottom right hand corner.
  8. This will take you to the home page for the server. To administer the system, click 'FreePBX Administration' and log in with the details you typed just now.
  9. You will now be asked if you would like to activate the system with Sangoma. This is recommended to activate some of the modules we will be using later. Click 'Activate'.
  10. Type your e-mail address. If you already have an e-mail account with Sangoma, wait a few seconds and type your password when the box comes up. Fill in any missing details if needed then click 'Continue'. If you don't already have an account, you will have to fill in your details and click 'Create'.
  11. Under 'New Activation', type a location and then click 'Activate'. If you are re-installing an already activated system, you can go to 'Existing Deployment' and type the deployment number already activated there.
  12. Once you have clicked 'Activate', it will then display a deployment number. This means it is successfully deployed. The deployment number can be displayed later if needed.
  13. Click 'Skip' on the module updates for now as we need to set up the server first.
  14. Leave Sound Prompts Language as 'English (United Kingdom)' or change this from the drop down menu if wrong.
  15. Leave System Language as 'English (United Kingdom)' or change to this from the drop down menu if wrong.
  16. The Timezone option should already be correct from our installation. If not, it can be corrected here to 'Europe/London'.
  17. Click 'Submit' in the bottom left hand corner. It will take a while as it is starting to setup the system - be patient!
  18. Unless you want to set up the firewall, click 'Abort'.
  19. You may get a few adverts after this - click 'Not Now' to skip them.
  20. Your system is now basically set up - you will be presented with the dashboard.
  21. If there is a red 'Apply Now' button in the top right hand corner, press this to configure the system with the changes just implemented.

Updating the server

Updating using CentOS system updates (OPTIONAL)

The FreePBX distribution is based on CentOS 7.8, however, FreePBX very rarely, if ever, provide updates to the system unless they upgrade the distribution. You can configure the system to update using CentOS repositories for a more up-to-date and secure system.

WARNING: If you are using anything the uses kernel modules (i.e. DAHDI modules), please do not use this method to update - this will cause the modules to break as they rely on the kernel supplied to operate.

I do not use anything that relies on the kernel so shall be applying these updates.

Add the CentOS 7 update repository

  • At the terminal, type the following command:
yum-config-manager --add-repo https://www.mirrorservice.org/sites/mirror.centos.org/7/updates/x86_64/
  • We need to add the GPG key for this repository to be trusted. Type the following command:
gpg --quiet --with-fingerprint /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7

You should see a key displayed.

  • Import the key so the system trusts it, type:
rpm --import /etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
  • We now want to clear the yum cache so that it picks up the new repository. Type:
yum clean all
  • You can now follow the next step to update the system.

General updates

As with any Linux distribution, from time to time there are updates to the system. This will show you how to check these and install them.

  1. Login to the system at the terminal or SSH as root.
  2. Type yum update.
  3. After downloading the update lists from the internet, a list may be shown showing the latest updates available. If No Packages marked for Update is shown, there are no updates available right now and you can continue to the next step.
  4. If there are updates offered, type y to accept the changes. The updates will then be downloaded and installed. Some packages take a long time to install and the system will look like it has hung. Be patient, they will eventually install.
  5. It is recommended that once the update is finished, you reboot the machine so that the updates are applied. Type reboot.

Updating FreePBX modules

  1. From the dashboard, on the menu bar, go to Admin > Module Admin.
  2. Click 'Check Online' to check the internet for updated modules.
  3. Once done, click 'Upgrade all' on the right-hand side to mark all modules for update.
  4. Click 'Process' to start updating the modules.
  5. You will be presented with a list of modules to be updated. Scroll to the bottom and click 'Confirm'
  6. Some updates take a very long time to complete, please be patient! Avoid refreshing or going back or the server could be left in an inconsistent state.
  7. Once the current updates are complete, press 'Return' to be taken back to the Module Admin screen.
  8. Click the red 'Apply Config' button at the top right of the screen.
  9. Some updates rely on other packages to be updated first. Keep cycling through these steps until there are no more packages to update.

Upgrading to FreePBX 16

At the moment, FreePBX 16 is not available separately so we need to upgrade to FreePBX 16 through FreePBX 15. This can only be done once the system is updated. The biggest change of this upgrade is now supporting the modern PHP 7.4 instead of the now legacy and unsupported PHP 5.6.

  1. From the dashboard, on the menu bar, go to Admin > Module Admin.
  2. Click 'Check Online' to check the internet for updated modules.
  3. Under the 'Admin' section, look for a module called 'PBX Upgrader'.
  4. Click the > to expand the entry.
  5. Change 'No Action' to 'Download and Install'.
  6. Go to the top of the page and on the right-hand side, click 'Process'.
  7. Click 'Confirm' to install the module.
  8. Once it has completed, press 'Return' to be taken back to the Module Admin screen.
  9. Click the red 'Apply Config' button at the top right of the screen.
  10. On the menu bar, go to Admin > 15 to 16 Upgrade Tool.
  11. Click the 'Check the requirements!' button.
  12. Once it has checked, if all is well, click the 'Proceed to the upgrade process'. If anything comes back with an error, this will need fixing before proceeding.
  13. Although you have not changed the system yet, it may complain about not using standard repositories. Under 'Non-standard Repository Servers', leave as 'Reset the repos to the defaults.
  14. Click 'Next'.
  15. Fill out any details you would like for the survey (this is optional), or press skip.
  16. Read the warning message and then press 'OK' when ready to upgrade.
  17. Please be patient, ignore any error messages and do not think the system has hung, this process can take a long time to complete. If the webpage does fail during the upgrade and you cannot access the progress of the upgrade, go to the terminal and type tails -f /var/log/pbx/freepbx16-upgrade.log which should allow you to follow the update. Once done, return to the dashboard.
  18. Now is a good time to once again reboot the system to apply all the changes.
  19. Once rebooted, check for module updates as per previous section.

Upgrading to the latest Asterisk version

Once all the updates have been installed on the distribution, we can upgrade the version of Asterisk to the Asterisk 18 which is the latest version as of writing.

  1. Login to the system at the terminal or SSH as root.
  2. From the terminal, type asterisk-version-switch.
  3. Select the number next to the version that you would like to install - e.g. 7 for Asterisk 18 then hit enter.
  4. Wait for the script to run through upgrading Asterisk.
  5. When returned to the terminal, restart the machine to apply the new changes.