Alle Beiträge

files

How to Upload Files to a VPS: scp, sftp, and rsync

A plain-English guide to choosing scp, sftp, or rsync when moving files from your computer to your server.

  • files
  • ssh
  • deployment
Files transfer from a local computer to a VPS using scp, sftp, and rsync.

You just need to get files from your laptop onto your server, and suddenly you are choosing between three tools that all seem to do the same thing.

Short version: to upload files to your server, use scp for quick one-off copies, sftp when you want an interactive file-browser style session, and rsync when you are syncing folders or repeating uploads. All three usually connect over SSH, short for Secure Shell, which is the encrypted login path to your server. The best choice depends on whether you are moving one file, browsing around, or keeping two folders in step.

Which file transfer method should you use?

Think of your server like a locked storage room. SSH is the key to the door. scp, sftp, and rsync are different ways of carrying boxes through that door.

ToolBest forPlain-English pictureMain caution
scpOne file or a small folderHanding over a sealed packageEasy to copy to the wrong path
sftpLooking around and moving files manuallyA simple remote file cabinetSlower for repeated large uploads
rsyncRepeated uploads and foldersA moving truck that only reloads changed boxesOptions matter, especially trailing slashes

If you are uploading a single image, archive, or config file, scp is usually enough. If you are not sure where something belongs and want to inspect folders as you go, sftp feels safer. If you are deploying the same project again and again, rsync is usually the cleanest fit because it avoids re-uploading files that have not changed.

How do scp, sftp, and rsync work?

scp means secure copy. It copies from one place to another over SSH. A typical shape is local file first, then your server login and remote path: scp ./site.zip user@server:/var/www/example/. It is direct and fast to understand: take this thing here, put it there.

sftp means SSH File Transfer Protocol. Instead of one copy action, you open a small session where you can move around with commands like ls, cd, put, and get. It is like standing in front of the server cupboard and choosing which shelf to use.

rsync is a sync tool. It compares what you have locally with what exists on the server, then sends only the differences. That is why people use it for project folders, media folders, and repeat deployments. One small warning: with rsync, a trailing slash can change the meaning. Syncing app/ means the contents of the folder; syncing app can mean the folder itself.

For a small web app, file transfer is only one part of the larger deployment picture. If you are still piecing that together, see our guide on how to deploy a small web app without DevOps.

What goes wrong when uploads fail?

Most upload problems are not mysterious. They usually come from identity, location, or permissions.

If you see Permission denied (publickey), the server did not accept your SSH key. That means you are not getting through the locked door. You may be using the wrong user, the wrong key, or a server that was not prepared for that key.

If you see Permission denied after connecting, you got through the door but tried to put the box on a shelf you are not allowed to touch. This often happens when uploading into system folders or website folders owned by another user.

If you see No such file or directory, the path is wrong. The folder may not exist, or you may be starting from a different place than you think. Remote paths are exact. /var/www/app and /var/www/apps are different shelves.

If you see Connection refused, your computer reached the server, but the SSH service did not answer on that port. That can mean SSH is down, listening somewhere else, or blocked by firewall rules. If the site itself breaks after a successful upload, logs are the next place to look; this guide to reading server logs when something breaks explains where to start.

Disk space is another quiet failure mode. Uploads can stop halfway or leave incomplete files when the server is full. For anything important, treat uploads and backups as a pair: move files in, but also know how you would recover them. Our backup guide covers the restore side: back up your server and actually restore it.

FAQ

**Is scp secure?** Yes. scp normally runs over SSH, so the connection is encrypted. The bigger risk is usually copying the right file to the wrong folder.

**Is sftp the same as FTP?** No. sftp uses SSH. Traditional FTP is older and often unsafe unless wrapped in extra protection.

**Why use rsync instead of uploading everything again?** Because rsync can send only changed files. That saves time and reduces the chance of interrupting a large upload.

Can I upload a whole website this way? Yes, but be careful with paths, permissions, and old files. A website folder can become messy if every upload leaves unused files behind.

The shortcut

Server Manager helps by giving each project a clear place to live, instead of making you remember remote paths from a note you wrote months ago. That lowers the chance of uploading into the wrong folder, mixing two projects together, or breaking one site while trying to update another.

It also keeps the setup readable over time. When you come back later, you can still tell what belongs where, which domain points to which project, and what needs attention. The real benefit is not avoiding every file transfer tool; it is avoiding the hidden mess around them.

That matters most when the earlier failure modes show up: wrong permissions, forgotten folders, stale files, and half-remembered deployments. You spend less time guessing what the server used to mean.

What does a clean upload process give you?

A clean upload process means you know three things before you move files: which tool fits the job, where the files should land, and what could break if the upload is wrong.

Use scp for simple copies, sftp when you want to browse, and rsync when you repeat the same upload. Once those choices feel clear, getting files onto your server becomes a normal maintenance task instead of a small emergency.