Proxmox 8 FreePBX LXC container

I have FreePBX running in a VM on a Proxmox 8 server in the cloud.
It does work, but the web interface is a bit sluggish. I believe it would be way better (or at least use less disk space, as I have a limited amount of it) if it ran as a LXC container.

I have not found any recent topics about it (most of them are a few years old). Since the typically selected centos is now dead, what would be a choice for a base? Maybe Debian? I assume that there are no pre-built containers for the FreePBX ?


Since this action does not seem to be very popular, I will just post updates here, so if anyone need to do the same can save some time researching.

I followed this to set up and install a container:

It is way smaller than the VM, and is faster.
However, there are some drawbacks:

  • FreePBX cannot be registered, as sysadmin package does not work on non redhat distros.
  • Firewall does not work
  • Dashboard shows this error: “Failed to copy from module agi-bin” - not sure yet what this does and if I need it.

In case the original page disappears in the future, here is the list of commands:

create a Debian11 core container, uncheck firewall checkbox in network.
apt-get update
apt-get upgrade
apt install -y util-linux apache2 mariadb-server mariadb-client php php-curl php-cli php-pdo php-mysql php-pear php-gd php-mbstring php-intl php-bcmath curl sox mpg123 lame ffmpeg sqlite3 git unixodbc sudo dirmngr postfix asterisk odbc-mariadb php-ldap nodejs npm pkg-config libicu-dev
systemctl stop asterisk
systemctl disable asterisk
cd /etc/asterisk
mkdir DIST
mv * DIST
cp DIST/asterisk.conf .
sed -i ‘s/(!)//’ asterisk.conf
touch modules.conf
touch cdr.conf
sed -i ‘s/(^upload_max_filesize = )./\120M/’ /etc/php/7.4/apache2/php.ini
sed -i 's/(^memory_limit = ).
/\1256M/’ /etc/php/7.4/apache2/php.ini
sed -i ‘s/^(User|Group).*/\1 asterisk/’ /etc/apache2/apache2.conf
sed -i ‘s/AllowOverride None/AllowOverride All/’ /etc/apache2/apache2.conf
a2enmod rewrite
systemctl restart apache2
rm /var/www/html/index.html
cat < /etc/odbcinst.ini
Description = ODBC for MySQL (MariaDB)
Driver = /usr/lib/x86_64-linux-gnu/odbc/
FileUsage = 1
( at this point, the file will be saved.)
cat < /etc/odbc.ini
Description = MySQL connection to ‘asteriskcdrdb’ database
Driver = MySQL
Server = localhost
Database = asteriskcdrdb
Port = 3306
Socket = /var/run/mysqld/mysqld.sock
Option = 3
( at this point, the file will be saved.)
cd /usr/local/src
tar zxvf freepbx-16.0-latest.tgz
cd /usr/local/src/freepbx/
./start_asterisk start
./install -n
fwconsole ma installall
fwconsole reload
cd /usr/share/asterisk
mv sounds sounds-DIST
ln -s /var/lib/asterisk/sounds sounds
fwconsole restart
cat < /etc/systemd/system/freepbx.service
Description=FreePBX VoIP Server
ExecStart=/usr/sbin/fwconsole start -q
ExecStop=/usr/sbin/fwconsole stop -q
( at this point, the file will be saved.)
systemctl daemon-reload
systemctl enable freepbx

Probably easier than using cat to create files would be to just use nano and paste content, but I kept the same format that was used in the original instructions.

After the build, I exported a backup from the original VM and imported it into the container. This caused several messages about modules being tampered with, so maybe create a snapshot before importing backups from another machine.

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