How to Install WordPress 5 On Ubuntu 16.10/16.04 Using LAMP Stack

Best Affordable Linux and WordPress Services For Your Business
Outsource Your Linux and WordPress Project and Get it Promptly Completed Remotely and Delivered Online.

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Get your own self-hosted blog with a Free Domain at ($3.45/month).
  4. Become a Supporter - Make a contribution via PayPal
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux courses

We are thankful for your never ending support.

Aaron Kili

Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

182 Responses

  1. ashish says:

    I installed wordpress on ubuntu and I am trying various plugins but how I will check plugin is working on website, I mean will it show changes just by writing IP address on browser or any other process to check plugins effect working or not .

  2. Ken Snyder says:

    I think a missing step that everyone is likely to hit is the need to remove the “index.html” from the root directory. I removed and things got immediately better. The next hurdle for me is figuring out why the mod-rewrite rules are not working (or that’s what I’m assuming is happening) … basically anything outside the root directory is coming as not found.

  3. gurjeet singh says:


    Thanks for sharing the information. I really need to setup a WordPress on my Linux server, I have one more Question is 512 ram is enough for WordPress on VPS server?

  4. Ben says:

    At the final step when I enter my wordpress website it says THIS SITE CAN’T BE REACHED and my IP address took too long to respond.

    This problem is driving me crazy PLEASE HELP!

    • Aaron Kili says:


      Ensure that there is connectivity to your server, if you are running a firewall, check if client requests are allowed via port 80(HTTP) to the web server. You can try pinging your server.

  5. Sara says:

    “then update it with your database information under the MySQL settings section (refer to the highlighted boxes in the image below):”

    I got stuck at this step. Where should I do all these? Is it I have to go to mysql -u root -p and then type all those command?

    • Aaron Kili says:


      Do that in the wp-config.php file. Remember, you first have to create the database after running mysql -u root -p, then you add those settings(database host, database name, database username and user password) in the wp-config.php.

      • Sara says:

        Thank you for your respond. When I proceed, I keep on getting the message below. Can you please help me once again?

        E325: ATTENTION
        Found a swap file by the name "/var/tmp/wp-config.php.swp"

        Why do I keep getting this message when I try to update my database information?

        • Ravi Saive says:


          When a file is not properly closed, it will create a temporary file with same name as extension .swp, deleting this file will solve problem.

          # rm -rf /var/tmp/wp-config.php.swp
  6. Benjamin Winchester says:

    I’m setting this up on a home server. I had LAMP installed already, and my server IP address would load my “index.html” file. After loading WordPress, it still loads the “index.html” file (so no changes from pre-installation.) If I rename the “index.html” file, then nothing loads. What have I missed in my configuration? I can’t get to the “Let’s Go” welcome page. Thanks!

    • Aaron Kili says:


      Remove the default Apache index.html page and you will get the WordPress page, something like this:

      $ sudo rm /var/www/html/index.html
      • Chris Owen says:

        I was having the same problem as Benjamin and I followed your recommendation by removing the default Apache index.html page, now when I load my localhost page I just get an error page that says “Error establishing a database connection”. I followed the tutorial, or I thought I did, do you have any idea what the problem could be?

  7. J says:

    I have no experience on this, I got stuck on step 2 of step 1. When I type this into virtual box it as a command.

    $ sudo systemctl start apache2

    It does nothing, i get the enable part but nothing when i do start?

    I am I suppose to type those in together then enter? if so how do you make it hit return to start a new line

    • Aaron Kili says:

      The command:

      $ sudo systemctl start apache2

      shows no output, to check if Apache2 server has been started yet, simply run this command:

      $ sudo systemctl status apache2


  8. kke says:

    Error establishing a database connection. I double and triple checked that my login details are right. I also checked that my database is up and running.
    Only thing I’m not sure is that in:

    mysql> GRANT ALL PRIVILEGES ON wp_myblog.* TO 'your_username_here'@'localhost' IDENTIFIED BY 'your_chosen_password_here';

    should I include the ' ' or delete them and replace with my username just. The same question about ' ' in the wp-config.php file.

    • Aaron Kili says:


      You can use the same username in wp-config file here, as long as that user is responsible for managing the wordpress database:

      mysql> GRANT ALL PRIVILEGES ON wp_myblog.* TO ‘your_username_here’@’localhost’ IDENTIFIED BY ‘your_chosen_password_here’;

  9. Venkatachalam D says:

    Works like a charm !

    Great job putting this together.

Got something to say? Join the discussion.

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.