- To upload a file into EC2 instance.
- EC2 instance is running.
- You already have a private key file.
- The port 22 is open
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.
- Open the FileZilla
- Go to File menu and click Site Manager
- Click on New site button (Most probably you can find it in left side)
- On the right select General tab.
- Choose the Protocol as SFTP (SSH File Transfer Protocol)
- Enter the value host name or the public IP address of the EC2 instance for Host and you can leave the port value blank.
- Logon Type choose Key file
- 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.
- On the Key file, click on Browse… button and select the PEM file you have saved for the EC2 instance.
- Now, click on Connect button. You should be able to connect to your EC2 instance with the FileZilla.
- When the connection is successful, you can see the FileZilla something like this image.
- 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.
- 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.
Hence, we are able to connect to EC2 instance and upload files with the help of FileZilla.
Leave a Reply