Most hosting companies will set up your WordPress installation or have automation scripts in their admin panel (cPanel, etc.) for the job. However, setting WordPress up is as easy as can be and is a skill worth having, as it can be extremely useful to run WordPress on your dev box. At the time of writing this, the latest version is 6.6.2.

Take screenshots of the setup & configuration screens as you go or write the details down.

Requirements

This tutorial assumes that you have a computer set up as a dev machine with the following installed and configured:

  1. Apache HTTP Server
  2. PHP
  3. MySQL
  4. phpMyAdmin or MySQL Workbench

See the WAMP (LAMP) post for more.

Create the MySQL database

Open phpMyAdmin or MySQL Workbench and create a MySQL database.

See the CREATE DATABASE statement tutorial.

Create a database user account

WordPress will need to connect to the MySQL database. To do this, you must create a database user account (“DUA”):

  1. Create user
  2. Grant privileges
  3. Flush

Despite the fact that the official docs tell you to grant all privileges to the DUA [1], I think it is bad practice to do so (or use your admin credentials) as if someone hacks your WordPress they would have full access to all your databases, let alone your WordPress database.

Importantly, your DUA should not have GRANT privileges and should not have privileges to any other databases on your server. Read about the “Principle of Least Privilege” (POLP) in this excellent article, What Is The Principle of Least Privilege in WordPress  [2]

See the CREATE USER & GRANT PRIVILEGES in MySQL tutorial.

Download WordPress

Download WordPress here for free: https://en-gb.wordpress.org/download/ 

The download page has links to resources for installing and using WordPress. [4]

Unzip

Assuming your htdocs directory is empty, simply unzip the downloaded file into your htdocs folder:

htdocs
  ⊢ wp-admin
  ⊢ wp-content
  ⊢ wp-includes
  ∟ index.php

Configure

The installation is done using a set-up wizard in the browser. Open your browser and enter 127.0.0.1 or localhost in the address bar to load the WordPress Installation Welcome screen:

  • The WordPress installation welcome screen.
  • WordPress installation database details.
  • WordPress database connection successful.
  1. Click the Let’s go! button
  2. Enter the database settings & click the Submit button
  3. Click the Run the installation button

Sign in

Sign in to the admin back-end and head over to the Setting up a WordPress site tutorial.


    References:

    1. WordPress Developer Resources – Advanced Administration Handbook (2023) Creating Database for WordPress. Available at: https://developer.wordpress.org/advanced-administration/before-install/creating-database/ (Accessed: 20 October 2024).
    2. Hosting, S. W. (no date) What Is The Principle of Least Privilege in WordPress and Why It’s ImportantSiteGround. Available at: https://world.siteground.com/blog/principle-least-privilege-wordpress/ (Accessed: 20 October 2024).
    3. Swisher, J. (2023) WordPress Database: A Detailed Guide with Best PracticesJetpack. Available at: https://jetpack.com/blog/wordpress-database/ (Accessed: 20 October 2024).
    4. WordPress.com (2024) Get WordPress English (UK). Available at: https://en-gb.wordpress.org/download/ (Accessed: 20 October 2024).

    By MisterFoxOnline

    Mister Fox AKA @MisterFoxOnline is an ICT, IT and CAT Teacher who has just finished training as a Young Engineers instructor. He has a passion for technology and loves to find solutions to problems using the skills he has learned in the course of his IT career.

    Leave a Reply

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