Skip to end of metadata
Go to start of metadata

Build and Install Instructions

Now we can compile and install Asterisk. To compile Asterisk, simply type make at the Linux command line.

[[email protected] asterisk-14.X.Y]# make

The compiling step will take several minutes, and you'll see the various file names scroll by as they are being compiled. Once Asterisk has finished compiling, you'll see a message that looks like:

+--------- Asterisk Build Complete ---------+
+ Asterisk has successfully been built, and +
+ can be installed by running:              +
+                                           +
+                make install               +
+--------- Asterisk Build Complete ---------+
On this Page

As the message above suggests, our next step is to install the compiled Asterisk program and modules. To do this, use the make install command.

[[email protected] asterisk-14.X.Y]# make install

When finished, Asterisk will display the following warning:

+---- Asterisk Installation Complete -------+
+                                           +
+                                           +
+ Asterisk has successfully been installed. +
+ If you would like to install the sample   +
+ configuration files (overwriting any      +
+ existing config files), run:              +
+                                           +
+                make samples               +
+                                           +
+---- Asterisk Installation Complete -------+

Security Precautions


As the message above suggests, we very strongly recommend that you read the security documentation before continuing with your Asterisk installation. Failure to read and follow the security documentation can leave your system vulnerable to a number of security issues, including toll fraud.

Advanced Build and Install Options

Customizing the Build/Installation

In some environments, it may be necessary or useful to modify parts of the build or installation process. Some common scenarios are listed here

Passing compilation and linkage flags to gcc

Specific flags can be passed to gcc when Asterisk is configured, using the CFLAGS and LDFLAGS environment variables:

[[email protected] asterisk-14.X.Y]# ./configure CFLAGS=-pg LDFLAGS=-pg

Debugging compilation

To see all of the flags passed to gcc, build using the NOISY_BUILD setting set to YES:

[[email protected] asterisk-14.X.Y]# make NOISY_BUILD=yes

Building for non-native architectures

Generally, Asterisk attempts to optimize itself for the machine on which it is built on. On some virtual machines with virtual CPU architectures, the defaults chosen by Asterisk's compilation options will cause Asterisk to build but fail to run. To disable native architecture support, disable the BUILD_NATIVE option in menuselect:

[[email protected] asterisk-14.X.Y]# menuselect/menuselect --disable BUILD_NATIVE menuselect.makeopts

[[email protected] asterisk-14.X.Y]# make

Installing to a custom directory

While there are multiple ways to sandbox an instance of Asterisk, the preferred mechanism is to use the --prefix option with the configure script:

[[email protected] asterisk-14.X.Y]# ./configure --prefix=/usr/local/my_special_folder

Note that the default value for prefix is /usr/local.

Other Make Targets


Executing make with no target is equivalent to the all target.


Compiles everything everything selected through the configure and menuselect scripts.


This is equivalent to make or make all, save that it will perform a more thorough investigation of the source code for documentation. This is needed to generate AMI event documentation. Note that your system must have Python in order for this make target to succeed.

Version Notice


This build target is only available in Asterisk 11 and later versions.

installInstalls Asterisk, building Asterisk if it has not already been built. In general, this should be executed after Asterisk has successfully compiled.
uninstallRemoves Asterisk binaries, sounds, man pages, headers, modules and firmware builds from the system.

Same as the uninstall target, but additionally removes configuration, spool directories and logs. All traces of Asterisk.


As just noted, this will remove all Asterisk configuration from your system. Do not execute uninstall-all unless you are sure that is what you want to do.

cleanRemove all files generated by make.
dist-cleanRemove pretty much all files generated by make and configure.
samplesInstall all sample configuration files (.conf files) to /etc/asterisk/. Overwrites existing config files.
configInstall init scripts (startup scripts) on your system.
progdocsUses doxygen to locally generate HTML development documentation from the source code.  Generated in the doc/ subdirectory of the source; see doc/index.html.




  • No labels


  1. Fellows sysadmins using Ubuntu 16.04 LTS distro, read this carefully!

    There is an issue with the libunbound2 version provided in the apt repository that could prevent you to make calls with the PJSIP driver if you are using endpoints that relies on DNS.

    This happens gradually when Asterisk is handling more thant ~500 channels, the more channels you have, the more likely it will happen.

    Note that your calls will be silently discarded with no warning or error messages unless you have debug enabled, this is not an Asterisk bug and it is only affecting Ubuntu 16.04.

    Please check this post on the bugtracker for details & solution : ASTERISK-28171 - res_resolver_unbound: DNS issue when under load, can't make outgoing calls Closed



  2. make progdocs since commit fd98835, the HTML is put into the subdirectory doc/api/ which results in doc/api/index.html