How to upload file on AWS ec2 instance using Filezilla

Filezilla is a popular desktop software that we use to upload files on server using FTP protocol. Because it’s user interface is user friendly and you can upload any file by just drag and drop method. Now the  question is, how can we upload files on AWS ec2 server using this software. Because ec2 instance doesn’t have any password to logon. Instead, it has a private key that you can download from ec2 dashboard. Let’s figure out how to upload file on aws ec2 instance using FileZilla.


Before starting, we assume that you have the following things in your hand.

  1. One ec2 server up and running
  2. You have it’s host address or Public IP address
  3. You have it’s private key in PPK format
  4. FileZilla installed on your local computer

Note for prerequisite #2: Most likely you have private key in pem format instead of ppk format. To convert a pem private file to ppk you can use putty software. Putty can be installed on both windows and linux computer. For more information to convert the file click here.

Important note for prerequisite #2: Make sure that, the private key file’s permission is set to 400.

Login and upload file on AWS ec2 instance using FileZilla

FileZilla Site Manager
FileZilla Site Manager
  1. Open Filezilla
  2. Open site manager (File > Site Manager or Ctrl + S)
  3. Click on New Site Button from bottom right corner of Site Manager dialog box.
  4. Enter the site name whatever you wish (I named it AWS_Training)
  5. On the right side of the dialog box, you will see a box with label Host: Enter public IP or host address of the ec2 instance
  6. From protocol dropdown box, select “SFTP – SSH File Transfer Protocol”
  7. In Logon Type dropdown box select “Key file”
  8. In User text box, type ec2-user
  9. Below user textbox, you can see a box named Key file. Here you press Browse button (left size of the box) and select the private key file in ppk format.
  10. Now press Connect. If everything goes okay, then you can successfully login to the ec2 instance and upload file
  11.  Press okay to come out of the Site Manager dialog box

Now you can use this site configuration to login and upload files on ec2 instance.


How to setup your website in Amazon Web Services (Part 3)

This is the third part of “Setting up website in Amazon Web Services”. In this part of the tutorial, I’ll show you how to upload files on EC2 instance using FileZilla.

It has 2 steps:

Step 1. Add public key to FileZilla

Step 2. Configure the site


Screen Shot 2015-07-11 at 8.57.12 AM

Step 1. Add public key to FileZilla

Open FileZilla

1. FileZilla > Settings (In windows it may be in Window menu)

2. From left panel, select SFTP

3. In right panel, click on Add keyfile.

