Tutorial, Ubuntu

How to install WordPress on Ubuntu Server

This won’t be my usual detailed blog because there are a lot of blogs out there on the topic.

All in all, this blog got me most of the way there. However, it didn’t really go into the details related to the apache conf files so I’ll embellish his blog a bit… ok, the more I look at it, my blog for setting up Akaunting is a tad more complete so we can bounce between the two.

Also MYSQL has some syntax updates and password handling updates which I will talk about a bit, too.

  1. Point your domain to your server. In my case I use Digital Ocean and I just add the name of the domain under the ‘networking’ section and point it to the server
  2. Set up a LAMP server. I cover this process in the blog above and in other blogs. On a (L)inux machine, install (A)pache2, (M)ysql database and, (P)hp language and modules (LAMP)
  3. Follow “Big Step 5” in my blog and change out ‘akaunting’ for ‘wordpress’ or whatever you want, but, take note of the new Mysql sytax. My blo above shows this syntax which is wrong:

GRANT ALL ON akaunting_db.* TO 'username_here'@'localhost' IDENTIFIED BY 'same_password_here' WITH GRANT OPTION;

This updated syntax from his blog is correct and will not create error:

GRANT ALL PRIVILEGES ON wordpress.* TO 'wpuser'@'localhost';

Finally, before we leave the Mysql section, I also need to address a ‘bug’ that I hit on one (not all) installations. I got all the way to the wordpress installation page but it would not connect to the database. The issue was something to do with the way Mysql was handling the password. I found this blog which covers and solves it and the solution, if you encounter this, is to run this command while logged in to

ALTER USER 'wpuser'@'localhost' IDENTIFIED WITH mysql_native_password BY 'passwordstring';

(change ‘wpuser’ with your user and ‘passwordstring’ to your password of course)

  1. Follow his blog for ‘Install WordPress’ section instructions. I liked these – and they worked well.
  2. For permissions,
  • Apply correct ownership of directory:

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

  • Create correct file permissions:

sudo chmod -R 774 /var/www/html/yourWPdirectory/

(not sure why 774 but that’s the one I found online… do your own research on this as usually I do 755…)

Otherwise, hopefully you can piece everything together with these comments and links.

Tagged , , ,

Leave a Reply

Your email address will not be published. Required fields are marked *