Allowing Wordpress to update/install with SSH Keys


Can anyone help with this.

I am using centOS on a small droplet with a couple of Wordpress installs, I have SSH Keys set up however I don’t want to use FTP to allow Wordpress access to auto updates and plugin installs.

There must be a solution for this but I cannot find anything really useful on the net. Any ideas?

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

You have two options to bypass FTP.

1. First one is using Direct write to wp-content directory

This method doesn’t require FRP or SSH, it directly writes to wp-content directory. You must ensure before using this method that you does have sufficient permissions to write to wp-content. Usually you would go with setting ownership to regular user (e.g. sammy) and group to apache (apache is CentOS equivalent to Ubuntu’s www-data).

This is done by following command:

  1. sudo chown -R sammy:apache /var/www/html

After you make sure it is setup correctly you will have to change wp-config.php. Find FS_METHOD and change its value to direct. It should look like -> define('FS_METHOD', 'direct);

2. First one is using SSH/SFTP write to wp-content directory

There is How To Configure Secure Updates and Installations in WordPress on Ubuntu by DigitalOcean. It is for older version but it still should do its job. Keep in mind if you are using php7 to use equivalent packages for it.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel