How to Use SFTP: Upload and Download Files Safely
A plain-English guide to SFTP. Connect with FileZilla, WinSCP, Cyberduck or the command line, then upload a site, download a backup and fix a broken plugin.
13 min read
SFTP lets you move files between your computer and your server. You drag a file from one side of the window to the other, and it’s on your server. The connection is encrypted, so nobody can read your password or your files on the way.
If you have never used it before, start at the top. If you just need a command, skip to the cheat sheet.
What SFTP Is, in One Minute
Three names get mixed up a lot, and only two of them are safe:
- SFTP stands for SSH File Transfer Protocol. It runs over SSH, the same secure connection you use to log in to a server, so it uses the same username, password or key, and the same port (usually 22).
- FTP is the older way to do the same job. Plain FTP sends your password as readable text, so avoid it.
- FTPS is FTP with encryption added. It’s safe, but it’s a different protocol from SFTP and uses different ports.
| SFTP | FTPS | Plain FTP | |
|---|---|---|---|
| Encrypted | Yes | Yes | No |
| Port | 22 (your SSH port) | 21 | 21 |
| Login | SSH user, password or key | FTP account | FTP account |
| Firewall friendly | Yes, one port | Needs extra ports | Needs extra ports |
| Use it? | Yes, when you have it | Yes, on shared hosting | No |
Do You Have SFTP?
SFTP needs SSH access, so it depends on your plan.
| Plan | SFTP | What to use |
|---|---|---|
| Shared and WordPress hosting | No | FTPS or File Manager |
| VPS | Yes | SFTP with your server login |
| AMD EPYC VPS (Business Cloud) | Yes | SFTP with your server login |
| Sites in the Enhance panel | Yes | SFTP over SSH with the website’s user, or an FTP account |
| Dedicated servers | Yes | SFTP with your server login |
On shared hosting, follow the same steps in your client but choose FTP with explicit TLS instead of SFTP, and use an account from cPanel > FTP Accounts. The rest of this guide still makes sense, only the connection settings differ.
The Four Things You Need
Every SFTP client asks for the same four details. Write them down before you start.
| Setting | What to enter | Where to find it |
|---|---|---|
| Host | Your server’s IP address, or a domain that points to it | Client area, your service’s page |
| Port | 22, unless you changed your SSH port | Your own notes, or ask support |
| Username | root, a user you created, or the website’s SSH user on Enhance | Client area, or the website’s Developer tools in Enhance |
| Password or key | The password for that user, or your SSH private key | Client area, or your own computer |
Where these come from:
- VPS, Business Cloud and dedicated servers: the IP and the root password are in the client area under your service. If you followed the SSH guide and turned off root login, use the user you created there instead.
- Enhance: you get two ways in. For SFTP, open the website in Enhance and go to Developer tools. Add your SSH key there, then connect on port 22 with the username and server address Enhance shows you. The same login also opens the website’s own shell if you connect with
ssh. Enhance also runs a normal FTP server. You create FTP accounts for each website under its Advanced menu, and each one can be limited to a single folder with Directory access. FTP accounts log in with an email-style username such as[email protected]on port 21, and they’re handy for a developer or a tool that only speaks FTP. When you have the choice, use SFTP. To change a password, see Resetting Passwords. - cPanel on a VPS: a cPanel account can use SFTP only if shell access is turned on for it in WHM > Manage Shell Access. Use the cPanel username and password.
Pick a Client
You need an SFTP program, called a client, on your computer. All of these are free.
Where Your Website Files Live
Once you’re connected, you need the right folder. Upload to the wrong place and your site won’t change.
| Setup | Website folder |
|---|---|
| Enhance | public_html in the folder you land in |
| cPanel account on a VPS | /home/username/public_html |
| Your own Nginx or Apache on Ubuntu or Debian | Usually /var/www/html, or /var/www/your-domain if you set one up |
| aaPanel | /www/wwwroot/your-domain |
Not sure? Look for the folder that holds index.html, index.php or wp-config.php. That’s your website.
Examples for Beginners
These are the jobs people use SFTP for most. Each one uses FileZilla, but the steps are the same in any client.
Example 1: Put Your First Web Page Online
You’ve made a simple website on your computer, and you want it live.
- On your computer, put your files in one folder, for example
my-site, withindex.htmlinside it. - Connect to your server.
- On the right (the server side), open your website folder, such as
public_html. - On the left, open your
my-sitefolder. - Select everything inside
my-siteand drag it to the right. - Visit your domain in a browser. You should see your page.
yourdomain.com/my-site/ instead of yourdomain.com.Example 2: Download a Backup Copy Before You Change Anything
Before you update a theme, edit code or try a new plugin, keep a copy of what works.
- On your computer, make a folder called something like
backup-2026-11-13. Using the date helps you find it later. - Connect, and open your website folder on the right.
- Open your backup folder on the left.
- Drag the website files from right to left.
Now you can put any file back exactly as it was. For a database backup as well, see Backups and Restores.
Example 3: Fix a WordPress Site That a Plugin Broke
You installed or updated a plugin and now your site shows a white page or a critical error, and you can’t reach the dashboard. SFTP gets you back in.
- Connect and open
public_html/wp-content/plugins. - Find the folder of the plugin that caused it. Right-click it and choose Rename.
- Add
-offto the name, for examplecontact-form-7-off. - Reload your site. WordPress can’t find the plugin any more, so it switches it off.
- Log in to your dashboard and update or remove the plugin properly. Then rename the folder back, or delete it.
Not sure which plugin it was? Rename the whole plugins folder to plugins-off. If the site comes back, rename it back to plugins and turn plugins on one at a time from the dashboard. For more fixes, see Fix WordPress White Screen of Death.
Example 4: Edit a File Safely
You need to change one setting in wp-config.php or .htaccess.
- Download the file to your computer.
- Make a copy of it, called something like
wp-config-original.php, and keep it aside. - Open the file in a plain text editor. Use Notepad++ or VS Code on Windows, TextEdit in plain text mode on macOS, or any code editor. Don’t use Word.
- Make your change and save.
- Upload it back to the same folder and confirm overwriting.
- Check your site. If something broke, upload the original copy and you’re back where you started.
FileZilla can also do this for you: right-click a file on the server and choose View/Edit. When you save, it asks whether to upload the changed file.
Example 5: Upload a Big Site Quickly
Moving hundreds of files one at a time is slow. Sending one archive is much faster.
- On your computer, zip your site folder into
site.zip. - Upload
site.zipto your website folder. - Log in with SSH, go to that folder and unpack it:
cd /var/www/html
unzip site.zip
rm site.zip
If unzip isn’t installed, add it with sudo apt install unzip on Ubuntu or Debian, or sudo dnf install unzip on AlmaLinux or Rocky Linux.
Command Cheat Sheet
In the command-line sftp tool, plain commands act on the server. Put an l (for “local”) in front to act on your computer: ls lists the server, lls lists your computer.
| Command | What it does |
|---|---|
pwd / lpwd | Show where you are on the server / your computer |
ls / lls | List files on the server / your computer |
cd folder / lcd folder | Move into a folder on the server / your computer |
put file.zip | Upload a file |
put -r my-folder | Upload a whole folder |
get file.zip | Download a file |
get -r my-folder | Download a whole folder |
mkdir name | Make a folder on the server |
rename old new | Rename a file or folder on the server |
rm file | Delete a file on the server (there’s no undo) |
chmod 644 file | Change a file’s permissions |
exit | Disconnect |
A short session looks like this:
$ sftp root@your-server-ip
sftp> cd /var/www/html
sftp> lcd ~/Desktop/my-site
sftp> put -r .
sftp> ls
index.html style.css images
sftp> exit
One-Line Commands
Sometimes you just want to send one file without opening a session. scp does that. Like sftp, it uses a capital -P for the port.
# Upload one file
scp site.zip root@your-server-ip:/var/www/html/
# Download one file
scp root@your-server-ip:/var/www/html/wp-config.php .
# Upload a whole folder
scp -r my-site root@your-server-ip:/var/www/
To back up a big site, pack it on the server and download one archive:
ssh root@your-server-ip "tar -czf /root/site-backup.tar.gz -C /var/www html"
scp root@your-server-ip:/root/site-backup.tar.gz .
For keeping two folders in sync (only sending what changed), rsync is the better tool:
rsync -avz --progress my-site/ root@your-server-ip:/var/www/html/
The slash at the end of my-site/ matters: it sends the folder’s contents, the same as Example 1.
After You Upload: Permissions and Ownership
If your page shows 403 Forbidden or WordPress can’t save uploads, the files probably have the wrong permissions or owner.
- Folders should be
755and files644. Most clients let you right-click and choose File permissions (FileZilla) or Properties (WinSCP). wp-config.phpcan be stricter,640or600.- Owner: on your own Nginx or Apache server, files uploaded as
rootbelong to root, and the web server may not be able to write to them. Give them to the web server user over SSH:
# Ubuntu and Debian
sudo chown -R www-data:www-data /var/www/html
On AlmaLinux or Rocky Linux, the user is apache or nginx, depending on which one you installed.
You don’t need to change ownership on Enhance or cPanel. There, the website’s own user already owns its files. For more on this error, see Fix 403 Forbidden Error.
Keep It Secure
- Use SSH keys instead of passwords. The SSH guide shows how, and all the clients above can use them.
- Give each person their own login. On Enhance, create an FTP account for your developer, or add their SSH key, and remove it when the job is done. Never hand out your root password.
- Protect saved passwords. FileZilla can lock them behind a master password under Edit > Settings > Interface > Passwords.
- If you once installed an FTP server and no longer use it, remove it and close port 21. See the VPS Security Checklist.
Troubleshooting
| What you see | What it usually means | What to try |
|---|---|---|
Connection timed out | The port is blocked or wrong | Check the port number. Make sure your firewall allows it (Managing Ports) |
Connection refused | Nothing is listening on that port | SSH may be stopped or on another port. Try ssh first, see SSH Connection Issues |
Authentication failed or Permission denied | Wrong username, password or key | Check for typos and extra spaces. Reset the password if needed |
| It connects, then drops at once | Usually a shell setting for that user | Try the same login with ssh. On cPanel, check shell access in WHM |
| Host key warning on a server you know | The server was reinstalled, or something is wrong | If you reinstalled it, remove the old key with ssh-keygen -R your-server-ip. If not, contact us before you connect |
Permission denied when uploading | You can’t write to that folder | You may be outside your website folder, or the files belong to another user. See permissions above |
| Upload works but the site doesn’t change | Wrong folder, or a cache | Check you’re in the website folder. Clear your browser cache and any site cache |
| You chose SFTP on shared hosting and it fails | Shared plans have no SFTP | Use FTP with explicit TLS, port 21 |
| FTP on Enhance logs in, but the file list never loads | The firewall blocks FTP’s data ports | Allow ports 30000 to 31000 in your server firewall, or switch to SFTP, which needs only port 22 |
Next Steps
- Connecting to Your Server via SSH: set up the keys SFTP uses
- Managing Files with cPanel File Manager: the browser option on shared hosting
- Website Migration Checklist: moving a whole site to GoZen
Last updated 13 Nov 2026, 00:00 +0200.