Last Updated: May 02, 2019
·
755
· johnqunknown

Allow wordpress to install plugins, themes, etc.

So, you've setup a new and fresh Wordpress blog (wait, you haven't? Download it at the Wordpress website) and you're ready to start blogging! But before that comes customization, you know you have some plugins you've read about, maybe a theme or two you want to try, and some other settings you want to tweak, so you go on ahead and click the appropriate option in the dashboard (Themes or Plugins), click on "Add New", make a choice and click "Install", but what's that? Why is it asking you for an FTP server, username and password?

FTP Options when installing something new

In order for this to work, you should be running a FTP server on your server, this would work if you're hosted on a shared server or have a team behind you taking care of these issues, but what happens if you are hosting your blog on Koding or a fresh VPS? (refferal link BTW ;D)
What happens if you're testing this in your local computer and have no means or want to setup a FTP server just because if this? Well you could install a plugin to use your SSH credentials and make it work with SFTP (as it is shown in the picture) or you could change the permissions on your wordpress directory and forget about usernames and passwords forever!

If you're like me, you want to make this as easy as possible, because you're lazy (like me). Keep in mind that to follow these instructions you must have the following:

  • SSH access to your server.
  • Necessary permissions to change the owner and group permissions of your wordpress installation directory.
  • Confidence in your understanding of these instructions (I'll make it as easy as possible).
  • Comfort in using the Linux/Unix terminal.
  • A wordpress installation (obviously).

Step 1: Login<br />
The first step could be obvious to most of you, but I'll include it just in case. You need to access your server via SSH (Putty on Windows or SSH in OSX/Linux).

Step 2: Access installation directory<br />
After you've logged in to your server, you need to change the directory to the wordpress installation.

root@server ~: cd /path/to/wordpress/installation

e.g.

root@server ~: cd /var/www/wordpress

Step 3: Change permissions
This is the last step, we will change the permissions of the whole wordpress installation directory and make the default www-data user to have ownership of the files since this is the user under which your webserver (apache, nginx) typically runs on.

root@server /var/www/wordpress: chown -Rv www-data:www-data *

This will require root access (or at least the permission to change owner), maybe you'll need to append sudo before this last command.

After this, Wordpress won't ask for any username or password when installing a new theme or plugin.

No more passwords!

Hope this helps you in any way, if you have any questions leave a comment below ;D

Want to know who I am? Visit my "About" page in my Blog.