install and setup wordpress on amazon ec2

How To Install WordPress On Amazon EC2 Ubuntu Instance

Note: This is a normal WordPress setup for testing. Please use our latest tutorial on WordPress setup for a high performance and secure WordPress site

You can have WordPress on Amazon by three methods.

1) you can launch an instance using a preconfigured AMI

2) you can install it manually on your server from the scratch.

3) You can use cloudformation default template to launch an instance with WordPress

In this tutorial, I will explain how to install WordPress on Amazon Ubuntu instance from scratch.

Getting Started

1. Launch an Ubuntu Instance: Follow this tutorial How To launch an Ubuntu Instance on Amazon EC2

2.Connect the instance using putty: Follow this tutorial to do that How To connect Amazon EC2 ubuntu Instance Using Putty

3.Update the Server: Once you connect the connect to the server using putty, you have to update the server.

You can set up the lamp server using a single command or you can install all the packages separately. To install lamp server, execute the following command.

The above command will install Php. Mysql, and Apache. You have to install PHPMyAdmin separately. For that, I have given the code at step 7. If you are going to install LAMP server using the above command, then skip steps 4, 5 and 6.

Manual installation of Lamp Server

4. Install MySql: Install the MySql package on Ubuntu Instance.

5. Install Apache2:

6. Install PHP:

7. Install PHP Myadmin:

8. Now enter the public DNS of your server in the browser and check if the web page shows a message “it works” as shown in the following figure. If it appears then we are all good with the installation process till now.
checking apache2 server
9. Go to [your public DNS]/phpmyadmin and enter the username as root and the password you used during MySQL installation. 

[eg :]

10. In PHPMyAdmin page Goto–>privileges–>add user ,enter the username and password of your choice. The hostname is localhost and under database select “grant all users” as shown in the following figure.
11. Download WordPress file to the server . Make sure you download the WordPress file inside WWW folder and untar it using the following commands.

12. Basically, the index.html file will be present inside www folder.  Remove it using the following command

13. Now enter the public DNS followed by /wordpress in the browser. There you can see the WordPress file. Click it and then click “create a configuration file”. If you want your WordPress directly accessible by the public DNS, then you have to copy the files inside WordPress folder to WWW folder.

If you want your WordPress site accessible directly using the url without adding “/wordpress” suffix, then copy all the files from /var/www/wodpress folder to /var/www

14. click “lets go” button.
15. Enter the SQL username and password you created in PHPMyAdmin dashboard and click submit.

16. Click “run and install”

17. Login to  WordPress using the username and password that you have created during the installation process.

That’s it !! your WordPress installation is done. Now you can  manage your WordPress site using its dashboard.

Like and leave a comment if you liked the tutorial.


  • Mahesh

    Hello Sir,
    I used 3) point – sudo apt-get install lamp-server^ after this i used 7th point – sudo apt-get install phpmyadmin –
    1) Configuring mysql-server-5.7 i given password
    2) Configuring phpmyadmin – I selected – apache2
    3) Configuring phpmyadmin – Configure database for phpmyadmin with dbconfig-common?
    I selected – ( Yes )
    MySQL application password for phpmyadmin: – give password

    After this i was trying to use my aws amazon url//phpmyadmin/
    Nothing came i can see only url aws amazon that – Apache2 of ubuntu got working!!…

    Please kindly guide me how to fix this problem im not able to go in PHPmayAdmin….

  • Santosh Deshmukh

    Very Precise and helpful BLOG. However, you should have also covered, how to change the wordpress theme, i mean the necessary permissions required to change the WP theme or any file permission for that matter.

Leave a Reply


If you would prefer not to have the S3 extension in the URL for your website hosted on amazon S3 ,you have an option to…

Read more

When it comes to content, a video is in a class of its own. Nothing else comes close to being able to command the…

Read more
Magento On Ec2

Magento is an open source content management system for e-commerce based web applications. It is a popular…

Read more

Have some content ideas! We will help you publish it!


Cloud Computing Tutorial Blog