How to Install Asterisk 22 PBX on Ubuntu 24.04
Installing Asterisk 22 PBX on Ubuntu 24.04 sets up a free and powerful phone system for your home or business.
Asterisk is software that turns a computer into a phone system, like the one a company uses to manage calls. It works with internet calls (VoIP) and regular phone lines.
The newest version, Asterisk 22, brings features such as voicemail, conference calls, and ways to record calls. You can also create custom automated menus for callers.
This software is open-source, meaning it’s free to use and change. It offers big cost savings compared to paid phone systems and includes features like call queues and automated receptionists right away.
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 tools help download and prepare Asterisk software for your Ubuntu 24.04 system. After updating the package list, install `wget` and `build-essential` with the command `sudo apt install wget build-essential`. These tools are crucial for the Asterisk installation.
sudo apt update sudo apt install wget build-essential subversion
We’ll download Asterisk packages manually and place them in the [/usr/src] directory where most source files are stored.
To accomplish that, navigate to the /usr/src directory and download Asterisk.
As of this writing, the current version is [22].
The Asterisk installation script, located in the extracted Asterisk file’s directory, downloads and installs all required dependencies, including MP3 modules, when the script runs.
After running the commands, the Asterisk installation script downloads and installs all necessary packages for Asterisk 22 PBX. The script then displays a success message, confirming the installation is complete.
Asterisk configuration commands will now run to set up the Asterisk PBX, verify its installation, and confirm that Asterisk operates as expected. This step ensures the Asterisk system is ready for use after installation on Ubuntu 24.04.
sudo ./configure
Upon successful completion, the output should display lines similar to the following:
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 :
Next, you will need to choose some modules to compile and install. Access the menu system using the commands below:
To use MP3 as the audio format for Asterisk 22 PBX, you must select the `format_mp3` option. This choice ensures that Asterisk 22 PBX records and plays audio files in the widely compatible MP3 format, which is efficient for storage and playback.

To save and exit, press F12 or select the Save and Exit button and press Enter.
After finishing everything, run the commands below to begin the compilation process.
sudo make -j2
This process may take some time, depending on your system. The -j flag followed by a number indicates the number of CPUs on your server. Update it accordingly if your server has more than 2 CPU cores.
After compiling the packages and modules, a success message similar to the one below should appear.
With the compilation complete, Asterisk 22 PBX installation proceeds by executing specific commands. Run these commands to install Asterisk: `sudo apt update` and `sudo apt install asterisk`.
sudo make install
After the installation, a similar message as below should appear:
+---- 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 is complete.
You can start configuring your system now. First, consider adding some sample data to assist in configuring your platform. To do this, run the commands below:
sudo make samples sudo make basic-pbx
Finish the configuration by running the commands below:
Creating a dedicated ‘asterisk’ user and group on Ubuntu 24.04 improves security by separating the Asterisk software from your main login. This guide explains how to create the new ‘asterisk’ system user and group. This setup ensures Asterisk runs safely on Ubuntu 24.04.
To install Asterisk 22 PBX, create a user account and a group named Asterisk by running the commands below. This step ensures that Asterisk processes run with the correct permissions, preventing potential security issues and allowing the system to function properly after installation.
sudo addgroup --quiet --system asterisk
sudo adduser --quiet --system --ingroup asterisk --no-create-home --disabled-password asterisk
After creating the account above, open the /etc/default/asterisk file and make the highlighted changes below:
sudo nano /etc/default/asterisk
Then, make the highlighted changes below and save the file.
# 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"
After that, add an asterisk user to the dialout and audio groups:
sudo usermod -a -G dialout,audio asteriskPermissions for all Asterisk files and directories should be modified to grant ownership to the respective users.
Asterisk on Ubuntu 24.04 can start automatically when your computer boots up using commands. This process involves launching Asterisk immediately and then checking if Asterisk is running correctly to finish the installation.
sudo systemctl enable asterisk sudo systemctl start asterisk
To verify that Asterisk is running, run the commands below:
sudo asterisk -vvvr
The default Asterisk CLI 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>
Many Ubuntu installations do not have a firewall enabled. Ensure access through the ports listed below if a firewall is active.
By default, SIP operates on UDP port 5060. Please ensure that this port is open.
sudo ufw allow 5060/udp
For Real-Time Protocol (RTP), open the following port range:
sudo ufw allow 10000:20000/udp
That should do it!
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!