Launch your Own Web Server Using AWS

According to Amazon’s website, Amazon Elastic Compute Cloud (AWS EC2) is a web service that provides secure, resizable compute capacity in the cloud. It is designed to make web-scale cloud computing easier for developers.

How to Launch AWS EC2?

The following steps will show you how to launch your own server:

    1. Go to
    2. If you haven’t done already, go ahead and sign up.
    3. Log in to your account and click on EC2 under Compute
    4. Before launching your server, you are going to need a Key Pair that would enable you to access your server after launching it. Normally, AWS will ask you to create one during the launch process. But we will go ahead and create one now.
    5. Under Resources, click Key Pairs.
    6. Click on Create Key Pair.
    7. Give the key a name then hit Create.
    8. You will be prompted to save a .PEM file.

      The .PEM file is very important! Save it in a secure place and in multiple locations where no one can access it. Losing this file means losing your server! I’d save it in 3 different locations. On my personal computer, in an external hard drive or flash drive, and in a secured file hosting cloud like DropBox or Google Drive.
    9. Now, go back to EC2 Dashboard and click Launch Instance to start launching your AWS EC2 server.
    10. Select the server and operating system. The first one is a great fit for our needs because it has PHP and MySQL repositories.
    11. Now choose the specifications that you need. The greater the specifications are, the more expensive it’s going to be. For the purpose of this tutorial, I am going to choose type t2.micro
    12. w click Next: Configure Instance Details
    13. On Step 3: Configure Instance Details, I just left everything as they are. You can change them to whatever you want depending on your needs.
    14. Click Next: Add Storage
    15. On this page, I also left everything as they are. You might need to change the storage to have more space depending on your needs.
    16. Click Next: Add Tags
    17. I didn’t change anything on this page. Click Next: Configure Security Group
    18. On this page, you will need to choose a Security Group. This basically means do you want people to be able to see this website or not. Just give the security group a name and add the following rule if you want your server to be public:
    19. Click Review and Launch
    20. Click Launch
    21. Now, this step is very important. Remember the Key Pair we created earlier? We are putting it use now. In the first drop-down box, select Choose an existing key pair. In the second drop-down box, select the name of the key pair you created. Now check the box after reading and understanding the description in the dialog and then click Launch Instance.
    22. You’re done. It might take up to 2 minutes for your server to be up and running. If it says “2/2 checks passes” under Status Checks and “running” under Instance State, this means your server is up and running.

How to access your AWS EC2 server via SSL?

If you want to access your server via SSL, you can use a great tool called PuTTY.

  1. Download and install PuTTY.
  2. in your AWS, select the instance (server) you have just created. Below you will find some information about the instance. You will need the link that says Public DNS (IPv4) or you can also use the IPv4 Public IP. They both should work fine.
  3. Open up PuTTY.
  4. Paste the link in Host Name (or IP address). Keep post as 22.
  5. Now in the left navigation panel, go to Connection >> SSH >> Auth.
  6. Now select the ec2-user file you downloaded by clicking Browseunder Private key file for authorization.
  7. Click Open.
  8. You will be asked to login. Use ec2-user for your login username then press Enter.
  9. You are all set and now logged in to your server.

    You’re all done. Enjoy your server.

How to access your AWS EC2 server via FileZilla (FTP)?

You might also need to access your server via FileZilla (FTP) to upload your files easily. But before we start, FileZilla can only read PPK for your Key pair. You currently have a PEM Key pair. You are going to have to convert your PEM file to PPK. Here is how you do that:

  1. Download PuTTY Key Generator
  2. Use puttygen to convert PEM file to PPK file.
  3. Start puttygen and select “Load
  4. Select your PEM file.
  5. PuTTY will convert the PEM format to PPK format.
  6. Select “Save Private Key” A passphrase is not required but can be used if additional security is required.

Here is how you can access your server via FTP:

  1. Download and install FileZilla Client.
  2. Open FileZilla.
  3. Go to File > Site Manager
  4. Click New Site
  5. Give your connection a name.
  6. Under the General tab, type in the AWS URL or IP in the Host field.
  7. Choose SFTP – SSH File Transfer Protocol for the protocol.
  8. Logon Type should be Key file.
  9. User should be ec2-user
  10. Under key file, choose your converted PPK file.
  11. Click OK.
  12. Now you can connect to your AWS server by clicking on the top right Open the Site manager icon arrow then select your website.
  13. Connecting to your server will land in the root directory of your server. To upload your files (e.g. PHP scripts) you need to navigator to /var/www/html

Things You Need to Know About your AWS Server:

  • Pricing varies from server to server depending on your use. For pricing details, visit the Amazon EC2 Pricing page.
  • Keep your .PEM in a safe place in three different locations. A good practice is saving the Pair Key in your document folder, a flash drive, and a file hosting service like Dropbox or Google Drive.
  • Stopping your instance and then restarting it will result in a new Public DNS (IPv4) and IPv4 Public IP being assigned. However, you can assign an elastic IP to avoid that

Leave a Comment