FreePBX is a widely-used, open-source web interface built on top of Asterisk — making PBX configuration dramatically more approachable than editing raw Asterisk configuration files directly.
Prerequisites
- Ubuntu 22.04/24.04 VPS: 2 vCPU, 4 GB RAM
- Apache or Nginx, PHP, MariaDB
- Asterisk (FreePBX installs and manages this, or can integrate with an existing installation)
Step 1 — Install Required Dependencies
sudo apt install apache2 mariadb-server php php-cli php-mysql php-gd php-curl php-xml php-mbstring sox -y
Step 2 — Set Up the Database
sudo mysql
CREATE DATABASE asterisk;
CREATE DATABASE asteriskcdrdb;
CREATE USER 'asteriskuser'@'localhost' IDENTIFIED BY 'CHANGE_ME_STRONG_PASSWORD';
GRANT ALL PRIVILEGES ON asterisk.* TO 'asteriskuser'@'localhost';
GRANT ALL PRIVILEGES ON asteriskcdrdb.* TO 'asteriskuser'@'localhost';
FLUSH PRIVILEGES;
Step 3 — Download FreePBX
cd /usr/src
sudo wget http://mirror.freepbx.org/modules/packages/freepbx/freepbx-VERSION-latest.tgz
sudo tar xvfz freepbx-*-latest.tgz
Step 4 — Run the FreePBX Installer
cd freepbx
sudo ./start_asterisk start
sudo ./install -n
-n runs a non-interactive install using default settings; omit for an interactive setup with more control over configuration choices.
Step 5 — Access the Web Interface
http://YOUR_SERVER_IP
Create your administrator account on first visit.
Step 6 — Add HTTPS
sudo certbot --apache -d yourdomain.com
Step 7 — Configure Firewall Rules
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
sudo ufw allow 5060/udp
sudo ufw allow 10000:20000/udp
Creating Your First Extension
Under Applications → Extensions, add a new extension, configure a secure password, and note the connection details for configuring a SIP phone or softphone app.
Setting Up Call Routing (Dialplan) Visually
FreePBX's Applications menu lets you configure IVR menus, ring groups, and call routing through a graphical interface, rather than hand-editing Asterisk's dialplan syntax directly — the main convenience FreePBX provides over raw Asterisk.
Installing Additional Modules
Under Admin → Module Admin, browse and install additional FreePBX modules for extended functionality (call recording, reporting, and more).
Securing FreePBX
See How to Secure a VoIP Server Against Toll Fraud — critically important, since FreePBX's ease of configuration also means misconfiguration mistakes are easier to make.
Common Errors
Installer fails at the database step — verify MariaDB is running and the database/user created in Step 2 exactly match what's referenced during installation.
Web interface shows a blank page — check Apache/PHP error logs; often a missing PHP extension or a permissions issue on FreePBX's web directory.
Continue Reading
- How to Install Asterisk PBX on a VPS
- How to Secure a VoIP Server Against Toll Fraud
- How to Set Up an IVR (Interactive Voice Response) Menu
Browse more articles in VoIP & Communication Servers.