Asterisk IP PBX Installation on Amazon AWS EC2 Web Service – Part 1 of 4

Amazon AWS EC2 Web Service can be used for Basic Asterisk IP PBX Installation proving Scalability, Reliability, and Mobility

In this series, I will details the steps I took to install Asterisk IP PBX on an Amazon EC2 Web Service Cloud.  There aren’t too much information out there so I will do my best to be as detailed as possible.  If you have any questions on the process involved, feel free to email me at and I will do my best to help you.

Part 1 of the series will describe the Amazon EC2 instance setup.  Amazon is nice enough to give out free micro instance for one year so we should take advantage of this for testing purposes.  When creating an instance, you need to keep in mind where the datacenter is located and select the one closest to your geographic location for the best network connection.

During the micro instance creation, we need to configure the Security Group.  Security Group will allow us to open up specific ports for our micro instance and acts like a firewall.

For successful SIP and SSH connection, you will have to open up TCP 22, UDP 5060 and UDP 10000-20000 ports.  Since you don’t necessarily have to open up 10,000 ports for SIP connection, you can limit the number of ports that the Asterisk will use and reduce the number of open UDP ports.

Once the instance is up and running, now it is time to get a static IP assigned to it.  Amazon calls this Elastic IP and it is also free of charge as long as it is associated with a running instance.











Once the Security Group has been associated with your micro instance, we can now start the connection to the running instance.  Typical connection to your instance is via SSH using a Key Pair that you have created during the instance setup.  If you did not, you can always click on the Key Pairs and create one.  You will need to create it and download it to your local computer for successful connection.

To successfully connect to your micro instance using a linux computer, upload the Key Pair file (*.pem) to /root/.ssh folder.  In my example, I will be connecting to the instance via a linux box.  The Key Pair I am using is called ExpressAWS.pem and is located inside the .ssh folder alongside known_hosts file.  At the command prompt, type in:

ssh -i YourKeyPair.pem ec-2user@ElasticIPAddress

The ExpressAWS.pem should be substituted by the name of your Key Pair and the ElasticIPAddress should match the IP address you have associated with the micro instance.  A quick way to find this information is to right click on your running instance and selecting Connect.
























If you cannot connect to your instance, make sure you change the permissions on the Key Pair.pem file to 400.  Otherwise, the permission will be denied and you will have a heck of a time connecting.


Congratulations!  You have successfully created an Amazon AWS micro instance, assigned a Static IP address, opened up the necessary ports on the firewall, and connected to your instance using SSH.

The next post will detail the actual Asterisk IP PBX installation on your micro instance.

If you have any questions or comments regarding this series, let me know via Facebook or Twitter.



About Express Interconnect: We are a Portland, Oregon based Small Business VoIP Phone Consultant specializing in implementing quality VoIP PBX system based on Asterisk IP PBX. We can be reached at 503-820-3513 or via email at: and can help with any questions you might have.

Due to Demand, we have finally branched out into Hosted VoIP Phone Service for Small Businesses.  Our Hosted VoIP Service provides full Asterisk IP PBX functionality in a simple Plug and Play system.

Also, please make sure to visit our on-line store at VoIP Phones Direct for all of your IP Phone needs. We carry Grandstream, Polycom, Snom, Aastra, and Yealink IP Phones with a 14 day money back guarantee and FREE UPS Ground Shipping.

Finally, please join the conversation on Facebook AND Twitter


Share and Enjoy

Tags: , , , , , , ,


  1. Installing DAHDI in Amazon AWS EC2 Web Service « Amazon Aws « Express Interconnect – Small Office Phone System Integrator - March 25, 2012

    […] you have been following my posts on this subject, I learned that the newer versions of Linux AMIs available on Amazon AWS has 1Khz Timing which is […]

  2. Asterisk IP PBX Installation on Amazon AWS EC2 Web Service – Part 3 of 4 « Amazon Aws « Express Interconnect – Small Business Phone System Expert - March 8, 2012

    […] that we have Amazon AWS configured with micro instance and Asterisk installed on it, we can move onto configuring the service […]

  3. Asterisk IP PBX Installation on Amazon AWS EC2 Web Service – Part 2 of 4 « Amazon Aws « Express Interconnect – Small Business Phone System Expert - February 17, 2012

    […] SSH into your micro instance as outlined in Part 1 of this series […]

WordPress SEO fine-tune by Meta SEO Pack from Poradnik Webmastera