Complete Windows FTP Setup Guide | IIS, FileZilla & CMD ...
Setting Up FTP on Windows
A comprehensive guide to configuring File Transfer Protocol servers using Nginx/Apache context, FileZilla Server, IIS, and Command Prompt automation.
1 FTP with Nginx & Apache
FTP servers are typically used to transfer files to and from your web server. While Nginx and Apache are primarily HTTP servers (serving web pages), they can work alongside an FTP server to manage the underlying files.
Concept & Setup
- Install FTP Server: Follow instructions later in this guide to install IIS or FileZilla.
- Configure Access: Create FTP users with access to the directory where your website files are stored (e.g., the root folder).
- Permissions: Set permissions carefully to allow read/write access for the FTP user.
Example: Nginx Configuration
Configure Nginx to serve static files from the FTP directory:
server {
listen 80;
server_name yourdomain.com;
location / {
root /path/to/ftp/directory;
autoindex on;
}
}
Example: Apache Configuration
Configure Apache to serve files from the FTP directory:
<VirtualHost *:80>
ServerName yourdomain.com
DocumentRoot "/path/to/ftp/directory"
<Directory "/path/to/ftp/directory">
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
</VirtualHost>
Note: FTP is mainly for file transfer, while Nginx/Apache serve HTTP requests. Ensure firewall rules allow both FTP (Port 21) and HTTP (Port 80) traffic.
2 Windows + FileZilla Server
Follow these steps to install and configure FileZilla Server on Windows:
-
Download FileZilla Server:
Visit filezilla-project.org and download the latest version for Windows. -
Install:
Run the installer. Choose to start the server as a service (recommended). Set the admin interface port (default 14147). -
Launch:
Open the FileZilla Server Interface and connect to localhost. -
Configure Settings:
Go to Edit > Settings. Set an admin password. Under Passive mode settings, specify a custom port range (e.g., 50000-51000) for better firewall compatibility. -
Create Users:
Go to Edit > Users. Click "Add", set a username/password, and assign a Shared Folder (Home Directory) with Read/Write permissions. -
Configure Firewall:
You must allow the traffic through Windows Firewall. Use the commands below:CMD (Admin)netsh advfirewall firewall add rule name="FTP" dir=in action=allow protocol=TCP localport=21 netsh advfirewall firewall add rule name="PassiveFTP" dir=in action=allow protocol=TCP localport=50000-51000 -
Connect:
Use FileZilla Client, enter IP, username, password, and Port 21 to connect.
3 Install FTP (IIS) Service
Internet Information Services (IIS) is the native Windows web and FTP server.
Installation Steps
- Step 1: Open Server Manager > Manage > Add Roles and Features.
- Step 2: In Server Roles, check Web Server (IIS).
- Step 3: In Role Services, find "FTP Server" and check FTP Service and FTP Extensibility.
- Step 4: Install and wait for completion.
- Step 5: Open IIS Manager, right-click "Sites" > Add FTP Site. Set path, IP, SSL (No SSL for testing), and Auth (Basic).
Firewall Configuration for IIS
Run these commands to open standard FTP ports and the passive range (e.g., 1024-1048 for IIS defaults):
netsh advfirewall firewall add rule name="FTP" dir=in action=allow protocol=TCP localport=21
netsh advfirewall firewall add rule name="FTP Passive" dir=in action=allow protocol=TCP localport=1024-1048
4 Command Prompt Setup
AutomationYou can manage files on an FTP server directly using the Windows Command Prompt, without needing third-party clients like FileZilla Client.
1. Connect to FTP Server
Open CMD (Windows + R, type cmd). Use the ftp command followed by the IP address.
ftp 192.168.1.100
2. Authenticaton & Commands
Enter your username and password when prompted. Once connected, you can use these commands:
- ls / dir : List files.
- cd [folder] : Change directory.
- get [file] : Download file.
- put [file] : Upload file.
- bye : Disconnect.
Example Session
C:\> ftp 192.168.1.100
Connected to 192.168.1.100.
User (192.168.1.100): username
Password:
ftp> ls
ftp> get example.txt
ftp> put upload.txt
ftp> bye
Passive Mode
If you experience connection hang-ups (often due to firewalls), try enabling passive mode immediately after login:
quote PASV
Firewall Warning
Warning: Your firewall may block FTP connections or transfers. To ensure smooth operations:
- Allow FTP: Open TCP ports 21 and 20.
- Passive Mode: Open the necessary passive port range (e.g., 50000-51000 for FileZilla, 1024-1048 for IIS).
- Security: Standard FTP sends passwords in clear text. Consider using FTPS or SFTP for secure environments.