Your server already supports secure file transfer: anything that can log in over SSH can also copy files with SCP or SFTP. There is no need to install or open an FTP server.
Command line: scp
scp is built into Windows 10/11 (PowerShell), macOS and Linux. Run it on your own computer.
Upload a file to the server:
scp ./site.zip alex@203.0.113.25:/home/alex/Download a file from the server:
scp alex@203.0.113.25:/var/backups/db/mariadb.sql.gz .Copy a whole folder with -r, and use a capital -P for a custom SSH port:
scp -r -P 2222 ./public alex@203.0.113.25:/home/alex/Command line: rsync (best for big or repeated copies)
rsync only sends what changed and can resume. It is on macOS and Linux; on Windows use it through WSL.
rsync -avz --progress ./public/ alex@203.0.113.25:/home/alex/public/Interactive sftp
sftp alex@203.0.113.25Inside, use ls, cd, put file to upload, get file to download and exit to leave.
WinSCP (Windows)
- Install WinSCP from winscp.net.
- In the login window choose File protocol: SFTP, enter the server IP as Host name, port
22(or yours), and your username. - To log in with a key, click Advanced → SSH → Authentication and select your private key. WinSCP offers to convert an OpenSSH key to its
.ppkformat. - Click Save, then Login. Drag files between the panels.
FileZilla (Windows, macOS, Linux)
- Open File → Site Manager → New site.
- Set Protocol to SFTP - SSH File Transfer Protocol, enter the host and port.
- Choose Logon Type: Normal with your password, or Key file and select your private key.
- Click Connect.
Warning: Choose SFTP, not FTP or FTPS. Plain FTP sends your password unencrypted, and your server does not need an FTP service at all.
Putting files where root owns the folder
Your user usually cannot write to folders such as /var/www directly. Upload to your home folder first, then move the files over SSH and set the owner your web server expects:
sudo mv ~/public/* /var/www/example.com/html/
sudo chown -R www-data:www-data /var/www/example.com/html # Ubuntu / Debian
sudo chown -R nginx:nginx /var/www/example.com/html # AlmaLinux / RockyTroubleshooting
- Permission denied when uploading: you are writing to a folder your user does not own. Upload to your home folder, then use
sudo mv. - Connection refused or timed out: the same causes as SSH. See Fix SSH connection errors.
- Transfers are slow: many small files are slow over any protocol. Pack them first with
tar -czf site.tar.gz public/, copy one file, then unpack.
