Transferring files securely between a local machine and a remote server is a common task for developers, system administrators, and anyone managing servers. One of the most secure and efficient ways to achieve this is by using SCP (Secure Copy Protocol). In this blog, I’ll walk you through the process of uploading and downloading files with SCP, using an example command for each case.
SCP is a command-line tool that allows you to transfer files between your local machine and a remote server over an encrypted SSH connection. This ensures your files remain secure during the transfer process. It’s simple, fast, and widely used in the tech world.

Let’s say you want to upload a file named backend.zip from your local machine to a remote server’s /home/ubuntu/ directory.
Here’s the command:
scp -i abc.pem backend.zip ubuntu@10.10.10.10:/home/ubuntu/
Explanation:
To download the backend.zip file from the remote server’s /home/ubuntu/ directory to your local machine’s ~/Downloads folder, use the following command:
scp -i abc.pem ubuntu@10.10.10.10:/home/ubuntu/backend.zip ~/Downloads/
Explanation:
Using SCP for secure file transfer is an essential skill for anyone working with remote servers. Whether you’re deploying a project or backing up important files, SCP provides a secure and straightforward way to move your data.
Thank you for being a part of the In Plain English community! Before you go:
<hr><p>Secure File Transfer: A Beginner’s Guide to Uploading and Downloading Files with SCP was originally published in JavaScript in Plain English on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>