Step-by-Step Guide to Transfer Files from Local Machine to AWS EC2 Using PuTTYgen & WinSCP


This guide will help you:
Convert your AWS .pem key to .ppk using PuTTYgen.
Securely transfer files from your local machine to an EC2 instance using WinSCP.
Prerequisites
- AWS EC2 instance running (Linux/Windows)
Don't have one yet? Don't have one yet? Follow my guide on launching an AWS EC2 instance and getting a private key (.pem) https://nucloud.hashnode.dev/ec2
Private key (.pem file) downloaded from AWS
PuTTYgen installed (Download here)
WinSCP installed (Download here)
Step 1: Convert .pem Key to .ppk Using PuTTYgen
Since AWS provides a .pem key but WinSCP requires a .ppk key, we need to convert it.
Open PuTTYgen
- Launch PuTTYgen (search for it in Windows).
- Load the AWS .pem Key
- Click "Load"
Select All Files in the file dialog, on your Download folder browse and select your .pem key (e.g. MYFIRSTKEY).
- A dialog box will appear and say you have successfully imported your key, click the ok button and also click the save private key button
Save as .ppk Key
Rename file and Save private key".
Confirm saving without a passphrase (or set one for extra security).
Step 2: Connect to EC2 Instance Using WinSCP
WinSCP allows secure file transfer (SFTP/SCP) between your local machine and EC2.
Open WinSCP
Launch WinSCP and click "New Session.
- Configure Connection Settings
File Protocol: SFTP (default for Linux EC2)
Host Name: ec2 instance public IP address
Port Number: 22 (default for SSH/SFTP)
User Name:
For Amazon Linux/Ubuntu: ec2-user/ubuntu
For CentOS/RHEL: centos
For Debian: admin
For Windows: Administrator
- Load Private Key .ppk
Click "Advanced" → Go to "SSH" → "Authentication".
Under Private key file, browse and select your .ppk file MYFIRSTKEY.PPK
Click OK to save setting
Click on Save to save login credentials.
- A dialog box will appear that says save session as site click Ok
Login
Click "Login".
If prompted, confirm the host key (click accept)
Step 3: Transfer Files Between Local & EC2
Once connected, WinSCP will show two panels:
Left panel: Your local files c:\user\Admin\Desktop
Right panel: EC2 instance files home/ubuntu/
Uploading Files (Local → EC2)
Navigate to the desired folder on the EC2 instance (e.g., home/ubuntu/).
Drag & drop files from the left (local) to the right (EC2).
Downloading Files (EC2 → Local)
Select files/folders on the EC2 side (right panel).
Drag & drop them to your local machine (left panel).
Folder transfer succesful (local → EC2)
Our rental folder has been transferred successfully to our Amazon EC2 instance.
Step 4: Verify File Transfer on EC2 instance
After transferring, you can verify by connecting to your instance via ec2 instance connect and type the command ls to verify that the rental folder is on our home directory.
Conclusion
With PuTTYgen and WinSCP, transferring files between your local machine and an AWS EC2 instance is quick and secure. By converting your .pem
key to .ppk
and using WinSCP’s intuitive interface, you can easily upload, download, and manage files on your cloud server.
Subscribe to my newsletter
Read articles from SUBAIR NURUDEEN ADEWALE directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by

SUBAIR NURUDEEN ADEWALE
SUBAIR NURUDEEN ADEWALE
Hello! I'm Subair Nurudeen Adewale, a cloud computing enthusiast and the founder of Nucloud Blog. I'm passionate about sharing knowledge and insights on cloud infrastructure, security, innovation, and the intersection of technology and design. As a cloud expert with a keen eye for user experience, I explore the latest trends and best practices in UI/UX, and how they can be applied to create intuitive, user-friendly, and seamless experiences for cloud-based applications and services. Follow Nucloud Blog for the latest updates and insights from the world of cloud computing and UI/UX design.