How to Upload Files to a Website on a VPS via FTP (Port 21) – Simple & Effective
Managing a website on a VPS often involves uploading files, updating code, or transferring images. FTP (File Transfer Protocol) is one of the easiest and most efficient ways to do this, especially when working with large files or multiple uploads.
In this guide, I'll walk you through how to upload files to a website on a VPS via FTP (Port 21) using FileZilla, WinSCP, and Cyberduck, three of the most popular FTP clients for Windows and MacOS.
1. What is FTP, and When Should You Use It?
FTP (File Transfer Protocol) is a standard network protocol used to transfer files between a computer and a server. It operates on Port 21 and is commonly used for:
- Uploading website files, images, and scripts.
- Editing files directly on the server without SSH access.
- Backing up or downloading website data to a local machine.
⚠ Note: FTP does not encrypt data during transmission. If security is a concern, consider using SFTP (Secure FTP), which runs on Port 22 and encrypts all file transfers.
2. What You Need Before Connecting via FTP
Since your VPS already has an FTP account, you only need to gather the following login details.
2.1. Required FTP Credentials
Before connecting, make sure you have:
- Host (Server Address): The IP address or domain name of your VPS.
- Username: The FTP account username.
- Password: The FTP account password.
- Port: 21 (Default FTP port).
👉 Where to find your FTP login details?
- If you use cPanel or DirectAdmin, go to the FTP Accounts section to retrieve your credentials.
- If your hosting provider or server admin provided the FTP account, check your email or contact them.
3. Best FTP Clients for Windows & MacOS
To connect via FTP, you'll need an FTP client (a software that helps manage file transfers). Here are three great options:
👉 I recommend using FileZilla because it's free, reliable, and easy to use.
4. How to Upload Files to a VPS via FTP
4.1. Connecting to FTP Using FileZilla (Windows & MacOS)
- Open FileZilla
- Go to File → Site Manager
- Click New Site and name the connection
- Enter the following details:
- Host: Enter your VPS IP or domain
- Username: Your FTP account username
- Password: Your FTP account password
- Port: 21
- Protocol: Select FTP - File Transfer Protocol
- Click Connect to establish the connection.
👉 Once connected, FileZilla will display two panels:
- Left Panel: Your local files (computer).
- Right Panel: Server files (VPS).
Uploading files: Simply drag and drop files from the left panel (computer) to the right panel (server) to upload them.
4.2. Connecting to FTP Using WinSCP (Windows)
- Open WinSCP and click New Session
- Enter the following details:
- File protocol: Select FTP
- Encryption: Choose No encryption
- Host name: Enter your VPS IP or domain
- Username: Your FTP account username
- Password: Your FTP password
- Port number: 21
- Click Login to connect.
👉 WinSCP also displays two panels:
- Left Panel: Local files (computer).
- Right Panel: Remote server files.
Uploading files: Drag files from the left panel to the right panel to upload them.
4.3. Connecting to FTP Using Cyberduck (MacOS & Windows)
- Open Cyberduck and click Open Connection
- Select FTP (File Transfer Protocol)
- Enter the following details:
- Server: Your VPS IP or domain
- Username: Your FTP account username
- Password: Your FTP account password
- Port: 21
- Click Connect to establish the connection.
👉 Cyberduck has a simpler interface compared to FileZilla & WinSCP.
Uploading files:
- Click Upload, select files from your computer.
- Or drag and drop files directly into the Cyberduck window.
5. How to Verify Uploaded Files on Your Website
Once you've uploaded your files, it's essential to check if they appear correctly on your website.
🔹 For website source files:
🔹 For uploaded images:
🔹 If files don’t appear correctly:
- Check if the files are in the correct directory (/var/www/html or /public_html).
- Check file permissions (CHMOD) to ensure they are readable by the web server.
6. Essential FTP Tips & Best Practices
✔ Use FTPs (Secure FTP) when possible
Since FTP does not encrypt data, use FTPs (running on Port 21 with SSL encryption) if your server supports it.
✔ Keep your FTP credentials safe
Never share your FTP login details with anyone who doesn’t need access, as they can modify or delete your website files.
✔ Avoid file transfer interruptions
If you're uploading large files and the connection drops, go to FileZilla → Transfer settings and select Resume failed transfers instead of starting over.
✔ Delete unused FTP accounts
If you no longer need an FTP account, delete it to reduce security risks.
7. Conclusion
FTP is the easiest way to upload files to a website on a VPS, especially if you're not familiar with SSH or command-line tools. Using FileZilla, WinSCP, or Cyberduck, you can quickly manage your server files with a simple drag-and-drop interface.
I hope this guide helps you understand how to use FTP to manage files on your VPS. If you have any questions or run into issues connecting via FTP, feel free to ask in the comments!