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.
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.
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.
You can see how many files transferred and how many files failed.
In the similar way, right click on the file you want to download and click on Download as shown below,
Few key points to remember,
- 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.
- 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.
We hope this tutorial helped you understand how to upload and download files from AWS EC2 instance.