ECONNREFUSED on port 21
Why FTP port 21 returns connection refused, and how to isolate service-down vs firewall vs wrong host/port.
ECONNREFUSED means the host responded and actively rejected the TCP connection.
This usually indicates the service isn’t listening on that port, or a device is rejecting connections.
Common causes
- FTP service is not running/listening on port 21
- Wrong host or wrong port (FTP may be on a non-standard port)
- Firewall/device sends RST (reject) instead of dropping traffic
Fix checklist
- Confirm FTP is enabled and listening on port 21 (server-side).
- Confirm the vendor/admin-provided port (FTP is not always 21).
- Check firewall/security group rules for explicit rejects.
- Try from inside the same network/VPN if the host is internal-only.
Quick commands
nc -vz <host> 21
telnet <host> 21FTPMonitor Help
Still stuck? We can help diagnose and fix it.
Choose the level of help that matches the urgency. Never send passwords, private keys, or other secrets.
Fix Report
$49
A written diagnosis and recommended fix for one FTP, FTPS, or SFTP issue.
- Written diagnosis
- Recommended fix steps
- Best for non-urgent issues
Recommended
Same-Day Help
$149
Priority troubleshooting for one active issue, with a clear same-day diagnosis and action plan.
- Priority troubleshooting
- Same-day diagnosis and action plan
- Best for active business problems
Live Fix Call
$299
Live troubleshooting help for an urgent or unusually complex FTP, FTPS, or SFTP problem.
- Live troubleshooting session
- Best for urgent or complex failures
- Scheduling coordinated after checkout
Related
- TCP connection failed — General TCP failure causes when connecting to FTP, FTPS, or SFTP services.
Diagnostics powered by FTPMonitor CLI