DEV Community

Hedy
Hedy

Posted on

How to transfer files to Raspberry Pi from PC?

Here are the most common (and reliable) ways to transfer files from a PC to a Raspberry Pi. Pick the one that matches how your Pi is connected (network vs. not).

Method 1: SCP (simple, fast, over SSH)

  1. Make sure SSH is enabled on the Pi:

Raspberry Pi OS: sudo raspi-config → Interface Options → SSH → Enable

  1. Find the Pi’s IP: hostname -I (on the Pi) or check your router.

From macOS / Linux (Terminal):

scp /path/to/file.txt pi@<PI_IP>:/home/pi/
scp -r /path/to/folder/ pi@<PI_IP>:/home/pi/
Enter fullscreen mode Exit fullscreen mode

From Windows (PowerShell, Windows 10/11 usually has scp):

scp C:\path\file.txt pi@<PI_IP>:/home/pi/
scp -r C:\path\folder pi@<PI_IP>:/home/pi/
Enter fullscreen mode Exit fullscreen mode

Method 2: SFTP with a GUI (easiest drag-and-drop)

  • Windows: WinSCP
  • macOS: Cyberduck / FileZilla
  • Linux: FileZilla or your file manager supports “sftp://…”

Connection settings:

  • Protocol: SFTP
  • Host:
  • Username: pi (or your username)
  • Password: your Pi password
  • Port: 22

Then drag files into /home/pi/ (or wherever you want).

Method 3: Shared Folder (Samba/Windows share) for “network drive” style

Good if you want the Pi to appear like a shared computer on your LAN.

Install Samba on the Pi, set up a share, then map it from Windows/macOS.

(If you want, tell me your OS and I’ll give a ready-to-copy Samba config.)

Method 4: rsync (best for lots of files / repeat transfers)

Only copies changes (great for projects):

rsync -avh /local/folder/ pi@<PI_IP>:/home/pi/folder/
Enter fullscreen mode Exit fullscreen mode

Method 5: USB drive (no network needed)

  • Copy files to a USB stick on your PC
  • Plug into Pi
  • Raspberry Pi OS usually auto-mounts it under /media/pi//

Quick troubleshooting

  • “Connection refused” / timeout: SSH not enabled, wrong IP, or firewall/network issue.
  • “Permission denied”: wrong username/password, or SSH keys not set.
  • Can’t resolve hostname: use the IP address instead of raspberrypi.local.

Top comments (0)