How to Change Your Server’s FTP Port

By default, most dedicated servers use port 21 as their FTP (File Transfer Protocol) port. Most FTP clients also recognize this port out of the box, without any configuration necessary. For the majority of your server needs, you will want to leave the default port as is.

In a few unique situations, however, you might need to change the FTP port on your dedicated server or virtual private server (VPS). For example, if you only use FTP internally (i.e. do not have shared hosting clients) you can add a little extra security by making your FTP port something less conspicuous.

On a Linux or Unix server, you can easily change the FTP server port in both ProFTPD and Vsftpd.

To change the ProFTPD port, find the configuration file (/etc/proftpd.conf and edit the following line:

Port 21

Change “Port 21” to whatever port you want. Just make sure that nothing else is using the port you choose.

For Vsftpd, you need to edit the file found at /etc/vsftpd/vsftpd.conf and find the line:


Change the port number to the port number of your choice, as long as it is not in use.

After editing the configuration file of your FTP server, you will need to restart the service.

For ProFTPD:
/etc/init.d/proftpd restart

For Vsftpd:
/etc/init.d/vsftpd restart

Whenever you start or stop using a port on your server, you must apply those changes to your firewall as well. If you will no longer be using port 21, close it in your firewall, and to use a new port, you should open it in your firewall to allow access. Please also be aware that most FTP clients will expect port 21, so you will need to manually change the port in your FTP client to work with the server.