Servers & VPS

How to Upload Your Website to a VPS Server via FTP or SFTP

Learn how to transfer your website files to a VPS using FTP or SFTP with FileZilla, securely and without data loss.

Detailed image of illuminated server racks showcasing modern technology infrastructure.

To upload your website to a VPS, use SFTP (not plain FTP): connect with your SSH credentials, navigate to your server's web directory, and transfer your files with FileZilla or any compatible client. It's more secure, requires no extra software on the server, and works from day one.

FTP vs SFTP: Which Should You Use on a VPS?

Traditional FTP transmits credentials and files in plain text — anyone on the same network can intercept them. SFTP (SSH File Transfer Protocol) encrypts all communication over the same connection you use for SSH.

Feature FTP SFTP
Encryption No Yes (SSH)
Default port 21 22
Extra server software vsftpd / ProFTPD None (uses OpenSSH)
Recommended for production No Yes
FileZilla compatible Yes Yes

Bottom line: use SFTP whenever possible. If a legacy client or tool requires plain FTP, configure FTPS (FTP over TLS) as a minimum.

What You Need Before You Start

  • A Linux VPS (Ubuntu/Debian/CentOS) with OpenSSH active (enabled by default).
  • An SSH user with write permissions on the web directory (e.g., /var/www/yoursite.com/html).
  • FileZilla Client installed on your computer (get it from the official site or your system's package manager).
  • Your VPS public IP, SSH username, and password (or private key).

Connecting via SFTP with FileZilla

Option A: Quick connection with a password

  1. Open FileZilla and go to File → Site Manager → New Site.
  2. Protocol: SFTP – SSH File Transfer Protocol.
  3. Host: your VPS public IP address.
  4. Port: 22 (or your custom SSH port if you changed it).
  5. Logon type: Normal. Enter your SSH username and password.
  6. Click Connect.

FileZilla will ask you to accept the server's host key fingerprint on the first connection. Verify it matches your VPS (run ssh-keygen -lf /etc/ssh/ssh_host_ecdsa_key.pub on the server) and accept.

Option B: Connection with an SSH key (more secure)

  1. In Site Manager, set Logon type: Key file.
  2. Select your .pem or .ppk file (FileZilla accepts both; convert with PuTTYgen if needed).
  3. Leave the password field blank (authentication is handled by the key).
  4. Connect.

Uploading Your Website Files

Once connected, FileZilla shows two panels: your computer on the left and the server on the right.

Navigate to the correct server directory

In the right panel, navigate to your site's web root. Common paths on a VPS are:

  • /var/www/yoursite.com/html/ — typical Nginx/Apache manual setup.
  • /home/yoursite/public_html/ — if you use cPanel or DirectAdmin.
  • /srv/www/yoursite/ — convention on some distributions.

Check your Nginx server block or Apache VirtualHost to confirm the exact root or DocumentRoot path.

Transfer the files

  1. In the left panel, navigate to your local project folder.
  2. Select all files (Ctrl+A) or only the ones you want to update.
  3. Drag them to the right panel or right-click → Upload.
  4. FileZilla shows the transfer queue at the bottom; wait for it to finish.

For large sites, enable Simultaneous transfers (Edit → Settings → Transfers → max 5) to speed up the upload.

Verify the upload

Open your domain in a browser. If your site appears, everything worked. If you see a 403 or 404 error, check:

  • That the files are in the correct root defined in Nginx/Apache.
  • That your entry file is named index.html, index.php, or whatever the server expects.
  • File permissions: files should be readable by the web server process (chmod 644 for files, 755 for directories).

Setting Up Traditional FTP (vsftpd) When Needed

Some legacy environments or clients with older tools require plain FTP. If that's your situation, install vsftpd and enforce at least FTPS:

sudo apt install vsftpd -y

Edit /etc/vsftpd.conf with these minimum security settings:

anonymous_enable=NO
local_enable=YES
write_enable=YES
chroot_local_user=YES
ssl_enable=YES
rsa_cert_file=/etc/ssl/certs/ssl-cert-snakeoil.pem
rsa_private_key_file=/etc/ssl/private/ssl-cert-snakeoil.key
force_local_data_ssl=YES
force_local_logins_ssl=YES

Restart vsftpd and open port 21 in UFW. In production, replace the self-signed certificate with a valid Let's Encrypt certificate.

For more guides on managing your VPS securely, browse the VPS servers section of our blog.

Key Takeaways

  • SFTP is the recommended way to upload files to a VPS: it uses SSH port 22 and encrypts everything with no extra installation needed.
  • FileZilla connects via SFTP with a username/password or an SSH private key.
  • Always navigate to the exact root path defined in your Nginx or Apache config before transferring files.
  • Correct permissions are 644 for files and 755 for directories; 403 errors almost always point to wrong permissions.
  • Plain FTP should never be used in production; if you need it, configure vsftpd with FTPS and a valid certificate.

Want an expert to handle your VPS setup from start to finish? The team at elenlace.com will configure your server, upload your site, and have it live and ready for visitors on day one.

FAQ

Do I need to install anything on the VPS to use SFTP?

No. SFTP is part of the openssh-server package, which is installed and running by default on most Linux distributions. If your VPS accepts SSH connections, it already supports SFTP with no additional configuration.

What do I do if FileZilla gives a "Connection refused" error on port 22?

Check that the SSH service is running on the server (sudo systemctl status ssh) and that port 22 isn't blocked in your VPS provider's firewall. If you changed the default SSH port, use that number in FileZilla instead of 22.

How do I upload files to a VPS without a password (using an SSH key)?

Generate a key pair with ssh-keygen, copy the public key to the server with ssh-copy-id user@IP, and in FileZilla select "Key file" in Site Manager pointing to your private key. This is more secure than a password and doesn't require typing it each time.

Can I use SFTP to update only a few files without re-uploading the whole site?

Yes. In FileZilla you can select individual files or specific folders and upload only those without touching the rest. For frequent deployments with version control, consider pairing SFTP with rsync or a CI/CD pipeline that only transfers changed files.

Further reading

Other providers and guides worth comparing:

← All