4. Select your public key. (FileZilla may warn about converting the file into FileZilla format. Click yes.

5. Save the new FileZilla format file in the same place where you kept your public key.

6. Click OK to finish “adding public key” process.


Screen Shot 2015-07-11 at 8.58.03 AM

Step 2. Configure the site

1. Open FileZilla. Go to File > Site Manager.

2. From left side of the Site Manager select “New Site”. You can give it a name. I used “MyAWS”.

3. In right panel put the following setup:

Host: EC2’s Public IP

Port: 22 (or you can leave it blank)

Protocol: SFTP – SSH File Transfer Protocol

Logon Type: Normal

User: ec2-user / root ( see the note below)

Now click connect. FileZilla may warn you about Unknown host key. Just click okay.

If you are running apache on the EC2 instance, then your files are located in /var/www/html/

Now redirect to /var/www/html/ and upload your file on server.


How to setup your website in Amazon Web Services (Part 2)

In this tutorial, we’ll see how to access EC2 instance or vm from local computer using command line interface (CLI). If you are using windows, then I recommend you to install ssh in your command line. This video might be useful for you.

Access EC2 instance:

If you are using Linux or OS X, most likely you already have ssh. Open your terminal or CLI and run the following command:

If you don’t see the version number, then install it.

In previous video, you’ve downloaded public key from Amazon Web Services. Keep it in a place (I prefer Desktop) where you can easily access for a now.

Open command line interface or terminal and go to the folder where you have saved the public key.

Run the following command to protect your private key file:

To access the vm or EC2, run the following command:

Here ec2-user  is the username. It can vary depending on the AMI or system that you selected in previous tutorial. is the “Public IP” that we got from our previous tutorial.


According to Amazon Web Services documentation:

For Amazon Linux, the user name is ec2-user. For RHEL5, the user name is either root or ec2-user. For Ubuntu, the user name is ubuntu. For Fedora, the user name is either fedora or ec2-user. For SUSE Linux, the user name is root. Otherwise, if ec2-user and root don’t work, check with your AMI provider.

After running the above command, if there is no error on the screen, then you are logged into the vm (EC2) successfully.


Install Apache PHP MySQL on EC2 server: 

After logging into the EC2 console successfully, run the following command to ensure that all software packages are upto date:

Above command will take some time to complete.

Now it’s time to install apache, php, mysql. Run

Start apache server:

If you want to start apache server when the EC2 or vm server starts, run:

The above command doesn’t show you any status, but it works.

Allow HTTP to access your web server: 

At this moment Amazon Web Services will not allow anybody to access our newly installed apache server that is HTTP server. To enable HTTP for all, we’ve to make some changes to our security group. Let’s do that now

Go back to your Amazon Web Services console (AWS) in your browser. Go to EC2 > Running instances.


If you scroll horizontally to the right of the table, you can see a “Security Groups” column at the end. Click on it ( red circle marked on the screenshot).


Screen Shot 2015-07-10 at 9.59.21 PM

In the next screen, click  Action > Edit inbound rules.


Screen Shot 2015-07-10 at 10.04.44 PM

A popup box will appear. Click on Add Rule button and then select HTTP from type dropdown box. You don’t have to change any other value. Keep them as they are suggested.  Click Save button.

Again Actions > Edit outbound rules and add new rule of HTTP the same way that you did for inbound rule.

Now, open your browser and type “Public IP”. You can see the following result, if everything goes okay.

Screen Shot 2015-07-10 at 10.06.17 PM


Wow, now your server is accessible from anywhere in the world. In next tutorial, I’ll show you how to upload files using FileZilla.

How to setup your website in Amazon Web Services (Part 1)

Setup Account at AWS: 

Go to and click on Sign in to the AWS console. Here you can get information about signing up. Amazon Web Services provides free tier for 1 year. The free tier includes 21 products and services. Such as Amazon EC2, Amazon S3, Amazon DynamoDB etc. Click here for details. You have to provide your credit card information to open account.

After creating account login to your Amazon Web Services (AWS) console by visiting

You will be redirected to dashboard, after you successfully login. The dashboard contains all the services that amazon offers. Some of them are free for 1 year (e.g. EC2, S3), others will charge.

Create new EC2 instance: 

Now, we’ll setup EC2 instance in our Amazon Web Services. It’s a very easy process and requires only a few steps.



1. Click on EC2 which is located at the top left of the dashboard.



2. Click on Launch instance.



3. In the next screen you will see a list of AMI (Amazon Machine Image) or system images. In short it’s the operating system that you are going to use in your virtual machine (vm) or EC2 instance. Some AMI are free.  You can select any one operating system such as Amazon Linux AMI, Red Hat Enterprise Linux, Ubuntu Server or even Microsoft Windows Server. We are going to select Amazon Linux AMI as free tier covers it.



4. In previous step you selected software. Now, it’s time to select hardware configuration. The page lists different Instances based on different numbers of CPU, memory and storage. If the left column you can see which instance is suitable for which purpose. For example, general purpose, compute optimized, memory optimized or storage optimized. I’m selecting t2.micro instance as it’s free. You can select any one that best suits your needs.

After selecting instance, click on “Review & Launch” button. We could select “Next: Configure Instance Details”. But for simplicity, we are not going there.


img55. In the next screen, click on Launch button which you can find at the bottom right corner. A popup box will appear. It lets you create or select existing key pair. The key pair contains

  • One private key that will be stored in AWS
  • One public key that you will download and store in your local computer. Keep it in a safe place. Because, you need this public key each time you login to your ec2 instance or vm.

After you download the public key and select on the acknowledge check box, launch instances button will be enabled and you can click on it.



6. Congratulations! Your first EC2 instance or vm is being setup. You can see the vm by clicking on View Instances button which is located at the bottom right corner.

When you click on View “Instances button”, you can se a list of instances (now it’s only one vm) in rows. If the setup process is complete, you can see a green circle in Instance column. Otherwise,  you will see yellow circle.

Notice, “Public DNS” and “Public IP” column. You need “Public IP” column’s IP address  for accessing the vm or EC2 instance from your computer. We’ll see that in next tutorial.



How to setup your website in Amazon Web Services (Intro)

Recently, I’ve moved my website ( to Amazon Web Services. To me it was easy and fun. It was also adventurous as I was doing it for the first time. Now, I’m going to share with you, how did I do it.


  • You should be familiar and comfortable to work with CLI (Command line interface).
  • You should be able to run ssh command from your command line (cmd for windows / terminal for linux or mac OS X.)

I’ve divided the tutorial into 4 parts.

Part 1: 

Setup Amazon Web Services (AWS) Account

Setup amazon EC2 instance.

Part 2: 

Access EC2 Service from terminal or command line prompt.

Install Apache PHP MySQL on EC2 server

Part 3: 

Access EC2 File system using FileZilla and upload files

Part 4: 

Add your domain name in Route 53

Change DNS of your domain name.

Check your website on server.