How to setup FreePBX on Azure/AWS/GCP
FreePBX is a web-based open source GUI (graphical user interface) that controls and manages Asterisk (PBX), an open source communication server. FreePBX is licensed under the GNU General Public License (GPL), an open source license. This solution is a pre-configured FreePBX Distro that includes the system OS (Ubuntu), Asterisk, FreePBX GUI and assorted dependencies. Deploy the server straight into your cloud environment from the links below.
Getting Started
Once your FreePBX server has been deployed, the following links explain how to connect to a Linux VM:
- How to connect to a Linux VM on Azure
- How to connect to a Linux VM on AWS
- How to connect to a Linux VM on GCP
Once connected and logged in, the following section explains how to configure FreePBX to get you up and running.
Setup FreePBX
To get started we need to make the following configuration changes. All commands need to be run as root. Run the following command to switch to the root user:
sudo -i
Copy and paste the following into your terminal and hit enter:
cat <<EOF > /etc/odbcinst.ini
[MySQL]
Description = ODBC for MySQL (MariaDB)
Driver = /usr/local/lib/libmaodbc.so
FileUsage = 1
EOF
Then copy and paste the following into your terminal and hit enter:
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
EOF
Then run the following commands to start the setup:
cd /usr/src
wget http://mirror.freepbx.org/modules/packages/freepbx/freepbx-15.0-latest.tgz
tar vxfz freepbx-15.0-latest.tgz
rm -f freepbx-15.0-latest.tgz
touch /etc/asterisk/{modules,cdr}.conf
cd freepbx
./start_asterisk start
./install -n
You should see the following message, if it has been successful:
Next we need to install Postfix, so we can configure your email alerts:
apt-get install postfix
Instructions on configuring SMTP alerts take a look at the following guide:
https://wiki.freepbx.org/display/PPS/Setup+Postfix+Manually
Access the GUI
Once the above has been configured, you are now ready to login. Get the IP address of your VM and paste into your browser and you should see the following. Setup a new admin account to login:
Once you have logged in, perform the following steps:
- Click Apply Config on the top right corner when completed loading.
- Goto Admin manu click Module Admin.
- Click Check online.
- Click Download all.
- Click Process.
- Goto bottom click Confirm. Now you see all package start download and install.
- Click Return.
- Finally click Apply Config on the top right corner.
Now enjoy your FreePBX server.
FreePBX Ports
You will need to make sure that if you have any firewalls in your environment (security groups) that the required ports are open. For a full list check the following link:
https://wiki.freepbx.org/display/PPS/Ports+used+on+your+PBX
To setup AWS firewall rules refer to – AWS Security Groups
To setup Azure firewall rules refer to – Azure Network Security Groups
To setup Google GCP firewall rules refer to – Creating GCP Firewalls
Documentation / Support
For documentation on how to start using FreePBX, take a look at their official documentation:
https://wiki.freepbx.org/display/FPG/Configuring+Your+PBX
Disclaimer: This solution is built using FreePBX. FreePBX is a registered trademark of Sangoma Technologies Inc and is licensed under the GPL. No warrantee of any kind, express or implied, is included with this software. Use at your risk, responsibility for damages (if any) to anyone resulting from the use of this software rest entirely with the user. The author is not responsible for any damage that its use could cause.
FreePBX Support
For any support or issues you are experiencing have a look at FreePBX support forum:
FAQ
Q) I’m trying to get your Azure Freepbx VM to work. It seems fine until you stop the vm and restart and then Freepbx reports it can’t connect to asterisk
A) Sounds like you just need to start asterisk. If you login via your ssh terminal and run the following commands:
cd /usr/src
cd freepbx
./start_asterisk start
Andrew Fitzgerald
If after a reboot you find FreePBX is not connecting to Asterisk. Login via your SSH terminal and run the following to start Asterisk:
cd /usr/src
cd freepbx
./start_asterisk start