What port does FTP use?
FTP uses 20 and 21, and which one depends on what you are doing.
Two ports because the protocol separates commands from data — the design that makes FTP awkward through firewalls.
| Port | Protocol | Name | What it is for |
|---|---|---|---|
| 20 | TCP | FTP data | The data channel of the classic File Transfer Protocol. The control channel is port 21. |
| 21 | TCP | FTP control | The command channel for FTP: login, directory listings and transfer commands. |
Exposing it
Unencrypted. Use SFTP (port 22) or FTPS instead — plain FTP sends credentials in clear text.
Checking it is listening
sudo lsof -i :20 # macOS, Linux
netstat -ano | findstr :20 # Windows
nc -zv host 20 # from elsewhere
An "address already in use" error on a port nothing appears to be holding usually means the socket is in TIME_WAIT rather than that a process has it — the ports reference covers that and the ephemeral range.
Frequently asked questions
What port does FTP use?
FTP uses ports 20, 21, and they do different jobs. 20: The data channel of the classic File Transfer Protocol. The control channel is port 21. 21: The command channel for FTP: login, directory listings and transfer commands.
Is port 20 safe to expose to the internet?
Unencrypted. Use SFTP (port 22) or FTPS instead — plain FTP sends credentials in clear text.
How do I check whether FTP is listening?
sudo lsof -i :20 on macOS or Linux, netstat -ano | findstr :20 on Windows. From another machine, nc -zv host 20 says whether anything answers.
Other services
- What port does DHCP use?
- What port does Docker use?
- What port does MQTT use?
- What port does SSH use?
- What port does RDP use?
- What port does MySQL use?
- What port does PostgreSQL use?
- What port does SQL Server use?
- What port does Oracle use?
- What port does MongoDB use?
- What port does Redis use?
- What port does Memcached use?
Port 20 in full · Port 21 in full · Every service · All port numbers