FileZilla SFTP to EC2

Beginner
9 min read
Updated: Nov 2026
5 examples
EC2 / SFTP / FileZilla

Definition and Usage

FileZilla is a free desktop client that supports SFTP. On Amazon EC2, SFTP lets you drag-and-drop files to a remote Linux home directory without mounting disks.

What does SFTP to EC2 mean?

You authenticate with the same host, username, and private key you would use for SSH. Traffic rides on port 22, so the security group rule that allows PuTTY also allows FileZilla.

When should you use FileZilla?

Use it to upload project trees before deploys such as Node.js on EC2 or React on EC2. Prefer CLI tools like scp or rsync when you automate transfers in scripts.

What you will configure

FileZilla Site Manager with SFTP, your public DNS or Elastic IP, the AMI login name, and a .ppk (or supported .pem) key file.

FTP vs SFTP

Always pick SFTP. Standard Ubuntu and Amazon Linux images expose SSH on 22, not classic FTP on 21.

Same credentials as SSH.

If PuTTY connects with your key and user, FileZilla should too once Site Manager uses SFTP on port 22.

Port 22 must be open.

Your security group needs inbound TCP 22 from your IP. Opening SSH to 0.0.0.0/0 is fine only for short labs.

Next after SFTP works.

Upload your app, then follow Deploy Node.js on EC2 (or Express / React / Next) for process managers and ports.

Core Concepts

Terms you will use while transferring files:

ConceptMeaning
SFTPSSH File Transfer Protocol — encrypted file transfer over port 22
Site ManagerFileZilla place to save host, user, and key settings
HostPublic IPv4 or public DNS of the EC2 instance
Key filePrivate key (.ppk or supported .pem) matching the instance key pair
ubuntu / ec2-userDefault SSH users for Ubuntu vs Amazon Linux AMIs
TCP 22Security group inbound port shared by SSH and SFTP
Elastic IPStable public IPv4 so Site Manager host does not change after stop/start
Home directoryUsual upload target (for example /home/ubuntu) before sudo moves

Prerequisites

Gather these before you open Site Manager:

  • A running EC2 instance with public IPv4 or DNS (prefer an Elastic IP). Launch one with the EC2 launch guide if needed.
  • Security group inbound TCP 22 from your current IP. If PuTTY works, FileZilla usually will too.
  • The private key for the instance (.ppk from PuTTYgen on Windows, or a supported .pem). Convert with PuTTYgen if FileZilla rejects the format.
  • Correct SSH username: ubuntu for Ubuntu AMIs, ec2-user for many Amazon Linux AMIs (confirm in EC2 Connect).
EC2 instances list with instance in running state
Amazon EC2

Examples

Install FileZilla, save an SFTP site, copy host and user from EC2, then connect and transfer files.

Example 1 — Install FileZilla

Download the official FileZilla Client for your OS.

  1. Open the FileZilla Client downloads page.
  2. Install the standard client (not Server) for Windows, macOS, or Linux.
  3. Launch FileZilla when the installer finishes.

How It Works

  1. FileZilla Client is the GUI you need for SFTP to EC2.
  2. Avoid random mirrors—use the official project site.
  3. Site Manager stores reusable connection profiles.
  4. Alternatives such as WinSCP work similarly on Windows if you prefer them.

Example 2 — Configure Site Manager

Open File → Site Manager (or the toolbar icon), create a New site, and set SFTP parameters.

  1. Protocol — SFTP (not FTP).
  2. Host — public IPv4 or public DNS (copied in the next example).
  3. Port — 22.
  4. Logon Type — Key file (or your build’s key-based option).
  5. User — ubuntu or ec2-user (confirmed in Example 4).
  6. Key file — browse to your private key (.ppk or supported .pem).
FileZilla Site Manager with New Site
FileZilla
FileZilla Site Manager SFTP host user and key file
FileZilla

How It Works

  1. SFTP uses the SSH service already running on the instance.
  2. Key file logon matches EC2’s key-pair auth (no password by default).
  3. Wrong protocol (FTP) fails because port 21 is not open by default.
  4. Save the site so you reconnect without retyping after reboots.

Example 3 — Copy Public DNS or IP

