Run on Docker?

is it a good idea to use Freepbx in a docker?

I have install it from this

[הקלידו או הדביקו קוד כאן](

and the server is up after running this command :

docker run -d -p 80:80 -p 443:443 -p 4445:4445 -p 4569:4569 -p 5060:5060 -p 5160:5160 -p 8001:8001 -p 8003:8003 -p 8008:8008 -p 8009:8009 --name test1 tiredofit/freepbx

but I can’t connect to server with my sip phone

then I saw I can make a yml file with all the setting
so I have create a file called docker-compose.yml

version: '3.3'
    image: flaviostutz/freepbx
      - 80:80
      - 5060:5060/udp
      - 5160:5160/udp
      - 3306:3306
      - 18000-18100:18000-18100/udp
    restart: always
      - ADMIN_PASSWORD=admin123
      - backup:/backup
      - recordings:/var/spool/asterisk/monitor


then I saw I need to run

docker-compose up -d

but now it won’t start

docker-compose up
Starting ubuntu_freepbx_1 ... done
Attaching to ubuntu_freepbx_1
freepbx_1  | iptables v1.8.2 (legacy): can't initialize iptables table `filter': Permission denied (you must be root)
freepbx_1  | Perhaps iptables or your kernel needs to be upgraded.
freepbx_1  | For enabling fail2ban you have to run this container with 'privileged: true'

  1. what did I do wrong while running the yml file?
  2. what am I missing in the ports ?
  3. is it a good idea to run FreePBX on docker?


I wouldn’t, but add this to your yaml file and try again just for the sake of argument: privileged: true

I will
but how do the docker “know” to use this ymal file ?
what if I have created 2 files?
** asking to understand


^^^ the errors often tell you what the error is.

Neither FreePBX or Asterisk are designed with Dockers/Containers in mind. Can it be done? Sure. Is it going to be supported or recommended? Not really. Will there be issues that will be related to this? Oh yes, there will be.

good to know

Thank you for the asnwers

When you’re in the directory in which the yaml file is and you run “docker-compose up -d” it automatically does everything for you. The file is called “Dockerfile” and there can be only one file in the directory.

Thank you

there ARE notes from astricon like… 2019 or 2020 explicitly about running FreePBX on docker haha

Yeah, I am sure there are. Things can be used in ways they aren’t designed for. So can it be done? Sure. Is it the best option? No.

You can run Asterisk on your router, doesnt mean it is a good way to do it.

but can it play Doom?

1 Like

The infamous ward mundy use to play a game with every new device called will it run trixbox then later piaf… Ususally through the genius or insanity of one or more of his community members they made many “smart” devices in to a pbx…

That always brings up

It is OpenWRT so the chances are high. I wouldn’t know, I don’t use it.

Still does. One of the latest is Debian in WSL2 on Win11 systems.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.