Skip to content
Follow
Ubuntu Linux

How to Install Asterisk 22 PBX on Ubuntu 24.04

Richard
Written by
Richard
Mar 15, 2025 Updated Sep 15, 2026 6 min read
How to Install Asterisk 22 PBX on Ubuntu 24.04
How to Install Asterisk 22 PBX on Ubuntu 24.04

Asterisk 22 PBX (a free software private branch exchange that lets you build your own phone system) turns an Ubuntu 24.04 computer into a complete telephone switchboard for a home office or business. It handles internet phone calls and regular phone lines so you can run voicemail, conference calls, and automated phone menus without buying expensive hardware.

Advertisement

This release brings fresh updates and security patches to help you cut phone bills and manage call queues like a large company. Setup takes a Linux computer with root access and basic command-line skills.

⚡ Quick Answer

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`.

Advertisement

Install Asterisk

To install Asterisk for your Ubuntu installation, update your package lists and run the command `sudo apt install wget build-essential subversion` in your terminal. These essential compilation tools download and prepare the Asterisk source files so you can build the communication software on your server without errors.

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.

Advertisement

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.

Advertisement
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.

Asterisk menu selection
Asterisk menu selection

Pressing F12 or choosing the Save and Exit button followed by Enter saves the configuration.

Advertisement

Run the build commands to compile the software.

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.

Advertisement
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:

Advertisement

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.

Advertisement
# 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 asterisk

File 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>

If you use an active firewall, open specific ports to allow traffic.

SIP (Session Initiation Protocol, the protocol used to set 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)

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.

Advertisement

📚 Related Tutorials

How to Install Additional Software on Ubuntu
Ubuntu Linux How to Install Additional Software on Ubuntu
How to Install Ubuntu Linux
Ubuntu Linux How to Install Ubuntu Linux
How to Install GNOME Desktop on Ubuntu 24.04
Ubuntu Linux How to Install GNOME Desktop on Ubuntu 24.04
How to Install KDE Desktop on Ubuntu 24.04
Ubuntu Linux How to Install KDE Desktop on Ubuntu 24.04

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

Leave a Comment

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