Transferring Files to Your Server
Two common protocols for moving files to and from your server: SCP and SFTP.
SCP (Secure Copy Protocol)
SCP transfers files over SSH directly from the command line.
Upload a file to the server:
scp /local/path/file.zip root@YOUR_SERVER_IP:/remote/path/
Download a file from the server:
scp root@YOUR_SERVER_IP:/remote/path/file.zip /local/path/
Upload an entire directory (recursive):
scp -r /local/folder/ root@YOUR_SERVER_IP:/remote/path/
Using a non-default SSH port:
scp -P 2222 file.zip root@YOUR_SERVER_IP:/remote/path/
SFTP (SSH File Transfer Protocol)
SFTP is an interactive file transfer session over SSH.
sftp root@YOUR_SERVER_IP
sftp> put file.zip # Upload
sftp> get remotefile.zip # Download
sftp> ls # List remote files
sftp> lcd /local/dir # Change local directory
sftp> exit
GUI Option: FileZilla
- Download and install FileZilla
- Open File → Site Manager → New Site
- Protocol: SFTP
- Host: your server IP, Port: 22
- Logon Type: Normal, Username:
root, Password: your password - Click Connect
GUI Option: WinSCP (Windows)
Download WinSCP, create a new session with SFTP protocol, enter your server IP and credentials, and connect. WinSCP provides a dual-pane interface (local left, remote right) for drag-and-drop transfers.