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.
SFTPFTPSPlain FTP
EncryptedYesYesNo
Port22 (your SSH port)2121
LoginSSH user, password or keyFTP accountFTP account
Firewall friendlyYes, one portNeeds extra portsNeeds extra ports
Use it?Yes, when you have itYes, on shared hostingNo

Do You Have SFTP?

SFTP needs SSH access, so it depends on your plan.

PlanSFTPWhat to use
Shared and WordPress hostingNoFTPS or File Manager
VPSYesSFTP with your server login
AMD EPYC VPS (Business Cloud)YesSFTP with your server login
Sites in the Enhance panelYesSFTP over SSH with the website’s user, or an FTP account
Dedicated serversYesSFTP 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.

SettingWhat to enterWhere to find it
HostYour server’s IP address, or a domain that points to itClient area, your service’s page
Port22, unless you changed your SSH portYour own notes, or ask support
Usernameroot, a user you created, or the website’s SSH user on EnhanceClient area, or the website’s Developer tools in Enhance
Password or keyThe password for that user, or your SSH private keyClient 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.

SetupWebsite folder
Enhancepublic_html in the folder you land in
cPanel account on a VPS/home/username/public_html
Your own Nginx or Apache on Ubuntu or DebianUsually /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.

  1. On your computer, put your files in one folder, for example my-site, with index.html inside it.
  2. Connect to your server.
  3. On the right (the server side), open your website folder, such as public_html.
  4. On the left, open your my-site folder.
  5. Select everything inside my-site and drag it to the right.
  6. Visit your domain in a browser. You should see your page.

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.

  1. On your computer, make a folder called something like backup-2026-11-13. Using the date helps you find it later.
  2. Connect, and open your website folder on the right.
  3. Open your backup folder on the left.
  4. 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.

  1. Connect and open public_html/wp-content/plugins.
  2. Find the folder of the plugin that caused it. Right-click it and choose Rename.
  3. Add -off to the name, for example contact-form-7-off.
  4. Reload your site. WordPress can’t find the plugin any more, so it switches it off.
  5. 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.

  1. Download the file to your computer.
  2. Make a copy of it, called something like wp-config-original.php, and keep it aside.
  3. 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.
  4. Make your change and save.
  5. Upload it back to the same folder and confirm overwriting.
  6. 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.

  1. On your computer, zip your site folder into site.zip.
  2. Upload site.zip to your website folder.
  3. 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.

CommandWhat it does
pwd / lpwdShow where you are on the server / your computer
ls / llsList files on the server / your computer
cd folder / lcd folderMove into a folder on the server / your computer
put file.zipUpload a file
put -r my-folderUpload a whole folder
get file.zipDownload a file
get -r my-folderDownload a whole folder
mkdir nameMake a folder on the server
rename old newRename a file or folder on the server
rm fileDelete a file on the server (there’s no undo)
chmod 644 fileChange a file’s permissions
exitDisconnect

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 755 and files 644. Most clients let you right-click and choose File permissions (FileZilla) or Properties (WinSCP).
  • wp-config.php can be stricter, 640 or 600.
  • Owner: on your own Nginx or Apache server, files uploaded as root belong 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 seeWhat it usually meansWhat to try
Connection timed outThe port is blocked or wrongCheck the port number. Make sure your firewall allows it (Managing Ports)
Connection refusedNothing is listening on that portSSH may be stopped or on another port. Try ssh first, see SSH Connection Issues
Authentication failed or Permission deniedWrong username, password or keyCheck for typos and extra spaces. Reset the password if needed
It connects, then drops at onceUsually a shell setting for that userTry the same login with ssh. On cPanel, check shell access in WHM
Host key warning on a server you knowThe server was reinstalled, or something is wrongIf you reinstalled it, remove the old key with ssh-keygen -R your-server-ip. If not, contact us before you connect
Permission denied when uploadingYou can’t write to that folderYou may be outside your website folder, or the files belong to another user. See permissions above
Upload works but the site doesn’t changeWrong folder, or a cacheCheck you’re in the website folder. Clear your browser cache and any site cache
You chose SFTP on shared hosting and it failsShared plans have no SFTPUse FTP with explicit TLS, port 21
FTP on Enhance logs in, but the file list never loadsThe firewall blocks FTP’s data portsAllow ports 30000 to 31000 in your server firewall, or switch to SFTP, which needs only port 22

Next Steps

Last updated 13 Nov 2026, 00:00 +0200. history

Was this page helpful?