A complete step-by-step guide to installing FreePBX 17 with Asterisk on Debian 12 Bookworm. From dependencies and web server setup to SIP trunk configuration with IPComms.
FreePBX 17 is the latest major release of the popular open-source PBX management interface for Asterisk. This guide walks you through a clean installation on Debian 12 (Bookworm), which is the recommended base OS for production FreePBX deployments.
● A fully qualified domain name (optional, for HTTPS access)
2. Install Asterisk
FreePBX 17 requires Asterisk 21 or 22 as its telephony engine. You will need to compile Asterisk from source with specific options that FreePBX expects. Below is a condensed version of the key steps. For the full detailed walkthrough, see our complete Asterisk installation guide.
# Download Asterisk 22 LTS
cd /usr/src
sudo wget https://downloads.asterisk.org/pub/telephony/asterisk/asterisk-22-current.tar.gz
sudo tar -xvzf asterisk-22-current.tar.gz
cd asterisk-22*/
# Install prerequisites and MP3 support
sudo contrib/scripts/install_prereq install
sudo contrib/scripts/get_mp3_source.sh
# Configure, compile, and install
sudo ./configure --with-pjproject-bundled=no
sudo make menuselect.makeopts
sudo menuselect/menuselect --enable format_mp3 menuselect.makeopts
sudo make -j$(nproc)
sudo make install
sudo make samples
sudo make config
sudo make install-logrotate
# Edit /etc/asterisk/asterisk.conf
sudo sed -i 's/^;runuser.*/runuser = asterisk/' /etc/asterisk/asterisk.conf
sudo sed -i 's/^;rungroup.*/rungroup = asterisk/' /etc/asterisk/asterisk.conf
3. Install FreePBX Dependencies
FreePBX requires a web server (Apache), a database (MariaDB), PHP 8.2, Node.js, and several other packages. Install them all before proceeding with the FreePBX installation.
With all dependencies in place, download FreePBX 17 and run the installation script. The installer will set up the database, configure Apache, and install the core FreePBX modules.
Download FreePBX 17
# Download FreePBX 17 from the official repository
cd /usr/src
sudo wget https://github.com/FreePBX/framework/archive/refs/heads/release/17.0.zip -O freepbx-17.zip
sudo apt install -y unzip
sudo unzip freepbx-17.zip
cd framework-release-17.0
Start Asterisk Before Installing
# Asterisk must be running for the FreePBX installer
sudo systemctl start asterisk
sudo systemctl status asterisk
Run the FreePBX Installer
# Run the install script
sudo ./install -n
The -n flag runs the installer non-interactively with default settings. If you want to customize the installation (e.g., database name, user), run sudo ./install without the flag.
The installer will:
● Create the asterisk and asteriskcdrdb databases
● Configure Apache with the FreePBX virtual host
● Install core FreePBX modules
● Set up the Asterisk Manager Interface (AMI)
Set Permissions
# Set correct ownership for FreePBX web files
sudo chown -R asterisk:asterisk /var/www/html
sudo chown -R asterisk:asterisk /var/lib/asterisk
sudo chown -R asterisk:asterisk /etc/asterisk
# Add Apache user to asterisk group
sudo usermod -aG asterisk www-data
Configure Apache
# Set AllowOverride to All for the FreePBX directory
sudo sed -i 's/AllowOverride None/AllowOverride All/' /etc/apache2/apache2.conf
# Restart Apache to apply changes
sudo systemctl restart apache2
Install All FreePBX Modules
# Install all available FreePBX modules
sudo -u asterisk fwconsole ma installall
sudo -u asterisk fwconsole reload
sudo -u asterisk fwconsole chown
5. Initial Web Setup
With FreePBX installed, access the web interface to complete the initial configuration. Open your browser and navigate to your server's IP address.
Access the FreePBX GUI
Open a web browser and go to:
http://YOUR_SERVER_IP/admin
On first access, FreePBX will prompt you to create an administrator account.
Create Admin Account
● Username: Choose a unique admin username (avoid "admin" for security)
● Password: Use a strong password with mixed case, numbers, and symbols
● Email: Enter a valid email for system notifications
Activate FreePBX
After logging in, FreePBX will prompt you to activate your installation. Activation is free and required for accessing the online module repository:
1. Click Activate in the top notification bar
2. Create a Sangoma account or sign in with an existing one
3. Follow the activation wizard to link your installation
Configure System Settings
Navigate to Settings > Asterisk SIP Settings and configure these essential settings:
● External Address: Enter your server's public IP address
● Local Networks: Add your internal subnet (e.g., 192.168.1.0/24)
● Timezone: Go to Settings > Advanced Settings and set your PHP timezone
● Language: Set the default system language under Settings > Advanced Settings
6. Configure IPComms SIP Trunk
Now connect your FreePBX system to IPComms SIP trunking for inbound and outbound calling. This is done entirely through the FreePBX web interface.
Add a New SIP Trunk
In the FreePBX admin panel:
1. Navigate to Connectivity > Trunks
2. Click Add Trunk
3. Select Add SIP (chan_pjsip) Trunk
General Tab Settings
Field
Value
Trunk Name
IPComms
Outbound CallerID
Your DID number (e.g., 12025551234)
CID Options
Allow Any CID
pjsip Settings Tab
Under the pjsip Settings tab, configure the General sub-tab:
Field
Value
Username
YOUR_TRUNK_USERNAME
Secret
YOUR_TRUNK_PASSWORD
Authentication
Outbound
Registration
Send
SIP Server
sip.ipcomms.net
SIP Server Port
5060
Context
from-pstn
Transport
0.0.0.0-udp
Under the Advanced sub-tab, configure these settings:
Field
Value
From Domain
Your SIP domain from the welcome email (e.g. yourcompany.s1.ipcomms.net) — recommended; may be left blank when the SIP Server is our hostname
From User
YOUR_TRUNK_USERNAME
Direct Media
No
ICE Support
No
Force rport
Yes
Rewrite Contact
Yes
RTP Symmetric
Yes
Codec Configuration
Under the Codecs sub-tab, enable the following codecs in order of preference:
1. g722 - Wideband HD audio (recommended)
2. ulaw - G.711 mu-law (North America standard)
3. alaw - G.711 A-law (International standard)
Click Submit, then click the red Apply Config button at the top of the page.
Get Your IPComms Credentials
Sign up for IPComms SIP trunking to get your trunk credentials, DID numbers, and access to the customer portal with real-time call analytics. Start with a free SIP trunk -- only pay for usage and numbers.
Extensions are the internal phone numbers used by users and devices on your PBX. Each extension can register a softphone, desk phone, or other SIP device.
Add a New Extension
1. Navigate to Applications > Extensions
2. Click Add Extension
3. Select Add New chan_pjsip Extension
Extension Settings
Field
Value
User Extension
1001
Display Name
John Smith
Secret
Auto-generated (note it for softphone config)
Outbound CID
Your DID number (e.g., 12025551234)
Click Submit and then Apply Config.
Register a Softphone
Configure your softphone (such as Zoiper, Linphone, or MicroSIP) with these settings:
Setting
Value
Username / Account
1001
Password
The Secret from the extension
Domain / Server
Your FreePBX server IP
Transport
UDP
Port
5060
8. Set Up Inbound & Outbound Routes
Routes tell FreePBX how to handle incoming calls from your IPComms trunk and how to send outbound calls through it.
Create an Outbound Route
1. Navigate to Connectivity > Outbound Routes
2. Click Add Outbound Route
3. Set Route Name to "IPComms_Outbound"
4. Under Trunk Sequence, select your "IPComms" trunk
5. Under Dial Patterns, add these patterns:
Prepend
Prefix
Match Pattern
Description
1
NXXNXXXXXX
10-digit US/CA calls
1NXXNXXXXXX
11-digit US/CA calls
011.
International calls
Create an Inbound Route
1. Navigate to Connectivity > Inbound Routes
2. Click Add Inbound Route
3. Set DID Number to your IPComms phone number (e.g., 12025551234)
4. Set Description to "Main Line"
5. Under Set Destination, choose where to send the call (e.g., Extension 1001)
Click Submit and then Apply Config to activate your routes.
9. Troubleshooting
If you encounter issues during or after installation, use these solutions for the most common FreePBX problems.
Apache Not Loading FreePBX
If you see the default Apache page instead of FreePBX:
# Check if the FreePBX config is enabled
sudo ls /etc/apache2/sites-enabled/
# Disable the default site and enable FreePBX
sudo a2dissite 000-default.conf
sudo systemctl restart apache2
# Check Apache error logs
sudo tail -50 /var/log/apache2/error.log
FreePBX GUI Errors
If the GUI shows blank pages or PHP errors:
# Check PHP version and modules
php -v
php -m | grep -i mysql
# Verify PHP is properly configured for Apache
sudo a2enmod php8.2
sudo systemctl restart apache2
# Check FreePBX file permissions
sudo -u asterisk fwconsole chown
Module Install Failures
# Check module status
sudo -u asterisk fwconsole ma list
# Force upgrade all modules
sudo -u asterisk fwconsole ma upgradeall
# Refresh module signatures
sudo -u asterisk fwconsole ma refreshsignatures
# If a specific module fails, reinstall it
sudo -u asterisk fwconsole ma uninstall core
sudo -u asterisk fwconsole ma install core
Trunk Registration Issues
Symptom
Cause
Solution
Trunk shows "Unavailable"
Credentials or server incorrect
Verify username, password, and SIP server in trunk settings
401 Unauthorized
Wrong username or password
Double-check credentials in IPComms portal
408 Request Timeout
Firewall blocking SIP
Open UDP 5060 and 10000-20000 in your firewall
No audio on calls
NAT/RTP misconfiguration
Verify External Address in SIP Settings, ensure Direct Media is set to No
# Check trunk registration from Asterisk CLI
sudo asterisk -rx "pjsip show registrations"
# Enable SIP debug logging
sudo asterisk -rx "pjsip set logger on"
# Check FreePBX system logs
sudo tail -f /var/log/asterisk/full
Stop worrying about SIP trunk capacity. We have you covered.
SIP trunking from a US carrier since 2002: $0.009 per minute inbound, $0.010 outbound, numbers from $1.50 a month, $0 per channel, no contracts.