Skip to content
Follow
Ubuntu Linux

How to Install FreePBX 17 on Ubuntu 24.04

Richard
Written by
Richard
Mar 15, 2025 Updated Mar 20, 2026 6 min read
How to Install FreePBX 17 on Ubuntu 24.04
How to Install FreePBX 17 on Ubuntu 24.04

You install FreePBX 17 on Ubuntu 24.04 to manage your Asterisk 22 PBX system.

FreePBX is an open-source web interface simplifying the management of Asterisk, the leading open-source telephony framework. It lets you build and control your business phone system easily.

FreePBX 17 offers a streamlined dashboard for setting up extensions, voicemail, and call routing. It’s designed for user-friendliness, even if you’re new to PBX systems.

Combining FreePBX 17 with Ubuntu 24.04 creates a powerful and adaptable platform for your business communications.

⚡ Quick Answer

Install Apache, MariaDB, and PHP via the Ubuntu terminal using `apt install`. Then, download the FreePBX 17 Distro ISO and follow the on-screen installer prompts.

Install Asterisk PBX

FreePBX is a tool that helps you manage your Asterisk PBX system, so the first step is to install Asterisk itself. This guide will walk you through installing the Asterisk PBX system on Ubuntu Linux.

The first thing you’ll need to do is install the Asterisk PBX system. The post below shows you how to do that.

How to install Asterisk PBX on Ubuntu Linux

After installing Asterisk, proceed to the following steps to install and configure FreePBX.

Install Apache

FreePBX needs a web server to run, and we’ll use the popular Apache web server for this. To install Apache on your Ubuntu system, open the terminal and run these commands.

To do that, open the Ubuntu terminal and run the commands below to install the Apache web server.

🐧Bash / Shell
sudo apt update
sudo apt install apache2

After installing Apache, you can use the following commands to start, stop, and enable the Apache web server to start when your server boots up automatically.

🐧Bash / Shell
sudo systemctl stop apache2
sudo systemctl start apache2
sudo systemctl enable apache2

You can verify that the Apache web server is operational by opening your web browser and navigating to the server’s localhost or IP address.

http://localhost

Default Apache2 web server welcome page on Ubuntu 24.04 server
Default Apache2 web server welcome page on Ubuntu 24.04 server

When you see the Apache2 Default Page, it means the Apache HTTP server is successfully installed.

Additional help on installing Apache on Ubuntu is in the link below.

How to install Apache on Ubuntu

Install the MariaDB database server on Ubuntu

A database server is another essential piece for FreePBX to work, and we’ll install MariaDB for this. You can install the MariaDB database server on Ubuntu by opening your terminal and running the following commands.

To install and use the MariaDB database server, use the instructions below.

Open the Ubuntu terminal and run the commands below to install the MariaDB database server.

🐧Bash / Shell
sudo apt update
sudo apt install mariadb-server

After installing the MariaDB database server, use the commands below to stop, start, and enable the server to start automatically on boot.

🐧Bash / Shell
sudo systemctl stop mariadb
sudo systemctl start mariadb
sudo systemctl enable mariadb

Run the following commands to validate and test if the MariaDB database server is installed successfully.

🐧Bash / Shell
sudo mariadb

After executing the commands, you will be logged into the MariaDB console, displaying a message similar to the one below.

💻Code
Welcome to the MariaDB monitor.  Commands end with ; or g.
Your MariaDB connection id is 32
Server version: 10.11.2-MariaDB-1 Ubuntu 23.04

Copyright (c) 2000, 2018, Oracle, MariaDB Corporation Ab and others.

Type 'help;' or 'h' for help. Type 'c' to clear the current input statement.

MariaDB [(none)]> 

The message tells you that the server is installed successfully.

By default, MariaDB on Ubuntu uses the UNIX auth_socket plugin for security. To allow the root user to use mysql_native_password, use the steps below.

You’ll need a MariaDB root account to set up FreePBX later.

First, log on to the database server.

🐧Bash / Shell
sudo mariadb

Then, update the root account to use mysql_native_password.

💻Code
ALTER USER 'root'@'localhost' IDENTIFIED VIA mysql_native_password USING PASSWORD('TypeRootPasswordHere');

Finally, save your changes and exit.

💻Code
FLUSH PRIVILEGES;
exit;

Since FreePBX is built using PHP, you’ll need to install it along with some specific modules. The commands below will install the latest PHP version and the necessary modules for FreePBX on your system.

Then, run the commands below to install the latest PHP version.

🐧Bash / Shell
sudo apt install php libapache2-mod-php php-intl php-mysql php-curl php-cli php-zip php-xml php-gd php-common php-mbstring php-xmlrpc php-bcmath php-json php-sqlite3 php-soap php-zip php-ldap php-imap php-cas

Additional help on installing PHP

How to install PHP on Ubuntu Linux

Install Nodejs

Node.js is required for FreePBX, so we need to add its repository and then install it. First, run these commands to add the Node.js 22 repository to your Ubuntu system, then install Node.js.

