How to Set Up SFTP in FileZilla
SFTP (SSH File Transfer Protocol) is the most secure way to transfer files between your computer and a remote server. Unlike regular FTP, SFTP encrypts both commands and data, protecting your credentials and files from interception. This guide shows you how to configure SFTP connections in FileZilla using both password and SSH key authentication.
What You Need
- FileZilla Client installed on your computer
- Server hostname or IP address
- SSH username (often "root" or your hosting account name)
- Password or SSH private key
- Port number (default SFTP port is 22)
Method 1: SFTP with Password Authentication
This is the simplest method and works with most hosting providers:
- Open FileZilla and go to File → Site Manager (Ctrl+S)
- Click New Site and give it a descriptive name
- Set Protocol to "SFTP - SSH File Transfer Protocol"
- Enter your Host (e.g. example.com or 192.168.1.100)
- Set Port to 22 (or your custom SSH port)
- Set Logon Type to "Normal"
- Enter your Username and Password
- Click Connect
The first time you connect, FileZilla will show a warning about the server's host key. Verify the key fingerprint with your hosting provider and click OK to trust it.
Method 2: SFTP with SSH Key Authentication
SSH key authentication is more secure than passwords and is required by many servers. Here is how to set it up:
Step 1: Generate an SSH Key Pair
If you do not have an SSH key yet, generate one using PuTTYgen (Windows) or ssh-keygen (macOS/Linux):
- Windows: Download PuTTYgen, click Generate, save the private key as a .ppk file
- macOS/Linux: Run
ssh-keygen -t ed25519in the terminal
Step 2: Add Your Public Key to the Server
Copy the public key to your server's ~/.ssh/authorized_keys file. Most hosting providers have a section in cPanel or their control panel to add SSH keys.
Step 3: Configure FileZilla
- Open File → Site Manager
- Create a new site with Protocol set to SFTP
- Set Logon Type to "Key file"
- Enter your Username
- Click Browse next to Key file and select your private key (.ppk for PuTTY format, or .pem for OpenSSH format)
- Click Connect
FileZilla can convert OpenSSH keys to its own format automatically — just select the .pem file and FileZilla will offer to convert it.
Troubleshooting SFTP Connections
- "Connection refused" — SSH may not be enabled on the server, or the port may be different from 22
- "Authentication failed" — check your username, password or key file. Ensure the public key is in authorized_keys
- "Host key unknown" — this is normal on first connection. Verify the fingerprint and accept
- Timeout errors — your firewall may be blocking port 22. Check with your hosting provider
Need more help? Check the FileZilla FAQ or visit the community forums.