WHAT'S NEW
Web Hosting & Server Basics · GuideGuides › Web Hosting & Server Basics

Uploading Files with SFTP

Connect to your server securely with a free SFTP app, upload and download files, and avoid the mistakes that break sites.

📶 Beginner⏱ 8 min🗓 Updated November 17, 2026❤ 0
sftp.txt
// SFTP connection
host:      yourdomain.com
port:      22
protocol:  SFTP (secure)
user:      your-username
folder:    public_html/
// Before you start

🧰 What you need first

  • Your hosting account
  • SFTP or SSH login details from your host

🎯 What you'll learn

  • Choose SFTP over plain FTP
  • Connect with a free app
  • Upload, download and replace files safely

🛠 Tools needed

  • An SFTP app
  • Your hosting account
01 / Start here

SFTP vs FTP

FTP moves files between your computer and your server, but it sends your password and files unencrypted. SFTP does the same job over an encrypted connection.

SFTP

Secure File Transfer Protocol. It runs over SSH, usually on port 22.

Warning: Avoid plain FTP on public Wi-Fi. Anyone on the network could read your password.

02 / Step 1

Get an SFTP app

Several free, well-rated apps work well. In alphabetical order:

  • Cyberduck (Mac and Windows)
  • FileZilla (Mac, Windows, Linux)
  • WinSCP (Windows)

mC0de isn't paid by any of them. Download from the official website only.

03 / Step 2

Find your login details

  1. In cPanel, look for SSH Access or FTP Accounts.
  2. Note the host (often your domain or server name), port, username and password.
  3. Some hosts require SSH to be turned on first, or use an SSH key instead of a password.
04 / Step 3

Connect

  1. Open your app and create a new connection or site.
  2. Choose SFTP as the protocol.
  3. Enter the host, port 22, username and password.
  4. Connect. Your computer shows on one side, your server on the other.

Note: The first time, the app asks you to trust the server's key. That's normal. Accept it.

05 / Step 4

Move files safely

  • Your main site lives in public_html. Extra domains usually have their own folders.
  • Drag files from your computer to the server to upload them, or the other way to download.
  • Before replacing a file, download the old one so you can put it back.

Permissions

files:    644   (owner can edit, everyone can read)
folders:  755   (owner can edit, everyone can open)
never:    777   (anyone can change it)
06 / Help

Common problems

Connection refused or timed out

Why: Wrong port or protocol, or SSH isn't turned on.
Fix: Check you chose SFTP on port 22 (some hosts use another port). Turn on SSH access in cPanel, or ask support.

My changes don't show up

Why: You uploaded to the wrong folder, or a cache is showing the old version.
Fix: Check you're inside public_html, then clear your site's cache and your browser cache.

Permission denied

Why: The file belongs to another user, or its permissions are too strict.
Fix: Use the File Manager or ask your host to fix the owner.

// Recap

Key takeaways

Use SFTP (port 22), not plain FTP (port 21)
Your website files live in public_html for your main domain
Download a copy before you replace or delete anything
Files are usually 644, folders 755
// What's next

Keep going

Enjoyed this guide?

Support free learning at mC0de.

PIX0
</> {} JS 01
0101 </> CSS JS HTML PIX0 const {} 1010 async mC0de function return 0101 <div> 1010 PIX0 CSS JS HTML const {} 0101 mC0de
PIX0 // WORLD OF CODE
PIX0 IS PREPARING SOMETHING AWESOME FOR YOU 0%