Mac command line users may have noticed that FTP is missing from the latest versions of MacOS system software, but despite ftp not being included in newer versions of system software by default, you can still install ftp on Mac OS if you need to use an ftp client or run an ftpd server for whatever reason.
For some quick background, modern versions of Mac OS pulled ftp to instead emphasize SFTP usage. Likewise, telnet was removed in favor of ssh. These decisions were probably made to favor the more secure encrypted protocols of SFTP (and ssh), but nonetheless some users may still need to regularly use the older ftp transfer protocol, even if it’s not particularly secure. Accordingly, certain Mac users may need to install and run ftp as a client, or ftpd as a server, which is who this tutorial is geared for. If you don’t need ftp, there’s no reason to install it.
How to Install FTP on MacOS
You have two options, one is to install inetutils (which also includes some other useful packages), or you can install tnftp. Either is achievable through Homebrew:
Installing ftp in MacOS with inetutils
The inetutils package includes ftp, the ftp server, along with telnet and telnet server, and the server and clients of rsh, rlogin, tfp, and more. If you want ftp, you very well may want this full suite, in which case installing inetutils through Homebrew is as simple as issuing the following brew command:
brew install inetutils
Once Homebrew completes installing the inetutils package, you can run the regular ftp command as usual, for example you can connect to the gnu.org ftp server to verify that all is working as expected:
One of the obvious perks to installing ftp and ftpd server with inetutils is you get other helpful network utilities, so you won’t need to manually install telnet on the Mac if you need that, it will just come in the same package together.
Installing ftp through tnftp
To install only an ftp client, you can install tnftp on the Mac. With homebrew you can accomplish this with the following brew command:
brew install tnftp
Additionally, if you want the tnftpd server you can use the following command:
brew install tnftpd
Whether you want to install the full inetutils package, or tnftp alone, is entirely up to you and your specific needs and requirements.
FTP was removed in macOS High Sierra and macOS Mojave, but ftp and ftp server do remain in older versions of Mac OS and Mac OS X system software, even if the ftp server has to be manually activated with launchctl. In some older versions of Mac OS, you can even connect with ftp from the Finder however. Meanwhile, newer versions of Mac OS include native options to use SSH & SFTP server for remote logins
Alternatively, get ftp by compiling inetutils
Finally, another option is to compile inetutils from source if you prefer that approach, which you can get here from gnu.org. You’ll need the Mac OS command line tools installed, then unpack the tarball, run configure, make and make install:
tar xvzf inetutils-1.9.4.tar.gz
sudo make install
And then you’re good to go with ftp, telnet, and the other network tools, all by compiling them from scratch.
If you have another solution to getting FTP and an FTP server on a Mac (and no, not SFTP which is different and already included), share with us in the comments below!