How to Install Asterisk 22 PBX on Ubuntu 24.04
Asterisk 22 PBX is free software that turns an Ubuntu 24.04 computer into a full phone system for your home office or business. It handles internet phone calls and regular phone lines so you can manage calls without buying expensive office hardware.
This version of Asterisk gives you built-in voicemail, conference calls, and call recording right out of the box. You can set up automated phone menus and call queues to answer phones just like a big company, which helps you cut your phone bills.
Install essential packages with `sudo apt install wget build-essential subversion`. Download Asterisk 22 using `wget`, then extract, navigate, and run `contrib/scripts/install_prereq install`. Finally, configure, compile, and install with `sudo ./configure`, `sudo make menuselect`, `sudo make -j2`, and `sudo make install`.
Install Asterisk
Essential utilities help download and prepare the Asterisk software for Ubuntu 24.04. After refreshing the package lists, install the required compilation tools using `sudo apt install wget build-essential`. These tools are crucial for building the Asterisk source files.
sudo apt update sudo apt install wget build-essential subversion
Source packages download manually and live in the [/usr/src] directory, where most source files reside on Linux systems.
Moving into the /usr/src directory prepares the system to download Asterisk.
Grabbing the newest release requires checking the official package repository. Version numbers in the following commands update to match current releases.
Current releases match [22] at the time of writing.
Running the installation script from inside the extracted folder automatically pulls down required dependencies, including MP3 support.
Completing these commands triggers the installation script to pull down all necessary packages for Asterisk 22 PBX. A success message appears on screen once the setup finishes.
Configuration commands execute next to prepare the Asterisk PBX, verify the installation, and confirm proper operation. This step ensures the system functions correctly on Ubuntu 24.04.
sudo ./configure
Successful execution produces output resembling this example:
configure: Menuselect build configuration successfully completed
.$$$$$$$$$$$$$$$=..
.$7$7.. .7$$7:.
.$$:. ,$7.7
.$7. 7$$$$ .$$77
..$$. $$$$$ .$$$7
..7$ .?. $$$$$ .?. 7$$$.
$.$. .$$$7. $$$$7 .7$$$. .$$$.
.777. .$$$$$$77$$$77$$$$$7. $$$,
$$$~ .7$$$$$$$$$$$$$7. .$$$.
.$$7 .7$$$$$$$7: ?$$$.
$$$ ?7$$$$$$$$$$I .$$$7
$$$ .7$$$$$$$$$$$$$$$$ :$$$.
$$$ $$$$$$7$$$$$$$$$$$$ .$$$.
$$$ $$$ 7$$$7 .$$$ .$$$.
$$$$ $$$$7 .$$$.
7$$$7 7$$$$ 7$$$
$$$$$ $$$
$$$$7. $$ (TM)
$$$$$$$. .7$$$$$$ $$
$$$$$$$$$$$$7$$$$$$$$$.$$$$$$
$$$$$$$$$$$$$$$$.
configure: Package configured for:
configure: OS type : linux-gnu
configure: Host CPU : x86_64
configure: build-cpu:vendor:os: x86_64 : pc : linux-gnu :
configure: host-cpu:vendor:os: x86_64 : pc : linux-gnu :
Selecting modules for compilation happens next inside a text menu. Opening the menu interface requires running specific commands:
Enabling MP3 audio support in Asterisk 22 PBX requires selecting the `format_mp3` option. This selection allows Asterisk 22 PBX to record and play audio files using the widely supported MP3 format, which keeps storage requirements low.

