Upload file to EC2 instance AWS

Objective

  • To upload a file into EC2 instance.

Prerequisite

  • EC2 instance is running.
  • You already have a private key file.
  • The port 22 is open

Solution

To upload a file we can use any FTP client. In this example, we are going to use FileZilla. If you don’t have already on your computer then you can download it from https://filezilla-project.org/download.php and install.

I am assuming that the FileZilla is installed in your computer.

Steps:

  1. Open the FileZilla
  2. Go to File menu and click Site Manager
  3. Click on New site button (Most probably you can find it in left side)
  4. On the right select General tab.
  5. Choose the Protocol as SFTP (SSH File Transfer Protocol)
  6. Enter the value host name or the public IP address of the EC2 instance for Host and you can leave the port value blank.
  7. Logon Type choose Key file
  8. User ubuntu or ec2-user it depends on the AMI you have configured. Basically, if your ec2 instance is Ubuntu then the user would be ubuntu, ec2-user if it is Amazon Linux Ami and so on.
  9. On the Key file, click on Browse… button and select the PEM file you have saved for the EC2 instance.
  10. Now, click on Connect button. You should be able to connect to your EC2 instance with the FileZilla.
  11. When the connection is successful, you can see the FileZilla something like this image.
  12. You can upload the file from your local site to remote site. Let’s say, you want to upload a file in /home/ubuntu directory of your remote site then you can type /ubuntu/home in the remote site and hit enter.
  13. From the left side, you can choose your file and right click on it then click Upload. You should be able to see the status of the file upload in the bottom of the FileZilla.

Conclusion

Hence, we are able to connect to EC2 instance and upload files with the help of FileZilla.

Leave a Reply

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x