Solving 'Failed to Retrieve Directory Listing' in FileZilla Server
Diagnose and fix 'Failed to retrieve directory listing' errors in FileZilla Server by configuring passive mode port ranges, NAT external IPs, and firewall rules.
29 May 2026, 21:31 UTC

The Symptom: Authentication Works, Data Fails
A common failure in FileZilla Server occurs when a client successfully logs in (the control channel is open), but the connection hangs or returns an error like Failed to retrieve directory listing or Could not connect to server during the first file list request. This indicates a failure in the Data Channel, typically caused by a mismatch between how the server reports its address and how the network routes traffic.
Diagnostic Matrix: Passive Mode Failures
FTP uses two channels: the Control Channel (Port 21) for commands and the Data Channel for actual file transfers and directory listings. In Passive Mode (PASV), the server tells the client which port to connect to for data. If this communication is blocked or incorrect, the listing fails.
| Observation | Likely Cause | Primary Diagnostic |
|---|---|---|
Login successful; hangs at MLSD or LIST |
Passive port range blocked by firewall | Telnet/NC to a port in the passive range |
| Client reports connection to an internal IP (e.g., 192.168.x.x) | External IP not configured in server settings | Inspect PASV response in client logs |
| Connection timeout only when using FTPS (TLS) | TLS session mismatch or firewall deep-packet inspection | Test with plain FTP (non-encrypted) |
Immediate Connection Refused on data port |
Server not listening on the expected interface | Check server binding settings |
Step-by-Step Resolution Path
1. Define and Open the Passive Port Range
By default, FileZilla Server may attempt to use a wide range of ports. For security and firewall management, you must restrict this to a specific range.
- Server Configuration: Navigate to
Settings > FTP Server > Passive mode settings. - Action: Set
Use custom port range(e.g.,50000 - 50100). - Firewall Rule: On the host machine (Windows Firewall or Linux iptables/ufw), create an Inbound Rule allowing TCP traffic on ports 50000 through 50100.
2. Configure the External IP Address
If the server is behind a NAT (Network Address Translation) router, it only knows its internal IP. It will tell the client to connect to that internal IP, which the client cannot reach over the internet.
- Verification: Run a lookup (e.g., via
curl ifconfig.me) from the server host to find the public IP. - Action: In
Passive mode settings, selectRetrieve external IP from:or manually enter the public IP address. - Risk: If your public IP is dynamic, use a DNS hostname if the server version supports it; otherwise, the connection will break when the IP changes.
3. Map Router Port Forwarding
The router must know where to send incoming traffic on the passive ports.
- Action: In your router's NAT/Port Forwarding section, create a rule:
External Port 50000-50100 → Internal IP [Server IP] Port 50000-50100. - Check: From an external machine, run the following command (replace placeholders):
Expected Result:# Using Netcat (nc) to check if the port is reachable nc -zv [Public-IP] 50000Connection to [Public-IP] 50000 port [tcp/*] succeeded!
Comparison: Active vs. Passive Mode
While you can force a client to use Active Mode, it is rarely recommended for modern environments.
| Feature | Active Mode (PORT) | Passive Mode (PASV) |
|---|---|---|
| Connection Initiation | Server connects to Client | Client connects to Server |
| Client Firewall | Must allow inbound connections | Only needs outbound access |
| Server Firewall | Only Port 21 needs to be open | Port 21 AND Passive Range must be open |
Verification and Limitations
To verify the fix, connect via a FileZilla Client and monitor the Message Log. Look for the Entering Passive Mode (xxx,yyy,zzz,aaa,bbb,ccc) line. The IP address inside the parentheses must be the public IP of the server, not a local 192.168.x.x or 10.x.x.x address.
Limitations: Some corporate firewalls use "FTP Inspection" or "Application Layer Gateways (ALG)" that intercept FTP traffic. If you are using Explicit FTP over TLS, these firewalls cannot read the encrypted control channel to see which passive port was negotiated, often resulting in a dropped connection. The only reliable fix in this scenario is to ensure the entire passive port range is explicitly whitelisted on the network firewall.
Rollback Procedure
If connectivity degrades or security audits flag the open ports:
- Remove the port forwarding rules from the router.
- Delete the inbound firewall rules for the passive port range.
- Revert the FileZilla Server passive mode settings to
Default.
0 replies
A thoughtful contribution can make all the difference. Be the first to share one.