How to Setup FreePBX using Docker (Build FreePBX Docker Container). In this post, we will introduce FreePBX, it’s features, major advantages. After that we will move onto the FreePBX installation phase with Docker.
First of all what is a PBX or Private Branch Exchange? A telephone hardware system available within a business that allows call switching between users on local phone lines whilst enabling them to share a fixed number of external lines.
So let’s start with our article How to Setup FreePBX using Docker (Build FreePBX Docker Container).
Firstly PBX is an acronym for Private Branch Exchange. FreePBX is basically a phone system that you can install on your virtual machine. It plays an important role in managing asterisk. What is asterisk? Simply put a communication server and is open sourced. Instead of using their own phone system and interface and paying an optimum 100 dollars a month, users can use FreePBX to manage their PBX.
Moreover FreePBX works as a medium of communication between the customers and the office. What it does, it greets the customers in a warm manner to make them feel comfortable and then directs the call to the desired branch or section of the office depending on the customers’ query.
Asterisk allows us to convert an ordinary computer to a communication server using . It is a software implementation of a telephone private branch exchange (PBX), allowing connected telephones to call each other and then connect to other telephone services such as the public switched telephone network (PSTN) and Voice over Internet Protocol (VoIP) services.
Users can download FreePBX for free but need to have the skillset and the knowledge to set it up and maintain it. You will require an ISTP (Internet Telephony Service Provider) to make calls through FreePBX.
In simple words, Asterisk is a multiple line system allowing communication inside offices within branches through different extensions. Existence of internal extensions lead to sharing of outgoing lines for communication with users or employees inside or outside the office space.
Equally FreePBX comes packed with a lot of other features such as: Business Features, Calling Features and Telephony Support.
Business features includes features like conference bridge, IVR, video calling, text to speech, announcements, ring groups etc.
Calling features include: call recording, call transfers, call waiting, blacklisting of callers, call history, voicemail to email, three way calling support.
Whereas the telephony support features are: desktop support, speciality device support, WebRTC, POTS/ISDN, SIP and PJSIP.
Importantly FreePBX system can fill in as an extra employee, if the need arises. This is one of the most important benefits of using FreePBX. Developed over time to keep in mind the needs and developments.
FreePBX has numerous advantages, some of them are listed below:
Vast language support
This advantage of FreePBX allows users to pick their local language on a one to one basis. Further it enables the users to keep their phone system up irrespective of the location of the users across the globe.
Fully equipped WebGUI
Features like WebGUI presents multiple calibrated features like extension development, IVRs, restore and backup, user permissions, time conditions and firewall.
Vast list of unique features
Add on features like high availability and call centre bundles are also provided alongside a 25 year license. That maintains credibility and reliability for business development.
Low Cost
Cost of FreePBX have an edge over expensive and other difficult to use solutions. So reliable FreePBXs can recover the cost in no time.
No limitations on licensing
There is no specific limit as to number of users, IVRs to be built, queues etc.
Flexible
Flexibility of FreePBX works with almost all the commercially available virtual machines and hardware. Additionally it also works with more than 200 endpoints because of its wide usage across the globe. Can be paired with any IP phone or conferencing solution that you already own.
Reliable and secure
Due to its in house testing and checks, the quality of security is top notch. It goes through rigorous testing process before being rolled out to the general public. What is more it also gets regular updates to improve the stability of the system.
Automatic response system
FreePBX has an automatic response solution through which the user can be directed and forwarded to a specific branch by just pressing a number.
Advancement in technology
With time, a huge advancement in the technology by the means of various updates, can be seen. This allows the users to personalise the system better according to their needs.
Now it is time for the main part of the article about How to Setup FreePBX using Docker .
A server running Ubuntu or Debian operating system.
A root user or a user with sudo privileges.
Add Docker Repository
By default, the latest version of Docker is not included in the Ubuntu default repo. So you will need to add the Docker CE official repository to the APT.
First, install all the required dependencies using the following command:
Firstly, create a directory to store the Docker Compose file:
mkdir app
Next, navigate to the created directory and create a Docker Compose file for FreePBX:
cd app
nano docker-compose.yaml
Add the following code:
version: '2'
services:
freepbx-app:
container_name: freepbx-app
image: tiredofit/freepbx
ports:
#### If you aren't using a reverse proxy
- 80:80
#### If you want SSL Support and not using a reverse proxy
#- 443:443
- 5060:5060/udp
- 5160:5160/udp
- 18000-18100:18000-18100/udp
#### Flash Operator Panel
- 4445:4445
volumes:
- ./certs:/certs
- ./data:/data
- ./logs:/var/log
- ./data/www:/var/www/html
### Only Enable this option below if you set DB_EMBEDDED=TRUE
#- ./db:/var/lib/mysql
### You can drop custom files overtop of the image if you have made modifications to modules/css/whatever - Use with care
#- ./assets/custom:/assets/custom
environment:
- VIRTUAL_HOST=hostname.example.com
- VIRTUAL_NETWORK=nginx-proxy
### If you want to connect to the SSL Enabled Container
#- VIRTUAL_PORT=443
#- VIRTUAL_PROTO=https
- VIRTUAL_PORT=80
- ZABBIX_HOSTNAME=freepbx-app
- RTP_START=18000
- RTP_FINISH=18100
## Use for External MySQL Server
- DB_EMBEDDED=FALSE
### These are only necessary if DB_EMBEDDED=FALSE
- DB_HOST=freepbx-db
- DB_PORT=3306
- DB_NAME=asterisk
- DB_USER=asterisk
- DB_PASS=asteriskpass
### If you are using TLS Support for Apache to listen on 443 in the container drop them in /certs and set these:
#- TLS_CERT=cert.pem
#- TLS_KEY=key.pem
restart: always
networks:
- proxy-tier
### These final lines are for Fail2ban. If you don't want, comment and also add ENABLE_FAIL2BAN=FALSE to your environment
cap_add:
- NET_ADMIN
privileged: true
freepbx-db:
container_name: freepbx-db
image: tiredofit/mariadb
restart: always
volumes:
- ./db:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=password
- MYSQL_DATABASE=asterisk
- MYSQL_USER=asterisk
- MYSQL_PASSWORD=asteriskpass
networks:
- proxy-tier
freepbx-db-backup:
container_name: freepbx-db-backup
image: tiredofit/db-backup
links:
- freepbx-db
volumes:
- ./dbbackup:/backup
environment:
- ZABBIX_HOSTNAME=freepbx-db-backup
- DB_HOST=freepbx-db
- DB_TYPE=mariadb
- DB_NAME=asterisk
- DB_USER=asterisk
- DB_PASS=asteriskpass
- DB_DUMP_FREQ=1440
- DB_DUMP_BEGIN=0000
- DB_CLEANUP_TIME=8640
- COMPRESSION=BZ
- MD5=TRUE
networks:
- proxy-tier
restart: always
networks:
proxy-tier:
external:
name: nginx-proxy
Save and close the file then create a Docker network for Nginxproxy:
You can verify the all downloaded images using the following command:
docker images
You should get the following output:
REPOSITORY TAG IMAGE ID CREATED SIZE
tiredofit/db-backup latest fbb26eb96e30 2 weeks ago 521MB
tiredofit/mariadb latest 158d51d45d6f 6 months ago 420MB
tiredofit/freepbx latest e98ede842e6d 17 months ago 2.05GB
Next, verify all running containers using the following command:
docker ps
You should see the following output:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
bb06e45b3ddd tiredofit/db-backup "/init" 37 seconds ago Up 37 seconds 2020/tcp, 10050/tcp freepbx-db-backup
e7d8d9dbd2d1 tiredofit/freepbx "/init" 39 seconds ago Up 33 seconds 80/tcp, 443/tcp, 4569/tcp, 0.0.0.0:5060->5060/udp, :::5060->5060/udp, 5061/tcp, 5161/tcp, 8001/tcp, 8003/tcp, 8008-8009/tcp, 8025/tcp, 0.0.0.0:5160->5160/udp, :::5160->5160/udp, 10050/tcp, 0.0.0.0:4445->4445/tcp, :::4445->4445/tcp, 0.0.0.0:18000-18100->18000-18100/udp, :::18000-18100->18000-18100/udp, 18101-20000/udp freepbx-app
c60189d931bf tiredofit/mariadb "/init" 39 seconds ago Up 37 seconds 2020/tcp, 3306/tcp, 10050 tcp freepbx-db
1. Now, open your web browser and access the FreePBX container using the URL http://your-server-ip/admin/config.php. You should see the admin password setup screen:
2. Define your admin username, password and click on the SetupSystem button. You should see the following screen:
3. Click on the FreePBX Administration. You should see the FreePBX login screen:
4. Provide your admin username, password and click on the Continue button. You should see the FreePBX language selection page:
5. Click on the Submit button. You should see the FreePBX dashboard on the following screen:
Thank you for reading How to Setup FreePBX using Docker. We shall conclude.
How to Setup FreePBX using Docker (Build FreePBX Docker Container) Conclusion
In this post, we explained how to build and run FreePBX using the Docker and Docker Compose. You can now host your own telephone system in your organizations. Summarizing FreePBX makes it easier for us by providing with pre programmed features available through a user friendly web interface that allows us to have a fully functional PBX almost instantly with no programming required.
I am a fan of open source technology and have more than 10 years of experience working with Linux and Open Source technologies. I am one of the Linux technical writers for Cloud Infrastructure Services.
51vote
Article Rating
Subscribe
Login and comment with
I allow to create an account
When you login first time using a Social Login button, we collect your account public profile information shared by Social Login provider, based on your privacy settings. We also get your email address to automatically create an account for you in our website. Once your account is created, you'll be logged-in to this account.
DisagreeAgree
Login and comment with
I allow to create an account
When you login first time using a Social Login button, we collect your account public profile information shared by Social Login provider, based on your privacy settings. We also get your email address to automatically create an account for you in our website. Once your account is created, you'll be logged-in to this account.