So, you’re running a development server on your OSX machine, ey?
No, how do you easily update your WordPress setup? Or install WordPress Plugins? You need FTP connectivity…
First you would check the ‘Sharing’ section in ‘System Preferences’ only to find FTP is not there. So you might think, OSX does not have an FTP server?
Well, it would be a logical assumption because FTP is a bit outdated and WebDAV and SSH can do what FTP does but more secure. Unfortunately, WordPress only supports the FTP protocol.
Do not fear, OSX still carries the FTP servers AND on top of that, no extra configuration is needed, you just have to activate it.
How to activate FTP server on OSX?
To start the FTP server:
sudo -s launchctl load -w /System/Library/LaunchDaemons/ftp.plist
To quit it:
sudo -s launchctl unload -w /System/Library/LaunchDaemons/ftp.plist
It’s that simple :)
And remember; the FTP server will start automatically on each boot until the ‘quit’ command is used.
Final note; This post is the fifth post in a series to build the “ultimate” setup. See ‘The “Ultimate” Guide …’ for a complete list.
20 thoughts on “How to activate FTP server on OSX”
Just what I was looking for, tnx dude!
That’s OK, but! Suppose one wants to have one account with rights on a specific directory, without creating a OSX account with its home, and so on, on Mountain Lion. I mean just a plain ftp/sftp user. I’m trying to add such a user in System Preferences/Users and Groups,of type “sharing only” but I don’t see the created user in the panel. Thus I cannot change its home directory to where I want.
Could you, or someone else, post a way to accomplish this?
Well, step one would be; create a sharing-only user
Then Rightclick the user and choose Advanced Options
Set shell to bash
Set home directory to wherever you want
This user can now access your system through FTP.
Do keep in mind that this user has his own user ID so the directory and its contents must be writable. This user cannot overwrite files by other users, etc.
After googling for you a bit I found this* forum-thread suggesting the use of CrushFTP or Rumbus instead of the built in FTP service. I haven’t tested any of these.
I also had to add
define('FS_METHOD', 'direct');to my wp-config.php file in order for wordpress to function as desired.
Thanks for your help)
Setting the filesystem access method to ‘direct’ negates the use of FTP. So thank you for your comment, but it’s not relevent here.
2015 update: This still works like a charm! Finally the last part of my local developement stack is complete.
Brilliant! I do a lot of WordPress but in this case needed to update a test installation of OpenCart. Every module, release etc. is build on the idea that you FTP your new item up to the server. The folder structure can be hairy so the idea of doing it manually was out of the question. Now I can install it locally with FTP. You’ve saved me hours. Thanks so much.
Hi there :) Thank you so much for the tutorial although when I paste the command and press Enter it ask for password and when I try to type it or even paste it nothing happens…I believe I must be missing something ….? Many Thanks
The sudo command (as any other command asking for a password on the terminal) will not echo when typing a password. So you will not see that you are typing or pasting, but you are :)
Just type your password and hit enter.
That helps a lot! Thanks!!!
Hi, I’m a newbie to web development and am trying to set up WordPress. Where/how do I type or paste in the shell command? Thanks for humoring me.
Shell commands are to be entered in the shell, which in OSX is available with the Terminal application. The shell in OSX is the Bourne Again Shell (a.k.a bash), in case you are wondering :)
I switched to el Capitan and your code helped my at least to start ftp service again. In the past i used the pureFTPd Manager. With this litte app i could configure the ftp-Server. Unfortunaly it’s not for El Capitan, so i don’t have any idea how to configure the ftp-Server. What i wanna do is to add a new User with adminstrator rights, but only in the webroot directory which sits in my home directory. My programmer who’s working externaly, has to access the webroot, but only the webroot ;-). At the moment he can login, after i startet ftp, but i would love to change these settings. Now for testing it’s ok, because i set up everything new and don’t have the private files copied back to the new machine. I’m pretty new to all the terminal stuff and very unsure, what i’m doing, if i type some code in the terminal ;-)I hope my «german-english» is halfeway clear ;-)Regards from SwitzerlandPierre
I think there is only one problem why the PureFTPd Manager no longer works. I cannot be certain because I haven’t used it in the past and not using it now, so I have no basis for comparison. I have checked and verified the FTP software in 10.11 (El Capitan) to be identical in earlier versions at least as far back as 10.7 (Lion). I have no way to verify on 10.6 (Snow Leopard) which is still supported by PureFTPd Manager.
Now there are two possibilities that PureFTPd Manager is no longer working, and either one of these, or both, are applicable.
1. OSX no longer uses PureFTPd since 10.7 – the FTP server announces itself with the name tnftp on 10.7 though 10.11. This may be a naming thing, perhaps the two are compatible – at least for user management – but perhaps it’s different software altogether.
2. OSX 10.11’s System Integrity Protection is acting up. You can disable SIP and maybe solve this issue, but it will reduce the security of the OS.
I used this command to start the FTP server on Yosemite and since then upgraded to El Capitan + OS X Server. Now that I have a “real” FTP server, I wanted to disable the automatic startup of FTP. I’m trying this command…sudo -s launchctl unload -w /System/Library/LaunchDaemons/ftp.plistbut am not able to unload FDP, get…/System/Library/LaunchDaemons/ftp.plist: Could not find specified servicebut it’s running and the plist is there!!??Open TCP Port: 21 ftpHow to stop this from starting at boot?
My instructions are for OS X only, not for OS X + OS X Server. To disable the FTP service, use the Server app. Unfortunately, I do not have a mac running the Server app so I have no idea where to look.
It does not work anymore in macOS High Sierra(or later) version.
You are correct, as per High Sierra the FTP server software (and also client! software) is removed. This is a good thing! FTP is an insecure protocol and sFTP (the SSH File Transfer) should be used instead. However, this article was created for help in updating a local WordPress installation (in 2012!!) and at that time, the PHP that came with OSX was the mod_php Apache module, that had no direct file access.
In High Sierra (at least) the PHP handling is done with PHP-FPM which does have direct file access, so updating a local WordPress website no longer requires FTP.
If (any of) you are looking at this article to get FTP connectivity; you no longer can, but you CAN use sFTP, most FTP clients (I suggest Transmit.app or CyberDuck) allow sFTP connections.
. You will no longer need FTP.
If the goal is to update a local WordPress installation, make sure you are using the PHP-FPM that came with MacOS (no longer OSX) and verify in the config files that FPM is running as
If you feel adventurous, there probably is a HomeBrew or Macports port of a few Unix/Linux FTP servers.
For FTP client on command-line, also check HomeBrew (the package you require is — if I’m not mistaken — inetutils)