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.
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.
Version table:
5:20.10.17~3-0~ubuntu-focal 500
500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
5:20.10.16~3-0~ubuntu-focal 500
500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
5:20.10.15~3-0~ubuntu-focal 500
500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
5:20.10.14~3-0~ubuntu-focal 500
500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
5:20.10.13~3-0~ubuntu-focal 500
500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
5:20.10.12~3-0~ubuntu-focal 500
500 https://download.docker.com/linux/ubuntu focal/stable amd64 Packages
● docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: active (running) since Sun 2022-09-04 16:04:27 UTC; 13s ago
TriggeredBy: ● docker.socket
Docs: https://docs.docker.com
Main PID: 3264 (dockerd)
Tasks: 7
Memory: 29.8M
CGroup: /system.slice/docker.service
└─3264 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
Sep 04 16:04:27 ubuntu2004 dockerd[3264]: time="2022-09-04T16:04:27.555173170Z" level=warning msg="Your kernel does not support CPU realtime >
Sep 04 16:04:27 ubuntu2004 dockerd[3264]: time="2022-09-04T16:04:27.555196177Z" level=warning msg="Your kernel does not support cgroup blkio >
Sep 04 16:04:27 ubuntu2004 dockerd[3264]: time="2022-09-04T16:04:27.555270124Z" level=warning msg="Your kernel does not support cgroup blkio >
Sep 04 16:04:27 ubuntu2004 dockerd[3264]: time="2022-09-04T16:04:27.555772301Z" level=info msg="Loading containers: start."
Sep 04 16:04:27 ubuntu2004 dockerd[3264]: time="2022-09-04T16:04:27.719676988Z" level=info msg="Default bridge (docker0) is assigned with an >
Sep 04 16:04:27 ubuntu2004 dockerd[3264]: time="2022-09-04T16:04:27.804973724Z" level=info msg="Loading containers: done."
Sep 04 16:04:27 ubuntu2004 dockerd[3264]: time="2022-09-04T16:04:27.834543443Z" level=info msg="Docker daemon" commit=a89b842 graphdriver(s)=>
Sep 04 16:04:27 ubuntu2004 dockerd[3264]: time="2022-09-04T16:04:27.834895532Z" level=info msg="Daemon has completed initialization"
Sep 04 16:04:27 ubuntu2004 systemd[1]: Started Docker Application Container Engine.
Sep 04 16:04:27 ubuntu2004 dockerd[3264]: time="2022-09-04T16:04:27.878373838Z" level=info msg="API listen on /run/docker.sock"
#### 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
<xmp>Pulling freepbx-db (tiredofit/mariadb:)...
latest: Pulling from tiredofit/mariadb
59bf1c3509f3: Pull complete
e887546d6053: Pull complete
3dace326c0ec: Pull complete
ea97c706ca03: Pull complete
f908583427a3: Pull complete
Digest: sha256:9a2b1332bc6b0775765d8ae43e94646d4f5b97d2c5af4d246ab82042241f1517
Status: Downloaded newer image for tiredofit/mariadb:latest
Pulling freepbx-db-backup (tiredofit/db-backup:)...
latest: Pulling from tiredofit/db-backup
213ec9aee27d: Pull complete
0a34d2f2b45d: Pull complete
4dd70801aef3: Pull complete
f471a1502016: Pull complete
bdd9d308f2cc: Pull complete
Digest: sha256:0a49053ee9164087696bf646a453de194debb652bb654e4452c75efa4b1c6661
Status: Downloaded newer image for tiredofit/db-backup:latest
Creating freepbx-db ... done
Creating freepbx-app ... done
Creating freepbx-db-backup ... done
<xmp>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
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
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.