If you have the problem when working on a local wordpress installation where you need to do an upgrade or install a plugin, you may be presented with the following screen asking for FTP details to the server.

Wordpress plugin install FTP prompt

Lets assume you need to install a plugin. One option would be to manually download the plugin and move it into the wordpress plugins directory, but this is frustrating and slow. The better way is to let wordpress handle everything for you.

Running a local FTP server

To allow wordpress FTP access to your website, you can simply run an FTP server with one line from the terminal.

sudo -s launchctl load -w /System/Library/LaunchDaemons/ftp.plist 

That's it! Now you can give wordpress your login details. These will be the username and password you use to log in to your OSX user account.

Note: You must have a password set to run sudo commands. The FTP login will use this same password.

The hostname is the host of whatever URL you have wordpress setup on. For example, this may be simply localhost or perhaps wordpress.local.

The connection type is the default regular FTP. This leaves the final form looking similar to:

Hostname: localhost
FTP Username: myusername
FTP Password: mypassword
Connection Type: FTP

You can then click "Proceed" and wordpress will install the plugin for you, just as it would on a live website.

Stopping the FTP server

Finally you may want to shut down the FTP server for security reasons.

sudo -s launchctl unload -w /System/Library/LaunchDaemons/ftp.plist