Asterisk 16 LTS on Ubuntu Server 18.04 LTS

I have been re-building my linux server, this time moving from Fedora to Ubuntu as part of re-learning and improving on my linux skills. Decided to resurrect my Asterisk lab, which means having an excuse to fire up my Cisco 3750 PoE switch and my SIP phones.

I remember it gave me so much pain building asterisk over Fedora, so much caveats to consider that I did not get to document everything. Moving to Ubuntu, there are so many resources online and seems more straigh forward. Here were the steps I took to get Asterisk 16 LTS running on my Ubuntu Server 18.04 LTS.

First step, best practice would be just to make sure your server is up to date.

sudo apt update && sudo apt -y upgrade

sudo reboot

Obviously, if you are currently ssh’d(if there’s such a word) into it this will cut you off your connection.

Before we proceed, I would suggest to download the dependency package. Take it from me, doing this prior to installing asterisk would save your sanity. When I initially installed asterisk over Fedora and did not follow this step, it drove me mad.

sudo apt -y install git curl wget libnewt-dev libssl-dev libncurses5-dev subversion libsqlite3-dev build-essential libjansson-dev libxml2-dev uuid-dev

Now, it is time to do the install. Go to the following directory:


sudo curl -O

Once the file is downloaded, extract the file.

sudo xvf asterisk-16-current.tar.gz

ok, it has been extracted time to go to the asterisk folder and install mp3 source and pre_requisite files.

cd asterisk-16*/

sudo contrib/scripts/

sudo contrib/scripts/install_prereq install

Note, this may take some time. Well it was on my PC. Actually the next few steps, make take some time to finish so you can use this time to maybe do your laundry, watch a cbt-nugget videos as there is some waiting involved.

Another note, I have done installs where you’re going to get an error message saying “svn: not found”. To fix this you will have to install subversion:

sudo apt install subversion

That should fix the issue and you can go ahead and install mp3 and pre-requisite files.

Time to configure the pbx, this is where the fun begins!..well I think it is. type:

sudo ./configure

After maybe making yourself some coffee you’ll end up with the screen below:

To install additional feature set type:

sudo make menuselect

Just look at the screenshots below and make sure you follow along what has been ticked. Don’t forget to Save & Exit.

Once you are back at the CLI, run the following commands:

sudo make

sudo make install

Each one would take time, I would probably be able to cook an entire meal while I wait for each item to finish its install. If you did cook yourself or your family a meal, have some lunch or dinner. Go back to your server and maybe install the documentation. You can do this by typing:

sudo make progdocs

This is going to take a while again so take this opportunity to have a stroll by the park and visit the neighbours and have a chat. Then when done, run the following to finish configuration:

sudo config

sudo make samples

sudo ldconfig

Now let us create the asterisk user group and user. Just follow along as per the screenshot below:

Using your preferred text editing tool, for myself I use nano.

sudo nano /etc/default/asterisk

Remove the # infront of AST_USER and AST_GROUP. Make sure you save your work. If you are using nano, Ctrl+O to save, Ctrl+X to exit out.

Next we will edit the asterisk.conf file. Again don’t forget to save your work.

sudo nano /etc/asterisk/asterisk.conf

Make sure you run the following command to wrap up your configuration with:

sudo systemctl restart asterisk

sudo systemctl enable asterisk

The first one restarts the service specially making any change on the system, while the other enables asterisk to start after a system reboot.

Moment of truth, to access asterisk just type the following command as per the screenshot below. Once you see *CLI> next to the cursor then you good to go.

By the way, if you are running the linux firewall (ufw) make sure you enable ports 5060 & 5061 as per below:

To verify your firewall rules just type:

sudo ufw status numbered

There you have it! Probably the entire process is less than 3 hours from my experience it may be quicker from your end depending on the laptop, PC or infrastructure you are using. In the next related post, we’ll configure this bad boy to make its first internal call.

I hope you guys were able to follow along.

Stay tuned!

Journey into Linux (Ubuntu 18.04)

The other day I was fixing my laptop that was running my asterisk setup, it was installed over Fedora it just works so well that I have not bothered to log into for months.

Returning from my trip to Japan trip, I’ve decided to play with it and after a reboot, it never came back to life. I spent the day researching on-line for the solution but was not successful. I’ve decided to rebuild the system but mid-way changed my mind again and instead downloaded Ubuntu server.

Rather than do the old school bare-metal install, went for the usual vm workstation approach. I would be lying if I said I didn’t feel a great odd feeling getting into the CLI like feeling. Since becoming a solutions architect which entails doing a lot of pre-sales work and number crunching, it has been awhile since I’ve touched a Cisco device apart from the devices I have in my home lab. So installing linux was very refreshing.

This then led me to the idea of creating content despite there are tons out there regarding linux and who have done it for years. At least if you are like me, have decided to get into the journey of (re)-learning Linux particularly Ubuntu server, this is a great opportunity. I still need to figure out if I will create youtube content. It takes (a lot of) time creating YT content for me especially if it entails doing screen captures.

It is a great segway into programming as well like Python that may eventually lead me back into network programmability as what I’ve initially started way back.

So…here we go then.