How to update WordPress?

Posted October 25, 2013 21k views
I isntalled WordPress in my VPS, now WordPress released a new version, I want to update it, how I should to do? When I click the WordPress update url, it need enter FTP username and password, but my VPS does not seem to install FTP.
1 comment
  • I am not sure of the root I took to get wordpress but I can say that I have two combinations for group and user

    -rw-r--r--  1 www-data www-data   486 May 16 20:51 error_log
    -rw-r--r--  1 www-data www-data   393 May 16 20:51 htaccess.txt
    -rw-r--r--  1      501 staff      418 Sep 25  2013 index.php
    -rw-r--r--  1      501 staff    19935 Jan  2 18:51 license.txt
    -rw-r--r--  1      501 staff     7433 May 10 09:04 readme.html
    drwxr-xr-x  7      501 staff     4096 May 11 10:16 wp-content

    I seem to remember setting these and you say they should belong to ubuntu which is
    www-data www-data
    instead of wordpress as itself

    501 staff

    I am probably getting mixed up somewhere so would appreciate learning how so and to manually do what is needed. Thanks for insight.

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.

Submit an Answer
15 answers
If you're using Ubuntu, the relevant command is sudo chown -R www-data:www-data /path/to/WordPress_directory

You are absolutely right. I only skimmed the tutorial to try and see what you did. The Wordpress folder should be in /var/www and the paste you post does indeed confirm that it is. Very sorry! So yes,

sudo chown -R www-data:www-data /var/www

is correct.

As for being scared of the process, one of the great things about being able to take snapshots of your droplet and spin up temporary ones for pennies is that you can just test it out on a throw-away droplet with out worries. And always make a backup! =)
@Andrew SB, thanks for a great response, this process scares the crap out of me and I don't want to mess it up.

In the tutorial at,

it instructs me to do this,

"We are almost done uploading Wordpress to the virtual private server. The final move that remains is to transfer the unzipped WordPress files to the website's root directory.

sudo rsync -avP ~/wordpress/ /var/www/

Finally we need to set the permissions on the installation. First, switch in to the web directory:

cd /var/www/ "

...Have I missed something? Did it not actually move the WP install to that directory in the install process like I thought?

Looking through all the files in SFTP I see, root/wordpress/ is that what ~/wordpress/ is referring to?

I just want to be sure I am changing permissions to the right directory. I found someone else with the same issue here,
and in this someone suggested to use,

sudo chown -R www-data:www-data /var/www

This seems like the one I should use, is that correct?

I also pasted my output from,
ls -la /var/www
and got this,
by Etel Sverdlov
WordPress is a free and open source website and blogging tool that uses php and MySQL. It was created in 2003 and has since then expanded to manage 22% of all the new websites created and has over 20,000 plugins to customize its functionality. This tutorial shows how to install WordPress on a server with LAMP. It is written for Ubuntu 12.04.

If anyone else is on Ubuntu 16.04 use sudo chown -R www-data:www-data /var/www. Updates work for me now

Try forcing it to use filesystem:
define( 'FS_METHOD', 'direct' ); in the wp-config.php file.

Also, chown the directory to the apache's username and group so it won't have permissions issues:
chown -R apache.apache public_html
Yeah its permissions issue. Change the ownership of the WordPress directory and all contents to the web server user as described above and you'll be able to update from within WordPress and add / updates plugins too.
  • If you have multiple sites and the server owns permissions then isn’t this bad. I thought we should have each website own the rights to modify only its own files and folders…I thought this is why we created a wordpress group..for example if a hacker gets a script in one website then the script is able to act across the other sites? This may be entirely wrong but I am not seeing a clear answer online for this. So thank you for insight or answers.

Thanks a million!
According to your approach, I successfully solved the issue. thanks again!
Thanks, it works for me. I can upgrade directly from WP menu

Btw, could you elaborate this command? sudo chown -R www-data:www-data /path/to/WordPress_directory
I'll give it a spin -

"sudo" - executes the command as the root user on the server

"chown" - "change owner"

"-R" - recursive, drilling down to all child directories and files of the nominated file

"www-data:www-data" - specify the user and group to change the owner to - on Ubuntu, www-data is the name of the user that runs the web server process

"/path/to/Wordpress_directory" - simply the file path to the wordpress installation.

On the prebuilt DigitalOcean boxes, the file path will be something like /home/wordpress/public_html
Beauty! This solved my problem! Great explanation!
Previous 1 2 Next