How do I install FreePBX 17 on a Debian 12 VPS?
Install FreePBX 17 and Asterisk with the official script, open the SIP and RTP ports, set up NAT, create an extension and a SIP trunk, then protect the PBX
FreePBX is a free web interface for Asterisk, the phone system (IP PBX) software. Installed on a VPS, it handles the team’s extensions, the operator’s SIP lines, voicemail, call queues and opening hours, with no hardware on site. Version 17 installs with an official Sangoma script that only supports Debian 12.
Step-by-step procedure
-
Prepare a Debian 12 VPS
Pick Debian 12 when ordering, or reinstall the VPS with this system: the script expects a clean install, with no web server or database already in place. Then connect over SSH as root.
-
Update and name the machine
Run apt update && apt upgrade -y, then reboot if a new kernel was installed. Give the VPS a fully qualified name (FQDN) such as pbx.example.com with hostnamectl set-hostname and a line in /etc/hosts: the script stops if hostname -f returns nothing.
-
Run the official script
Download sng_freepbx_debian_install.sh from the FreePBX/sng_freepbx_debian_install GitHub repository and run it with bash. It installs Asterisk 22, FreePBX, Apache, PHP 8.2, MariaDB, Fail2ban and the base modules; allow 15 to 30 minutes. The detailed log is written to /var/log/pbx/.
-
Create the administrator account
Open http://VPS_IP/ in your browser. FreePBX asks for a username, a password and an email address for notifications. Activation with Sangoma is optional: it is used for the commercial modules.
-
Open the SIP and RTP ports
In the ACLClouds panel “Firewall”, allow 5060/UDP for SIP signalling and the 10000-20000/UDP range for voice (RTP). Restrict 80 and 443/TCP, the administration interface, to your IP address.
-
Set up NAT and create an extension
In “Settings” > “Asterisk SIP Settings”, click “Detect Network Settings” to fill in the external address and the local networks. Then create a PJSIP extension in “Applications” > “Extensions”, set it up on a softphone and click “Apply Config”.
Name the machine and install FreePBX 17
apt update && apt upgrade -y
hostnamectl set-hostname pbx.example.com
echo "127.0.1.1 pbx.example.com pbx" >> /etc/hosts
hostname -f
wget https://github.com/FreePBX/sng_freepbx_debian_install/raw/master/sng_freepbx_debian_install.sh -O /tmp/sng_freepbx_debian_install.sh
bash /tmp/sng_freepbx_debian_install.sh
Useful commands after installation
fwconsole restart
fwconsole reload
fwconsole ma upgradeall
fwconsole chown
asterisk -rvvv
In the Asterisk console
pjsip show endpoints
pjsip show registrations
core show channels
Before you start
A FreePBX phone system needs few resources for a small team: the load mostly comes from the number of simultaneous calls, call recording and transcoding between codecs. You also need a SIP trunk, a line provided by a VoIP operator, to call outside numbers and receive calls on your numbers.
- Debian 12 (bookworm) is the only system the FreePBX 17 script accepts; it refuses Debian 13 and blocks that upgrade.
- The VPS must keep the same IP address: the operator and the phones refer to it.
- By default the script also installs Sangoma’s commercial modules, including System Admin and Firewall; the --opensourceonly option removes them, Firewall module included.
Add a SIP trunk
In “Connectivity” > “Trunks”, add a PJSIP trunk with the operator’s details: SIP server, username, password and, depending on the plan, registration or authentication by IP address. Then create one inbound route (“Inbound Routes”) per number and one outbound route (“Outbound Routes”) with the allowed number formats.
If the operator authenticates by IP address, give it the VPS IPv4 and only open 5060/UDP to its addresses in the firewall.
Protect the phone system
A public SIP port receives automated login attempts within hours of going online. The main risk is toll fraud: calls to premium-rate or international numbers placed through a hacked extension and billed to your operator account.
- Keep Fail2ban, installed by the script: it bans addresses after several failed SIP authentications.
- Give every extension a long, random secret, never the extension number.
- Refuse anonymous calls: set “Allow Anonymous Inbound SIP Calls” and “Allow SIP Guests” to “No” in “Asterisk SIP Settings”.
- Limit outbound routes to the destinations you need and ask the operator for a spending cap or a block on premium-rate and international numbers.
Common errors and fixes
Most audio problems come from NAT or the RTP ports. pjsip show endpoints and the /var/log/asterisk/full log give the cause most of the time.
- Call connects but there is no audio, or audio in one direction only: the 10000-20000/UDP range is closed, or the external address is empty in “Asterisk SIP Settings”. Fix it, then click “Apply Config”.
- The extension does not register and gets 401 Unauthorized: wrong username or secret. If it gets no answer at all after several attempts, Fail2ban has banned its address.
- The script stops with Unsupported OS version: the system is not Debian 12. Reinstall the VPS with Debian 12 and run it again.
- The script stops on Fully qualified domain name (FQDN) is not set correctly: give the machine a full name with hostnamectl and /etc/hosts.
- The interface shows a blank page or an error after an update: run fwconsole chown, then fwconsole restart.
Which VPS for FreePBX?
At ACLClouds, as of 17 November 2026, the VPS Mini (2 vCPU, 8 GB of RAM, 40 GB of storage) costs €4.99 a month with no commitment, or €3.99 a month on a one-year term: enough for a small business phone system and its voicemail. The VPS Essentiel (4 vCPU, 16 GB of RAM, 80 GB), at €9.99 a month, leaves room to record calls and handle many simultaneous calls. The network goes up to 1 Gbit/s; a G.711 call uses about 90 kbit/s in each direction.
Quick check
- http://VPS_IP/ shows the FreePBX login.
- pjsip show endpoints shows the extension as available.
- A call between two extensions goes through with audio both ways.
- The trunk shows as registered in pjsip show registrations.
- The administration interface can only be reached from your addresses.
Frequently asked questions
Is FreePBX free?
Yes. FreePBX and Asterisk are free software, with no per-extension license. Only some of Sangoma’s commercial modules are paid, such as EndPoint Manager; a complete phone system works without them. Outside calls are billed by your SIP operator.
Can FreePBX 17 be installed on Debian 13 or Ubuntu?
Not with the official script, which stops on any system other than Debian 12. A manual install is still possible, but Sangoma does not support it: for a production phone system, pick Debian 12.
Do I need an HTTPS certificate for the interface?
It is recommended as soon as you open the interface or the user portal (UCP) to the Internet. Point a domain name to the VPS and request a Let’s Encrypt certificate; the FreePBX “Certificate Management” module can also do it and renew it.
How many simultaneous calls can a small VPS handle?
Without transcoding or recording, a few dozen calls fit on 2 vCPU: Asterisk mostly relays packets. Transcoding (for example G.722 to G.729) and recording every call clearly increase CPU and disk load. Measure with core show channels at peak times before adding extensions.