Published on

How to Upload and Download Files from AWS EC2 Instance

Published on

How to Upload and Download Files from AWS EC2 Instance

In this tutorial, you will learn step by step guide to upload and download files from AWS EC2 instance by using FileZilla.

Upload and Download Files from AWS EC2

Step 1: Download and Install FileZilla.

Step 1: Open FileZilla and go to Edit -> Settings -> SFTP. Click on Add key file and add your .ppk /.pem file of your AWS instance and then click OK.

file-zilla-sftp

Step 2: In FileZilla homepage enter the host details (public IP, elastic IP or the public DNS) and enter the username in the relevant field.

The username is different for each operating system. They are:

OS vs Username
Amazon - ec2-user
Centos - centos
Debian - admin or root
Fedora - ec2-user
RHEL - ec2-user or root
SUSE - ec2-user or root
Ubuntu - ubuntu or root

FileZilla will be connected to your server instance and you can view your server files and folders.

aws-ec2-filezilla
aws fundamentals

Uploading Files:

Once FileZilla is connected to your server instance, You can upload files to your instance. The local site is your local system files. The remote site is your server instance.

To upload files choose the directory on your server where you want your files to be uploaded. In my case, its /home/ubuntu.

Now select the file to be uploaded and right-click on it.  Click the upload file option. Your file starts uploading to the directory you selected.

upload-file

You can see how many files transferred and how many files failed.

upload-status

Downloading Files:

In the similar way, right click on the file you want to download and click on Download as shown below,

download-file

Few key points to remember,

  1. Since you are logged as a user, you cannot upload the files to the root directory due to permissions issues. Alternatively, you can upload files to home directory and copy those files to root directory using SSH Client such as Putty.
  2. You can’t download the files which are owned by the root. You will get permission denied error when you try to download a file owned by root.

To download the files owned by the root, open SSH session into the machine and change the owner of that file to the normal user using the following command.

sudo chown user:user /folder/file

Change the username based on your operating system.

aws fundamentals

Conclusion

We hope this tutorial helped you understand how to upload and download files from AWS EC2 instance.

Please do share it with your friends and don’t forget to follow us on FacebookTwitter and LinkedIn. Visit our AWS Hub for more tutorials and updates.

In this tutorial, you will learn step by step guide to upload and download files from AWS EC2 instance by using FileZilla.

Upload and Download Files from AWS EC2

Step 1: Download and Install FileZilla.

Step 1: Open FileZilla and go to Edit -> Settings -> SFTP. Click on Add key file and add your .ppk /.pem file of your AWS instance and then click OK.

file-zilla-sftp

Step 2: In FileZilla homepage enter the host details (public IP, elastic IP or the public DNS) and enter the username in the relevant field.

The username is different for each operating system. They are:

OS vs Username
Amazon - ec2-user
Centos - centos
Debian - admin or root
Fedora - ec2-user
RHEL - ec2-user or root
SUSE - ec2-user or root
Ubuntu - ubuntu or root

FileZilla will be connected to your server instance and you can view your server files and folders.

aws-ec2-filezilla
aws fundamentals

Uploading Files:

Once FileZilla is connected to your server instance, You can upload files to your instance. The local site is your local system files. The remote site is your server instance.

To upload files choose the directory on your server where you want your files to be uploaded. In my case, its /home/ubuntu.

Now select the file to be uploaded and right-click on it.  Click the upload file option. Your file starts uploading to the directory you selected.

upload-file

You can see how many files transferred and how many files failed.

upload-status

Downloading Files:

In the similar way, right click on the file you want to download and click on Download as shown below,

download-file

Few key points to remember,

  1. Since you are logged as a user, you cannot upload the files to the root directory due to permissions issues. Alternatively, you can upload files to home directory and copy those files to root directory using SSH Client such as Putty.
  2. You can’t download the files which are owned by the root. You will get permission denied error when you try to download a file owned by root.

To download the files owned by the root, open SSH session into the machine and change the owner of that file to the normal user using the following command.

sudo chown user:user /folder/file

Change the username based on your operating system.

aws fundamentals

Conclusion

We hope this tutorial helped you understand how to upload and download files from AWS EC2 instance.

Please do share it with your friends and don’t forget to follow us on FacebookTwitter and LinkedIn. Visit our AWS Hub for more tutorials and updates.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Related Articles

How to Create Multiple Folders at Once in Windows 10

Creating folders and subfolders manually is time consuming tasks...

How to Integrate Solace with MuleSoft using JMS API

In this tutorial, we will demonstrate step by step...

How to Open Port on AWS EC2 Instance

In this tutorial, we will demonstrate step by step...

LEAVE A REPLY

Please enter your comment!
Please enter your name here