How to Install Magento On Amazon (AWS EC2)

Magento is an open source eCommerce platform which is highly customizable and secured. You can setup your own online store with any feature that suits you. Magento provide shopping cart, inventory management and much more. Today we will focus on how to install Magento on Amazon Aws Ec2.

For this tutorial I assume that you have already know how of how to launch an Ubuntu instance on amazon ec2 and connect ec2 instance using putty. Make sure you open port 80 in the EC2 instance security group when launching Ubuntu.

Log in as root user

after login the EC2 instance with ubuntu user run the below command to get root login

Sudo Su

Now update the server

apt-get update

apt-get works with Ubuntu’s APT (Advanced Packaging Tool) library to perform any installation, updates and removal of software packages. Here we are using to update server.

Install LampStack

apt-get –y lampstack

Magento needs apache, php and MYSQL database as an initial requirement. We can configure all three using this single command

During installation it will prompt you to enter the root password for mysql, kindly enter your password and note it which will require for further use.


You can even do this by Taskel

Use following commands:

apt-get install taskel

taskel install lamp-server

Check if Mysql and apache services are running

Service apache2 status

Service mysql status

This command will return the status of apache2 and MYSQL

Setup MySQl Client

You can install Phpmyadmin in(Secure way to access database. We suggest to use MySQL Client like MySQL Workbench and SQLyog

On terminal create ssh user

adduser magento

(you can use any name you like)

It will ask to enter password twice, kindly enter the password of your choice.


Following these steps to connect MySQL Server with MySQL Workbench

Please follow the below step to Setup A New Connection

1- Type the Connection Name : My Msql Connection

2- Select Standard TCP/IP over SSH — from Connection Method

3- SSH Hostname :

4- SSH Username : your_ssh_user

5- SSH password : enter Your_SSH_Password

6- Mysql Hostname :

7- Mysql username : Your_MySQL_User

8- Mysql Server Port : 3306

9- Mysql Password : Your_Mysql_Password

10 Click on ok

Click the database symbol with the plus sign 

(shown in the below picture). Enter name Magento and click Apply.


Download Magento

Typ below commands to download magento

mkdir /var/www/magento/

cd /var/www/magento/


untar the downloaded file

tar –xvzf mag*

Give write permissions to Magento

Now you will need to give write permissions to Magento in the following folders

Chmod –R o+w magento/app/etc

Chmod –R o+w magento/var

Chmod –R o+w magento/media

Add encrypt extension to php.ini

Now add encrypt extension to php.ini at the following location /etc/php5/apache2/php.ini

Vi /etc/php5/apache2/php.ini

Install php Curl

We need to install php curl for Magneto. Here we are installing php5

apt-get install php5-curl apt-get install php5-curl

Hola! Now you are just few steps away to experience Magento. Type your ip followed by /magento. Magento installation wizard will appear.


  1. Accept the terms and condition and click continue
  2. Select your currency , Time zone and local and hit continue
  3. Enter MySQL credentials and the database name you just created. For this tutorial we created database MagentoDB. Enter the details
  4. Now create admin account. Enter your personal information, login information and encryption key to successfully create admin account and continue.
  5. Hurray you are done! Access Magneto front end or back end from the buttons. You can also integrate payment gateway (optional).

If you have any questions then do leave a comment below and we will instantly provide you with the solutions ☺

Mubashir Ahmad

Community Manager at Arpatech at ArpatechOps
Mubashir has served many clients in the domain of Web Development. He loves to work in Business Intelligence and Data-warehousing. He is engaged in latest eCommerce trends and also loves to Travel. You can follow him on Twitter @m_ahmdd or e.mail mubashir.ahmad[at]

Latest posts by Mubashir Ahmad (see all)

Arpatechops - Managed Ecommerce Hosting Solutions
ArpatechOps bring you E-commerce
Managed Hosting and Application
Support services.



  • Facebook Linkdedin Twitter