Skip to content

Usage

Prerequisites

  • Docker and Docker Compose (docker-compose or the docker compose plugin) on the host.
  • A host willing to run a privileged container — this setup needs --privileged and an unconfined seccomp profile for systemd to manage services inside the container.

1. Clone the repository and build the image

git clone https://codeberg.org/Spoljarevic/FreePBX-17-Container.git
cd FreePBX-17-Container
sudo docker-compose build

The build stage (see Code Explanation) only installs the OS-level prerequisites and copies in the install script — FreePBX itself is not installed at build time.

2. Start the container

sudo docker-compose up -d

This starts the freepbx17 container with systemd as PID 1, which brings up the base OS services the FreePBX installer will need.

3. Run the FreePBX installer inside the container

Open a shell in the running container:

sudo docker exec -it freepbx17 bash

Then run Sangoma’s install script:

bash sng_freepbx_debian_install.sh --skipversion

--skipversion skips the script’s own version check, which is otherwise chatty inside a container. The install script pulls in and configures Asterisk, MariaDB, and the FreePBX web UI itself — expect this step to take a while and generate a lot of output. It logs to /var/log/pbx/ inside the container if you need to review it afterwards.

Note

Run these steps in order: build, then start, then install. The install script assumes it’s running inside an already-booted, systemd-managed OS, which is only true once the container is actually up.

4. Access FreePBX

Once the installer finishes, the FreePBX web UI is reachable at the ports mapped in docker-compose.yml:

  • http://<host>:8060 / https://<host>:4436 — the FreePBX admin web UI (mapped from the container’s 80/443).
  • 5060/udp, 5160/udp, 18000-18100/udp — SIP signaling and RTP media ports, for registering phones or trunks against the PBX.

The first visit to the web UI walks you through creating the initial admin account.

Persistent data

Three named Docker volumes carry FreePBX’s actual state across container rebuilds:

VolumeMounted atContents
freepbx_www/var/www/htmlThe FreePBX web application itself.
freepbx_etc/etc/asteriskAsterisk’s configuration.
mysql_data/var/lib/mysqlThe MariaDB database (CDR, extensions, module config, etc).

As long as these volumes survive, you can recreate the container (docker-compose up -d --force-recreate) without losing configuration or call data.

Resetting everything

The docker script at the repo root is a blunt, host-wide reset — it stops and removes every container, image, and unused volume/network on the machine, not just this project’s:

sudo bash docker

Only run it if you actually want to wipe all Docker state on the host, not just this project.

Last updated on