Pressing F12 or choosing the Save and Exit button followed by Enter saves the configuration.
Kicking off the compilation process requires running the build commands.
sudo make -j2
Build times vary based on hardware specs. The -j flag accepts a numerical value matching the CPU core count on the server. Adjusting this number matches servers with more than 2 CPU cores.
Finishing the compilation of packages and modules triggers a confirmation message.
Finalizing the Asterisk 22 PBX setup involves running package manager commands after compilation finishes. Executing `sudo apt update` and `sudo apt install asterisk` completes the installation.
sudo make install
Successful installation displays output matching this example:
+---- Asterisk Installation Complete -------+
+ +
+ YOU MUST READ THE SECURITY DOCUMENT +
+ +
+ Asterisk has successfully been installed. +
+ If you would like to install the sample +
+ configuration files (overwriting any +
+ existing config files), run: +
+ +
+ For generic reference documentation: +
+ make samples +
+ +
+ For a sample basic PBX: +
+ make basic-pbx +
+ +
+ +
+----------------- or ---------------------+
+ +
+ You can go ahead and install the asterisk +
+ program documentation now or later run: +
+ +
+ make progdocs +
+ +
+ **Note** This requires that you have +
+ doxygen installed on your local system +
+-------------------------------------------+
The installation phase is complete.
System configuration starts now. Sample data assists with initial platform setup. Generating sample data requires running these commands:
sudo make samples sudo make basic-pbx
Finalizing the setup involves running the remaining configuration commands:
Creating a dedicated 'asterisk' user and group on Ubuntu 24.04 isolates the service from the main user account for better security. Dedicated system accounts keep Asterisk running safely on Ubuntu 24.04.
Creating the Asterisk user account and group enforces correct file permissions and stops potential security vulnerabilities from affecting the broader operating system.
sudo addgroup --quiet --system asterisk
sudo adduser --quiet --system --ingroup asterisk --no-create-home --disabled-password asterisk
Opening the /etc/default/asterisk file applies the highlighted adjustments:
sudo nano /etc/default/asterisk
Applying the highlighted changes and saving the file completes this step.
# Uncomment the following and set them to the user/groups that you
# want to run Asterisk as. NOTE: this requires substantial work to
# be sure that Asterisk's environment has permission to write the
# files required for its operation, including logs, its comm
# socket, the asterisk database, etc.
AST_USER="asterisk"
AST_GROUP="asterisk"
Adding the asterisk user to the dialout and audio groups happens next:
sudo usermod -a -G dialout,audio asteriskFile permissions require adjustments so the correct user owns all Asterisk directories and files.
Configuring systemd services allows Asterisk on Ubuntu 24.04 to start automatically at boot. Launching the service immediately and checking its operational status finalizes the setup.
sudo systemctl enable asterisk sudo systemctl start asterisk
Checking service health involves running verification commands:
sudo asterisk -vvvr
The standard Asterisk CLI (Command Line Interface) prompt appears:
Asterisk 22.2.0, Copyright (C) 1999 - 2025, Sangoma Technologies Corporation and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk 22.2.0 currently running on Ubuntu (pid = 54532)
Ubuntu*CLI>
Active firewalls require specific port exceptions since many Ubuntu installs ship with firewalls disabled by default.
SIP (Session Initiation Protocol, used for setting up voice calls) listens on UDP port 5060 by default. Opening this port allows remote phone connections.
sudo ufw allow 5060/udp
RTP (Real-Time Protocol, responsible for carrying audio streams) requires opening a specific port range:
sudo ufw allow 10000:20000/udp
Configuration is complete.
Conclusion:
- Asterisk 22 PBX on Ubuntu 24.04 provides a flexible and cost-effective solution for telecommunication needs.
- The installation process, while detailed, allows users to customize their PBX system according to specific requirements.
- Leveraging Asterisk's features such as voicemail, call conferencing, and IVR can enhance communication capabilities significantly.
- Proper configuration and management through a dedicated user ensure security and efficient operation.
- Regular updates and maintenance will help keep your Asterisk system running smoothly and securely.
- Utilize community resources and documentation for troubleshooting and expanding functionalities as needed.
Was this guide helpful?
100% of readers found this helpful (1 votes)
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.
No comments yet — be the first to share your thoughts!