🐧Bash / Shell
sudo apt install curl dirmngr apt-transport-https lsb-release ca-certificates
curl -sL https://deb.nodesource.com/setup_22.x | sudo bash

Then, run the commands below to install Nodejs.

🐧Bash / Shell
sudo apt-get install gcc g++ make
sudo apt install nodejs

Install FreePBX

With all the necessary components installed, it’s time to install FreePBX version 17. You can download and extract the FreePBX files using the commands below, then change to the extracted folder to complete the installation.

Run the command below to download and extract FreePBX files.

Command Prompt
cd /tmp
wget http://mirror.freepbx.org/modules/packages/freepbx/freepbx-17.0-latest.tgz
tar xfz freepbx-17.0-latest.tgz

Then, please change it to the extracted folder and install FreePBX.

Command Prompt
cd freepbx
sudo ./start_asterisk start
sudo ./install -n --dbuser root --dbpass TypeDatabaseRootPasswordHere

If you get an error,

Error!
Unable to read /etc/asterisk/asterisk.conf or it was missing a directories section

run the commands below to resolve:

🐧Bash / Shell
sudo cp /etc/asterisk/asterisk.conf.old /etc/asterisk/asterisk.conf

If you also get an error:

‘asterisk’ user…bash: line 0: cd: /home/asterisk/: No such file or directory

Run the commands below to resolve:

🐧Bash / Shell
sudo mkhomedir_helper asterisk

When you have resolved all the errors above, try the installation again.

After installing, you should get a similar message as shown below:

💻Code
Finished generating default configurations
You have successfully installed FreePBX

Next, change Apache service runner from www-data to Asterisk user. To do that, run the command below to open the [envvars] file.

🐧Bash / Shell
sudo nano /etc/apache2/envvars

Then, change the highlighted lines and replace the user with Asterisk.

💻Code
# Since there is no sane way to get the parsed apache2 config in scripts, some
# settings are defined via environment variables and then used in apache2ctl,
# /etc/init.d/apache2, /etc/logrotate.d/apache2, etc.
export APACHE_RUN_USER=asterisk
export APACHE_RUN_GROUP=asterisk

Save the file and exit.

Also, add the www-data user to the asterisk group and restart the Apache service.

🐧Bash / Shell
sudo a2enmod rewrite
sudo usermod -aG www-data asterisk
sudo systemctl restart apache2

Now, go and access the FreePBX portal. If you get a blank page, restart your computer and try again.

💻Code
http://localhost/admin

Create your administrator account.

Web-based setup interface for configuring FreePBX 17 on Ubuntu
Web-based setup interface for configuring FreePBX 17 on Ubuntu

Setup, login, and start building your PBX

FreePBX web dashboard
FreePBX web dashboard

That should do it!

Conclusion:

In summary, installing FreePBX 17 on Ubuntu 24.04 to manage your Asterisk 22 PBX system consists of several key steps:

  • Install Asterisk: Set up the Asterisk PBX system before integrating FreePBX.
  • Set Up Apache: Install and configure the Apache web server to host the FreePBX interface.
  • Install MariaDB: Deploy the MariaDB database server to manage FreePBX data storage.
  • Install PHP: Ensure you have the required PHP version and extensions for FreePBX to function correctly.
  • Add Node.js: Include Node.js as part of your server environment for web application functionalities.
  • Download and Install FreePBX: Retrieve the latest version and complete the installation process.
  • Configure Permissions: Adjust Apache settings to run under the Asterisk user for proper access.
  • Access FreePBX: Finally, navigate to the FreePBX portal, create your administrator account, and start managing your PBX system.

These steps will help you set up a fully functional Asterisk-based phone system using FreePBX on Ubuntu.

Was this guide helpful?

Was this helpful?
Richard

About the Author

Richard

Tech Writer, IT Professional

Richard, a writer for Geek Rewind, is a tech enthusiast who loves breaking down complex IT topics into simple, easy-to-understand ideas. With years of hands-on experience in system administration and enterprise IT operations, he’s developed a knack for offering practical tips and solutions. Richard aims to make technology more accessible and actionable. He's deeply committed to the Geek Rewind community, always ready to answer questions and engage in discussions.

📚 Related Tutorials

How to Enable Root User on Ubuntu 24.04
Ubuntu Linux How to Enable Root User on Ubuntu 24.04
How to Install i-doit on Ubuntu with Apache
CMS How to Install i-doit on Ubuntu with Apache
How to Install Asterisk 22 PBX on Ubuntu 24.04
Ubuntu Linux How to Install Asterisk 22 PBX on Ubuntu 24.04
How to Setup MariaDB Master Slave Replication on Ubuntu
Ubuntu Linux How to Setup MariaDB Master Slave Replication on Ubuntu

No comments yet — be the first to share your thoughts!

Leave a Comment

Your email address will not be published. Required fields are marked *