FreePBX 15 debian buster - debian asterisk package

(Michael Schefczyk) #1

Dear All,

I find the idea of installing FreePBX 15 on debian buster ( very attractive. In general, I do not need very many modules. CentOS 7 is fading out and CentOS 8 seems to bring more troubles than advantages compared to 7.

I did try to get FreePBX 15 installed based on self-compiled asterisk. While compiling asterisk on CentOS has always worked in cases when I did not use the distribution, it did not seem that easy on debian. While I did try (on the side, on and off over some weeks), the distribution upgraded the Asterisk 16 version. Trying to compile the new version on debian, the system did show the new version in the CLI, but the web interface did stick to the previous version. I did not find that very convincing. Thus, I got interested in the idea of using the debian package. They are usually very solid and I was curious to find out what that might mean for mp3 and jansson integration. However, I could neither get this working when trying to replace the self-compiled aterisk by the debian package nor on a fresh install.

The output is:

root@asteriskb72:/usr/src/freepbx# ./start_asterisk start

Asterisk Started
root@asteriskb72:/usr/src/freepbx# service mysql start
root@asteriskb72:/usr/src/freepbx# ./install -n
Assuming you are Database Root
Checking if SELinux is enabled…Its not (good)!
Reading /etc/asterisk/asterisk.conf…Done
Checking if Asterisk is running and we can talk to it as the ‘asterisk’ user…Error!
Error communicating with Asterisk. Ensure that Asterisk is properly installed and running as the asterisk user
Asterisk appears to be running as asterisk
Try starting Asterisk with the ‘./start_asterisk start’ command in this directory

I did start with start_asterisk start, it does seem to run as user asterisk, but freepbx cannot talk to asterisk.

Can someone please help me over that hurdle?


Michael Schefczyk


I am running FreePBX 15 / Asterisk 16 from repo on Debian 10.

If you install from repo, you need to adjust the /etc/asterisk/asterisk.conf file and remove the sample configs as described in the wiki.

cd /etc/asterisk

sudo mkdir DIST

sudo mv * DIST

sudo cp DIST/asterisk.conf .

sudo sed -i 's/(!)//' asterisk.conf

sudo touch modules.conf

sudo touch cdr.conf

(Michael Schefczyk) #3

Dear billsimon,

I did run the commands listed in the wiki. In addition I did try a variant of asterisk.conf with reduced entries. The result was always the same: The error message says: “Error communicating with Asterisk.” The error advice is to start with ./start_asterisk start - which is what I did.

Is there anything else one can try?




It’s saying that because it cannot make a connection to the manager interface (tcp/5038 configured in /etc/asterisk/manager.conf). The install script should put an appropriate manager config in place so that it can connect to asterisk. You’ll have to troubleshoot a bit and figure out why it’s not connecting.

(Michael Schefczyk) #5

Dear billsimon,

Thanks again! Following the steps in the wiki, my system did not have a manager.conf in /etc/asterisk at all. That was moved to the DIST subdirectory. I did create the following manager.conf file, based on manager.conf of a running machine plus using the default (?) password “amp110”:

; AMI - Asterisk Manager interface
; FreePBX needs this to be enabled. Note that if you enable it on a different IP, you need
; to assure that this can’t be reached from un-authorized hosts with the ACL settings (permit/deny).
; Also, remember to configure non-default port or IP-addresses in amportal.conf.
; The AMI connection is used both by the portal and the operator’s panel in FreePBX.
; FreePBX assumes an AMI connection to localhost:5038 by default.
enabled = yes
port = 5038
bindaddr =
displayconnects=no ;only effects 1.6+

secret = amp110
read = system,call,log,verbose,command,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate,message
write = system,call,log,verbose,command,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate,message
writetimeout = 5000

#include manager_additional.conf
#include manager_custom.conf

Unfortunately, this did not cut it either.



(Michael Schefczyk) #6

The error was to follow this:
and set ALWAYS_SET_PATH yes in /etc/login.defs

That did cause a path problem for asterisk accessing node.


No offense to the other wiki contributor but his edits added numerous errors and a great deal of confusion to the wiki page I originally put together documenting the setup of FreePBX 15 on Debian 10.

A “clean” version before edits: See update below.

In here I specify that you should log in as root or use sudo su - to get a root login shell, which would have saved you from the headache.



I reverted the wiki to the known working version from December and then ran through the installer. Good news!

  • You no longer have to build the ODBC connector. It’s now included in the standard Buster repo as package odbc-mariadb (added to the end of the long apt-get command)
  • UCP/WebRTC no longer needs to be installed from the edge repo. It works fine from the standard repo.

The install is very smooth and gets you a working FreePBX 15 / Asterisk 16 system on Debian 10 and PHP 7.3 in 15 minutes.

(Jozef Riha) #9

Hello, I am the author of the edits and find it a bit disappointing to see the page reverted without any prior discussion or at least an explanation in comment. I acknowledge not everything was perfect with my modifications to the page - yet I was able to repeatedly install and configure Asterisk on a fresh Debian system.

Anyway, I’d like to ask @billsimon what he finds wrong about:

  • setting a Debian to a specific role
  • using apt instead of apt-get
  • instructions for arm architecture (no, not everybody’s using Asterisk on x86_64)
  • using a dedicated non-root account for configure (I am a system admin and am quite wary about the possible implications of working as root all the time)

Cheers! jose

(Michael Schefczyk) #10

Dear billsimon,

Thank you very much. Please consider three thoughts:

  • odbc-mariadb needs to be installed from debian-backports. That should be mentioned.

  • The ALWAYS_SET_PATH issue hurts even when installing as root. Deviating from the previous version of the wiki, I did skip creating a separate install user and the problem did hit anyway.

  • When neither asterisk nor odbc-mariadb are compiled, the build tools are no longer required, I think. That would make the setup even more efficient and more suitable for slim embedded platforms (PC Engines APU2, RaspberryPi)

I would also very much welcome feedback on two questions:

  1. It would be super nice to restore a backup from the distro on a debian system. However, it seems to write to /var/lib/asterisk/ and that has different contents when comparing the distro (Asterisk 13 in my case) and debian asterisk package. Is there a way do backup just the main configuration in FreePBX 15 for this scenario?

  2. File format converters for the softphone in UCP seem to be a pain almost universally. Is this why the debain package of ffmpeg needs to be replaced by the version from the John Van Sickle website?




Jozef, similarly, I would ask why my work was so heavily modified without collaboration. Ultimately folks are here on the forum asking about the wiki page and I was not able to answer their questions based on your work. So I have reverted it and run through the install again, updating the instructions in a few small places and ensuring it works exactly as described. If anyone has questions about the instructions in their current form, I am able and glad to help.

About the points you raised,

Not necessary; I am specifying that you should start from a base install of Debian 10.

Fine, just semantics.

Agree; but if different enough from x86 this should be a separate document

Don’t work as root all the time. :slight_smile: Just during this initial install. Afterward, set up a user account with sudo privileges and work that way.



You are correct and I will add this to the wiki. I launched a fresh Debian 10 instance on Digital Ocean and didn’t realize the backports repo was listed by default.

I didn’t encounter this and am not sure why it is affecting you.

You are likely correct; these were in from when I was building odbc-mariadb. If you have time to test a fresh install without these, please report back. Otherwise, I will do so myself when I get a moment.

No; the packaged version would probably be ok, but when I was installing it I found that it had a huge number of dependencies. I decided on the static build of ffmpeg instead, for simplicity.

(Edit: to remind myself what the issue was, I started a fresh Debian 10 instance and did apt install ffmpeg resulting in a giant list and…

After this operation, 400 MB of additional disk space will be used.
Do you want to continue? [Y/n] 

My answer is definitely “No.”)

(Jozef Riha) #13

Jozef, similarly, I would ask why my work was so heavily modified without collaboration.

I really don’t deem my changes as being so substantive. If you open both versions side by side you’ll realize my changes were based on top of your work - formatting was improved and only couple of notes were added here and there (which I found useful while following your instructions). While I was mostly adding stuff you just threw everything away. Maybe you felt insulted that someone did not ask for written permission. Well… I surely did not meant to hurt your feeling. And granted, I am done with my edits here on this wiki

Not necessary; I am specifying that you should start from a base install of Debian 10.

Right, but how about folks who already have a working Debian system and are not wishing to start all over again? Was this such a biggie to leave it there?

Agree; but if different enough from x86 this should be a separate document

The only difference is (was) the omdb connector compilation - one paragraph that is.

Don’t work as root all the time. :slight_smile: Just during this initial install. Afterward, set up a user account with sudo privileges and work that way.

So why not to add this useful tip to the page?

Take care, jose


Or maybe you should add your own alternative recipe without editing someone else’s unilaterally (that’s just not kosher, adding your comments or suggestions is fine though)

(Thank you Bill for Simonizing it)


Jose, please understand, these minor things were not the issue. The issue is that somewhere in your edits, things broke. People came here saying the instructions didn’t work, and when I went to look at them, they looked unfamiliar. You are saying the changes were minor, which is true in terms of number of words added, but working within a login shell (sudo su -) compared with running commands using sudo is actually very different, just as one example.

Should I have followed the instructions myself and debugged them, or reverted to a set of instructions that I knew would work? I acknowledge it would have been more polite to move forward rather than back, but I did not know you before today (since you just joined the forum) otherwise we might have collaborated on the issues. As it was I chose to revert to what I knew and move forward from there. Sorry for undoing your work.

(Lorne Gaetz) #16


You may wish to maintain your own wiki page since you have a different method of installation. If so, the current method of community contributed docs is outlined here: FreePBX Community Documentation

The version of the page prior to today’s edits is archived here.


I’ve never understood the sudo dogma. Sudo as a tool for a specific command is fine. A page full of sudo commands is crazy. The idea that it is somehow more secure is a fallacy.

Over the years I’ve seen many more problems caused by sudo users than root users.

(Michael Schefczyk) #18

Dear billsimon,

I did check a fresh install based on an ansible script. With my script, I did install the following packages:

buster: acct apache2 aide arpwatch asterisk asterisk-flite asterisk-moh-opsound-wav asterisk-mp3 auditd cockpit debsums ffmpeg flite git ifenslave libapache2-mod-evasive libapache2-mod-security2 libicu-dev libpam-cracklib lm-sensors mariadb-client mariadb-plugin-connect mariadb-server monitoring-plugins-standard mpg123 nagios-nrpe-server net-tools nfs-common nodejs npm ntp php php-cli php-curl php-gd php-intl php-mbstring php-mysql php-pear pkg-config postfix rkhunter smartmontools sox sqlite3 ufw unattended-upgrades unixodbc uuid

buster-backports: odbc-mariadb

from buster for localization: asterisk-prompt-[language]

This seems to provide a working setup without compiling and without additional build packages.

The only issue I am having is that on the dashboard netmon is emty: Browser cannot cnnect to admin/ajax.php?module=dashboard&command=netmon That is probably something one can just leave as it is.

Furthermore, I gave up on trying the WebRTC phone in ucp. I think that connecting via a standalone softphone like linphone from any platform is just simpler.




I have seen that behavior on the dashboard when the server does not have a fully qualified domain name. Try setting one with hostname or in /etc/hosts.

(Michael Schefczyk) #20

Dear billsimon,

I have decided to exclude libapache2-mod-evasive from my configuration. That does create substantial trouble for example for bulk imports. External website access is blocked anyway.