VMware ESXi and vSphere Cluster Management

Use SFTP to Transfer Files to and from a Raspberry Pi

Learn how to securely connect FileZilla to a Raspberry Pi with SFTP, then upload, download, browse, edit, and manage files safely.

SFTP lets you securely transfer and manage files on a Raspberry Pi from another computer. This guide explains how to connect with FileZilla, browse local and remote folders, upload and download files, edit project files, and troubleshoot common connection problems.

What SFTP is

SFTP means Secure File Transfer Protocol. It provides file transfers and remote file management over a network, including browsing folders, creating directories, renaming files, and deleting files when your account has permission.

Unlike traditional FTP, which can send credentials and file contents without encryption, SFTP encrypts the session. Usernames, passwords, file contents, and other session traffic are protected while traveling between your computer and the Raspberry Pi.

How SFTP relates to SSH

SSH, or Secure Shell, is an encrypted remote-access service. SFTP operates through the SSH service rather than through a separate unencrypted FTP connection. On a Raspberry Pi, the SSH service accepts the connection and provides the secure transport used by SFTP.

The SSH service must be enabled, running, and reachable on the Raspberry Pi before FileZilla can connect. SFTP commonly uses port 22, the conventional TCP port for SSH.

Client and server roles

  • The Raspberry Pi is the SFTP server when its SSH service is running and accepting connections.
  • Your desktop or laptop runs the SFTP client. FileZilla is a graphical SFTP client.
  • The client connects to the server, authenticates your account, and presents tools for managing remote files.

Prerequisites

Before connecting, make sure the following conditions are met:

  • The Raspberry Pi is powered on and connected to the same local network as your computer. Remote access from another network requires intentional network configuration and stronger security controls.
  • SSH is enabled on the Raspberry Pi.
  • You know the Raspberry Pi's IP address or a hostname that resolves correctly on your network.
  • You know the username and password configured for the Raspberry Pi. Do not assume that every installation uses the same default account.
  • FileZilla or another SFTP-capable client is installed on the computer from which you will transfer files.

Enable and verify SSH

On Raspberry Pi OS, you can use the configuration tool to enable SSH:

sudo raspi-config

Use the interface to enable SSH, then exit and apply any requested restart. To check whether the service is active, run:

sudo systemctl status ssh

If SSH is installed but inactive, you can start it and configure it to start automatically:

sudo systemctl enable --now ssh

Service names can vary on some Linux systems. Use the service state displayed by the command to confirm that SSH is running.

Find the Raspberry Pi address

Run this command on the Raspberry Pi:

hostname -I

If several addresses appear, choose the address belonging to the network shared with your computer. A hostname is a human-readable device name that may work instead of an IP address when local name resolution is configured. If the hostname cannot be resolved, use the current IP address.

Install and open FileZilla

Obtain FileZilla from its official distribution source and install it on the computer that contains the files you want to transfer. Open FileZilla on that computer. Its interface normally displays the local computer's files and the remote Raspberry Pi's files side by side.

Connect with FileZilla Quickconnect

Use the Quickconnect fields near the top of FileZilla. Enter the Raspberry Pi address, account credentials, and standard SSH port.

SettingValue or examplePurpose
HostRaspberry Pi IP address or reachable hostnameIdentifies the device to contact
ProtocolSFTP - SSH File Transfer ProtocolChooses encrypted SFTP rather than ordinary FTP
UsernameYour configured Raspberry Pi accountIdentifies the Linux user
PasswordYour configured account passwordAuthenticates the account, unless a key is used
Port22Uses the standard SSH/SFTP port
  1. Choose SFTP if FileZilla provides an explicit protocol selection.
  2. Enter the Raspberry Pi IP address or hostname in the host field.
  3. Enter the username and password configured during Raspberry Pi OS setup.
  4. Enter 22 unless SSH has intentionally been configured to use another port.
  5. Start the connection and examine the connection log for a successful authentication message.

You can also configure a saved site in FileZilla's Site Manager. This is useful for repeated connections, but store saved credentials carefully.

Handle the first host key prompt

On the first connection, FileZilla may show the Raspberry Pi's SSH host key or fingerprint. This is a cryptographic identity for the server. When possible, verify the fingerprint through a trusted method before accepting it.

A warning on a first connection can be expected. If a previously known fingerprint changes unexpectedly, do not automatically accept the new key. The Raspberry Pi may have been reinstalled, its SSH keys may have changed, or the address may now identify a different device. Investigate the change first.

Understand the FileZilla interface

After authentication succeeds, FileZilla displays local and remote file panels. The initial remote location commonly corresponds to the connected user's home directory, the user's personal default directory on Linux.

FileZilla areaRepresentsTypical actions
Local siteThe filesystem on your computerBrowse to files to upload and choose download destinations
Remote siteThe filesystem on the connected Raspberry PiBrowse, upload, download, rename, create folders, and manage permitted files
Transfer queuePending, successful, and failed transfersMonitor progress and retry or inspect failed transfers