Read the host value from the EC2 console.

  1. Open Instances and select your instance.
  2. Choose Connect.
  3. Open the SSH client tab and copy the hostname (or use Public IPv4 address from the details pane).
  4. Paste that value into FileZilla’s Host field.
EC2 Connect dialog showing SSH hostname and user
Amazon EC2

How It Works

  1. Public DNS and IPv4 both work as Host.
  2. Elastic IP keeps the same Host after stop/start—see the Elastic IP guide.
  3. Private IPs only work from inside the VPC (not from your home laptop).
  4. Region mismatch is rare here; just confirm you selected the right instance.

Example 4 — Confirm the SSH Username

Match FileZilla’s User field to the AMI default shown in EC2 Connect.

  1. Open Instances, select the instance, then Connect.
  2. Use the SSH client tab for the example user and command.
  3. Enter that user in Site Manager (ubuntu for Ubuntu, ec2-user for many Amazon Linux AMIs).
EC2 Connect SSH client tab with default username
Amazon EC2

How It Works

  1. Usernames are case-sensitive and AMI-specific.
  2. EC2 Connect shows the exact default for your image.
  3. Wrong user + right key still fails authentication.
  4. Same user as PuTTY avoids split-brain configs between shell and SFTP.

Example 5 — Connect and Transfer

Connect from Site Manager and confirm the remote listing.

  1. In Site Manager, choose Connect (or connect from the toolbar after selecting the site).
  2. Accept the host key prompt the first time if it appears.
  3. Confirm the remote home directory (for example /home/ubuntu) in the right-hand pane.
  4. Drag files from local (left) to remote (right) to upload.
FileZilla connected to EC2 showing remote file listing
FileZilla

How It Works

  1. Host key prompts appear once per new host fingerprint—verify before accepting.
  2. Home directories are writable for the default user; system paths may need sudo later over SSH.
  3. Skip node_modules when uploading Node apps; run npm install on the instance.
  4. Next: deploy with Node.js, Express, or React.

Edge Cases & Pitfalls

Most SFTP failures are port 22, wrong user, or key format.

timeout

Connection refused or timeout

Confirm the instance is Running, has a public IP/DNS path, and the security group allows inbound TCP 22 from your current public IP (VPNs change this often).

auth

Authentication failed

Username must match the AMI, and the private key must match the key pair on the instance. Convert .pem to .ppk with PuTTYgen if FileZilla rejects the key.

ftp

Protocol set to FTP

FTP uses port 21 and is not enabled by default. Switch Site Manager to SFTP on port 22.

perms

Permission denied on upload

Upload to /home/ubuntu (or your user home), then sudo mv / chown into system paths over SSH.

ip

Host changed after stop/start

Ephemeral public IPv4 changes. Attach an Elastic IP and update Site Manager Host once.

npm

Uploaded laptop node_modules

Native modules can break across OS/CPU. Exclude them and run npm install on EC2.

Key Takeaways

  • SFTP on 22: same port, user, and key as SSH.
  • Host: public DNS, public IPv4, or Elastic IP.
  • User: ubuntu or ec2-user as shown in EC2 Connect.
  • Upload to home first: then deploy with Node/Express/React guides.

One line: Site Manager → SFTP + host + AMI user + key file on port 22.

Frequently Asked Questions

Use SFTP (SSH File Transfer Protocol) on port 22 with your EC2 key-based login. Classic FTP on port 21 is not enabled by default on Amazon Linux or Ubuntu images.
For official Ubuntu AMIs the default SSH user is typically ubuntu. For Amazon Linux it is often ec2-user. Confirm in the EC2 Connect panel for your AMI.
Check that the instance is running, has a reachable public IP or DNS name, and that the security group allows inbound TCP 22 from your current address. Corporate VPNs and home IP changes are common causes of sudden failures.
Recent FileZilla builds on some platforms can use OpenSSH-format keys. On Windows, converting the key to .ppk with PuTTYgen is still a reliable path. Always protect private keys and never share them.
Yes. SFTP runs over SSH, so the connection is encrypted and authenticated with your server keys and client credentials.
Upload to your home directory first, then use sudo to move files into system paths such as /var/www, or adjust ownership with chown for app folders you own.

Next: Deploy Node.js on EC2

With SFTP working, copy your project to the instance and run it under PM2.

Deploy Node.js on EC2 →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful