Asterisk: How to Install IP Telephony Software

Asterisk, how to install

Asterisk it is Free and open source platform to implement your own VoIP-based switchboard for your small business or organization. In this way, you can improve your productivity and be able to serve your customers in a much more optimal way with all the phones you have.

In this guide you will learn how to install and configure it in Ubuntu, as it is one of the most popular distributions. But the steps can be very similar for other Debian-based distributions, and even for other GNU / Linux distros, as it will be installed from source code, compiling to generate the binary.

For other platforms, such as Microsoft Windows or macOS, you will not need to compile from sources, you can find already compiled packages ready to install.

Install Asterisk step by step

To install Asterisk on your system, you just have to follow these simple steps ...

Previous requirements

Before starting the Asterisk installation, you should first have all the necessary packages to compile. In general, it is likely that your distribution already has them, but you can be safe by running the following programs (if they are installed they will do nothing):

sudo apt-get update

sudo apt-get upgrade

sudo apt-get install wget build-essential subversion

That will install the wget package, to download the sources, the Subversion version control system, and the essential packages for building the package from source.

Download Asterisk

The following will be download own fonts Asterisk software, that is, the source code from which you can build the binary of this program. To do this, from the terminal you must execute:

This downloads the Asterisk 18.3.0 version of the software, which is the latest as of this writing.

cd /usr/src/

sudo wget

sudo tar zxf asterisk-18.3.0.tar.gz

cd asterisk-18.3.0

Resolve dependencies

The next step is resolve dependencies that Asterisk has, especially when it comes to the MP3 module needed for calls. To do this, from the terminal you can run the following commands to use the scripts available for these purposes:

sudo contrib/scripts/
sudo contrib/scripts/install_prereq install

These commands will resolve these dependencies and display a successful installation message if it was successful.

Install Asterisk

Now is the time to compile and install Asterisk as such. To do this, the steps to follow are quite simple, you just have to use:

Read the LEADME file if you have problems or are trying to install another version. There could be slight differences.

sudo ./configure

sudo make menuselect

From the menu, select format_mp3 and hit F12, you can also use the keyboard and select Save & Exit and press ENTER.

After that you can start the process of compilation as such:

sudo make -j2

You can modify the number that accompanies -j by the number of cores of your processor. For example, if you have 8 cores you can use -j8 to speed up the compilation. If you only have one kernel, you can suppress the -j option.

Basic configuration

Once the compilation is complete, which may take more or less depending on the performance of your computer, the following is installation from binary:

sudo make install

It will already be installed. But the process has not been completed. The next step is to install some basic PBX configuration files: 

sudo make basic-pbx

sudo make config

sudo ldconfig

The next step in the essential Asterisk setup is to create a new user. For security reasons, it is better create a new user:

sudo adduser --system --group --home /var/lib/asterisk --no-create-home --gecos "Asterisk PBX" asterisk

Now, you must open the following configuration file / etc / default / asterisk with your favorite text editor and uncomment two lines (remove the # from the beginning):

  • AST_USER = »asterisk»
  • AST_GROUP = »asterisk»

The next thing is to add the created user to the dialout and audio groups that the IP telephony system needs to work:

sudo usermod -a -G dialout,audio asterisk

Now you must modify the permissions and owner of some files and directories to be used with the created user and not with the one used by default Asterisk:

sudo chown -R asterisk: /var/{lib,log,run,spool}/asterisk /usr/lib/asterisk /etc/asterisk

sudo chmod -R 750 /var/{lib,log,run,spool}/asterisk /usr/lib/asterisk /etc/asterisk

Start the process

Once everything is configured, the following is start service which starts the Asterisk process. To do this, just run:

sudo systemctl start asterisk

sudo systemctl enable asterisk

For, verify that it is working:

sudo asterisk -vvvr

If it does not work, check that you have started up properly or if you have some kind of rule of Firewall or security system that may be blocking it.

More information - Asterisk Wiki

Asterisk configuration

Asterisk, alternatives

Once all that is done, you should already have your VoIP telephony server running so that your phones connected to your LAN can function properly. However, if you have to do some kind of setting In particular, you can take into consideration the following important Asterisk files:

  • /etc/asterosk/asterisk.conf: is the main configuration file. In it you can configure all the basics about the system itself, such as the directories where the rest of the configuration is located, the sound files, the modules, etc., as well as important functions of the service.
  • /etc/asterisk/sip.conf: it is another important configuration file, it defines how the SIP protocol works, both to define the users of the system, as well as the servers to which they must connect. Inside you will see two important sections, one [general], for global parameters and other sections or contexts for users and others.
  • /etc/asterisk/extensions.conf: another important Asterisk configuration file. In it you can determine how it will behave.
  • /etc/asterisk/queues.conf- To configure queues and queue agents, that is, members.
  • /etc/asterisk/chan_dahdi.conf: where the groups and parameters of the communication cards are configured.
  • /etc/asterisk/cdr.conf: where it is indicated how to store the records of calls made.
  • /etc/asterisk/features.conf: special features such as transfers, graciones, etc.
  • /etc/asterisk/voicemail.conf- Voicemail accounts and settings.
  • /etc/asterisk/confbridge.conf- To configure conference room users, rooms and menu options.
  • Others: Asterisk is very versatile and flexible, so there can be many more configurations, although these are the main ones.

The content of the article adheres to our principles of editorial ethics. To report an error click here!.

2 comments, leave yours

Leave a Comment

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



  1. Responsible for the data: Miguel Ángel Gatón
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.

  1.   Computer Guardian said

    Very interesting that someone has been encouraged to document the installation and configuration of Asterisk, thanks Isaac.

    Do you plan to continue with other articles on the subject? I left wanting more. I understand that not all of us have network telephones but could we test VoIP software on our mobile devices? (for example)

    I said congratulations and I hope you are encouraged to continue delving into the subject.

    Thank you very much

  2.   Magda said

    Maybe you get here earlier. It includes asterix (more or less) and avoids all manual configuration of the control unit. Anyway you have to spend time and patience.

    Good luck to those who cheer up !!!