The connection log records protocol events and errors. Status indicators and the transfer queue help you determine whether a transfer is still running, completed, or failed.

Upload a project file to the Raspberry Pi

  1. Connect to the Raspberry Pi with its address, account credentials, SFTP protocol, and port 22.
  2. Use the local pane to locate the project file on your computer.
  3. Use the remote pane to open a suitable destination folder in the Raspberry Pi user's home directory, such as a project directory.
  4. Drag the file from the local pane to the remote pane, or use FileZilla's upload action.
  5. Wait until the transfer queue reports success.
  6. Refresh or browse the destination and confirm that the file appears on the Raspberry Pi.

For example, transfer a source file into a project directory owned by your account rather than directly into a protected system directory.

Download a log or program output

  1. Browse the remote pane to the directory containing the log or program output.
  2. Choose a destination folder in the local pane.
  3. Select the remote file and download it, or drag it to the local pane.
  4. Wait for the queue to report success.
  5. Open the downloaded copy on your computer to inspect it.

Browse and manage remote files

You can open folders in either panel and use the available context-menu actions to manage files. Where Linux permissions allow, you can:

  • Create directories for projects, data, or backups.
  • Rename files and directories.
  • Delete files and directories.
  • Move files between directories.
  • Upload local files and download remote files.

Check the selected path before destructive actions. Deleting or overwriting the wrong file can break a project or the operating system.

Edit a project text file

Use a non-system project file as your first remote-editing example. You can download the file, open it in a trusted local editor, make and save the change, and upload the updated file to the intended remote directory. Some FileZilla configurations can invoke a local editor for remote files; verify that the saved version is uploaded before closing the session.

System configuration files may be owned by another account and may require elevated permissions. Change them only when you understand the effect, and prefer an administrative workflow that preserves ownership and permissions.

Permissions and safe file handling

Linux file permissions control which users can read, write, or access files and directories. The connected account can access only locations permitted by its ownership and permissions. A successful SFTP login does not grant unrestricted access to the whole Raspberry Pi.

  • Keep personal project files in your user's home directory unless administrative access is explicitly needed.
  • Avoid deleting or overwriting operating-system files.
  • Do not use the root account for ordinary file transfers. Use a normal account and elevate privileges only for deliberate system administration.
  • Avoid broad permission changes just to make a transfer work. Correct the destination, ownership, or access method instead.

Security and account guidance

  • Use a unique, strong password for the Raspberry Pi account.
  • Use the credentials created during Raspberry Pi OS setup; do not assume a universal username or password.
  • Keep SSH restricted to trusted networks whenever possible.
  • If SSH must be reachable from outside the local network, configure stronger access controls, firewall rules, and authentication rather than exposing an unprotected service.
  • Consider SSH key authentication. A private key remains on your computer while the corresponding public key is installed for the Raspberry Pi account, reducing reliance on password login when configured correctly.

Optional command-line SFTP

FileZilla is convenient for graphical file management, but many systems also provide a command-line SFTP client:

sftp username@raspberry-pi-address

This uses port 22 by default. To specify a port explicitly, use:

sftp -P 22 username@raspberry-pi-address

Replace the username and address with your configured values. Replace 22 only when SSH is configured to listen on a different port.

Common SFTP problems and fixes

SymptomLikely causeRecommended check or fix
Connection refusedSSH is disabled or stopped; the address or port is wrong; a firewall blocks accessVerify the address, enable and start SSH, use port 22 unless changed, and check firewall or network rules
Authentication failedIncorrect credentials, a missing or locked account, or key-only authenticationUse the setup credentials, check keyboard layout and password entry, and match FileZilla's authentication method to the SSH configuration
TimeoutThe devices cannot reach each other, the IP address changed, or wireless connectivity is unstableConfirm both devices are on the intended network, run hostname -I again, and try a functioning hostname or current IP address
Permission deniedThe account does not own the destination or the location is protectedUse a directory owned by the account, review permissions, and use administrative tools deliberately for system-level changes
Host key warningFirst connection, reinstallation, changed SSH keys, or a different device at the addressVerify the fingerprint before accepting it; investigate unexpected changes before removing an old saved key

Transferred file does not work

If a transferred file is present but does not run or behave as expected, verify the destination directory and file contents. The file may lack required Linux executable permissions, use incompatible line endings, or depend on application settings that differ between systems. Validate the file with the relevant Raspberry Pi application or terminal tools.

End the SFTP session safely

  1. Wait for the transfer queue to show that all required uploads and downloads have completed.
  2. Verify important transferred files on the destination system by checking their names, locations, and contents.
  3. Close the connection through FileZilla rather than abruptly terminating an active transfer.
  4. Close FileZilla when finished, especially on a shared computer.

Quick reference

For a normal local-network connection, enable SSH on the Raspberry Pi, find its address with hostname -I, open FileZilla, select SFTP, enter the address, configured username, password, and port 22, then verify the host key when possible. Use the remote user's home directory for ordinary project files, monitor the transfer queue, and disconnect only after verifying the transfer.