In this article, you’ll download and install Filezilla, connect Filezilla using PEM file and SFTP from your windows computer.
You’ll connect to EC2 file directory using Filezilla, access files on AWS EC2 file directory and upload files to EC2 instance, download files from EC2 instance using FileZilla.
Filezilla is open-source software for FTP, FTP over TLS (FTPS), and SFTP clients. It also contains Filezilla servers (supports only in Windows). Filezilla is one of the AWS SFTP clients. Some of the other AWS SFTP clients are Cyberduck, WinSCP, and OpenSSH.
Filezilla supports various features such as,
- Overwrite existing files only if file size does not match or the file is newer.
- Supports IPv6
- Ability to pause and continue active transfers etc.
To know about more features of Filezilla visit this wiki page.
Before you start, you’ll need the following.
- If you do not have servers in the cloud, Create an AWS EC2 Ubuntu server instance by following the guide How to launch an EC2 Instance.
- [Important] – Update the packages list in the server which is upgrade-able using
sudo apt update
- [Important] – Upgrade the packages in the server to the latest versions using
sudo apt upgrade
Downloading and Installing Filezilla Client
In this step, you’ll download Filezilla and install it (You can skip this step if Filezilla is already installed).
First, go to the Filezilla Official Website.
Next, Press the Filezilla Download button shown in the below image.
Next, you’ll see a window popup as shown below. In the option select the Filezilla Download button (Option I).
Setup binary file will be downloaded. Go to the “Downloads” folder and double click the downloaded binary file. (If you are asked, “Do you want to run this file?“, Press “Yes”.)
Next, You can see the installation window opened as shown in the image below.
Next, you’ll be asked whether you wish to install Filezilla for all users. It is recommended to install it using the option, only for me (the current user) if more than one person will be using the system.
Press the Next button, after selecting an option.
You can leave other settings default and Press the Next button.
Next, choose the directory you wish to install Filezilla and Press the Next button (If you are asked to install any additional components, Press the Decline button.).
Finally, Press the Finish button. You’ve successfully downloaded and installed Filezilla Client.
In the next step, you’ll customize Filezilla to support SFTP connections.
Setting Up SFTP and Connect Filezilla Using PEM File
In this step, you’ll set up SFTP in Filezilla.
SFTP stands for SSH File Transfer Protocol. It is a network protocol that provides file access, file transfer, and file management over any reliable data stream.
Privacy Enhanced Mail (PEM) files are concatenated certificate containers frequently used in certificate installations when multiple certificates form a complete chain and imported as a single file.
First, Open your Filezilla Client installed in the previous step.
Next, Press Edit in the Menu.
Press Settings in the sub menu.
Next, select SFTP under Connection from the Select Page in the left tab.
Next, Press the Add key file button. Go the folder containing the .pem file of your EC2 instance. Select the .pem file.
You can see that the key file is added successfully for your SFTP connection.
Finally, Press Ok.
In the next step, you’ll connect to EC2 file directory using Filezilla and SFTP.
Creating a New Site and Connect to EC2 File Directory Using Filezilla
In this step, you’ll create a new site in Filezilla and connect to EC2 file directory using Filezilla and SFTP.
A new site helps you to connect to your EC2 instance easily by storing IP addresses and Key files in a new site.
You can reuse this site later by navigating to File > Site Manager > My Sites and Press the connect button whenever you want to connect to your EC2 instance.
To create a new site, Go to File Menu.
Next, Press the New site Button (as shown below in Figure 10) and name your site. You can see that site is added under My Sites as shown in the image below.
Next, set the following parameters in the corresponding field as shown below (in the Figure 11).
Host: Public DNS name or IP address of the EC2 instance.
User: Username is different for the different Amazon Machine Images as given below. Enter the user name based on the AMIs of your EC2 Instance.
- Linux AMI- root
- Ubuntu AMI- ubuntu
- Default Linux AMI- ec2-user
Finally, Press the Connect button.
You can verify if the connection is established between Filezilla and EC2 file directory by seeing the Remote site column in Filezilla. This is shown in the below image (Figure 12).
In the next step, you’ll learn how to transfer files between EC2 file directory and local machine and also access files on AWS EC2 file directory.
Transferring Files Between Your Local Machine and EC2 File Directory
In this step, you’ll download files from EC2 instance and upload files to EC2 instance using Filezilla to your EC2 file directory.
You’ve established a connection with the EC2 file directory in the previous step. With that, Downloading and uploading files is pretty straightforward.
First, you’ll learn how to download files. Navigate to the folder (in the Remote site column) that you want to download.
Next, navigate to the folder (in the Local site column) where you want to download the files from EC2.
Next, right-click the folder name (in the Remote site column). You can see a Download button in the options as shown in the image below.
Finally, Press the Download button. You can verify if the files are downloaded by navigating to the folder using file explorer.
Similarly, you can upload the files to your EC2 file directory by Navigating to the right locations in your Remote and Local site.
Next, Right-click on the local site folder.
Finally, press the Upload button. Files will be uploaded.
You’ve transferred files to and from the EC2 file directory into your local system.
In this tutorial, You’ve successfully installed Filezilla on your local machine. You’ve created a new site in Filezilla and used it to connect to your EC2 file directory using SFTP. You’ve also learned how to download and upload files to the EC2 file directory from your local machine.
How to access files on Amazon EC2
You can access your Amazon EC2 files using Filezilla. It establishes an SFTP connection to your EC2 instance.
How do I connect FileZilla to ec2?
You can configure a new site in Filezilla using your Host, Port, PEM file, and user. Then simply login to the new site with your password.
Where is site manager in Filezilla?
The site manager in Filezilla is under the File menu.
File > Site manager
Amazon AWS Filezilla transfer permission denied
To allow write access to the directory(E.g. public web directory) for the user ubuntu. . Try the following command on your server.
sudo chown -R ubuntu:ubuntu /var/www/html sudo
chmod -R 755 /var/www/html
How do I view EC2 files?
You can view your EC2 files using Filezilla. Once you established a connection with EC2 instance, you will be able to view your files in the Remote site section.