You want to install WordPress on your local machine to test themes, plugins or get familiar with WordPress without the need for a paid hosting, but don’t know where to begin? Don’t worry. We’ll teach you how. In this article, we’ll be showing you how you can install WordPress on your own. Follow the article and do as it says. WordPress will be running on your machine in no time.
Step 1: Downloading WordPress
The first thing we need to do if we want to install WordPress is to download WordPress. In this tutorial, we’re going to be using the latest version of WordPress – WordPress 5.4.2
You can get it from its website. Here’s the link: https://wordpress.org/download/
When you get there, click the ‘Download WordPress 5.4.2’ button (5.4.2 is the latest version of WordPress at the time this was written).
A zip file will be downloaded.
Extract that zip file. Once that is done, a folder with the title ‘wordpress’ will appear.
We’ll rename the ‘wordpress’ folder into ‘wp-test’ (although any name will do)
Step 2: Downloading/Installing XAMPP
The WordPress file by itself isn’t enough. We need a server to host the site. We will also need a database management system. XAMPP has both of those! XAMPP is a package bundled with a server, a database and more. It also comes with a panel that allows us to manage those components. Because of that, we’ll use XAMPP.
We need to do download it. We can get it from https://www.apachefriends.org/index.html
Download the latest version of XAMPP.
Save the installer. Alternatively choose to run the installer directly.
Once the installer shows, click ‘Next’
it will show which components are available for installation.
To run WordPress site and to manage its database , we only need to include the packages shown in the image. However, you are free to include the other modules if you need them.
Choose a folder to store the XAMPP directory. In our case we will choose to install XAMPP in C:\xampp. Once that is finished, click ‘Next’
Step 3: Creating Databases and Users for WordPress
We need to create a database. For WordPress, It’s necessary. But don’t be daunted (if you don’t know how or if you do but find it tedious). XAMPP Is bundled with a Database Management System – phpAdmin.
We will use phpMyAdmin to create a database.
To proceed, go to C:\xampp.
Next, click on ‘xampp-control’. It will open window
What you will see is a control panel for managing the different XAMPP modules.
Look for the Apache and MySQL modules.
Click ‘Start’ on the Apache Module. Click ‘Start’ on the ‘MySQL’ module as well
Once the modules starts, click ‘Admin’ to start phpMyAdmin.
A browser window will open. Here is where we manage databases. Click on the ‘Databases’ link.
The Database fields will be seen. For the purposes of this tutorial, we will be naming the database for our WordPress site as ‘first-wp-db’. We will type our database name in the ‘Database Name field’. Click ‘Create’ once that’s done.
Once the database is created, it will redirect to a new tab – the database ‘Create Table’ tab.
For now, we don’t need to create tables. The database just has to be ready (this database will be populated by WordPress once the WordPress site is installed.
We will also need to create a user that has access to the database.
Click the phpAdmin logo to get back to the phpAdmin homepage.
Once there, click ‘User accounts’.
Once redirected, click ‘Add user account’
The following screen will be displayed. We can add database user accounts here
For this tutorial, the username we will be using is ‘wordpress-user’. Our password is ‘password’
Leave the options in ‘Global Privileges in their default (do not click any checkbox)
Scroll down the page. And click ‘Go’
Click the ‘User accounts’ tab once finished. Once there click the ‘Edit Privileges’ link for the newly created user
When the page redirects, click ‘Database’
Add privileges to the Database created for WordPress (in this case ‘first-wp-db). Once done click ‘Go’
The page will refresh with options for the database privileges. In this tutorial, we will be checking ‘Check All’. Afterwards, click ‘Go’
Take note of the Server in the resulting page. This is usually ‘127.0.0.1’ also known as “localhost” (check your host file)
We’re done, the database user and database have been created.
We can proceed to the next part (and you may choose to do so).
However, this is important. Please look at the image below.
The boxed area shows that username ‘root’ also has ‘ALL_PRIVILEGES’. So it also has access to any database created for our WordPress site. We could have chosen not to create a database user in the first place (and use ‘root’)
(Step 4) Setting Up ‘wp-config.php’ (Optional)
This step is optional since WordPress will create a wp-config.php file upon installing.
However, if you want to configure it on your own, go inside the folder that was extracted in Step 1. Look for ‘wp-config-sample.php’. Open the file.
You will see the following lines. Modify it in accordance with the database configuration settings you did from Step 3. (For instance, ‘DB_NAME’ is the name of the database you created. This will define the variables needed to access the WordPress database.
For this tutorial, I modified the definitions with the configuration settings I did in step 3.
(Note: As was mentioned in the official WordPress installation – https://wordpress.org/support/article/how-to-install-wordpress/ – DB-CHARSET should not be changed and DB_COLLATE should be left blank.)
Save the file as ‘wp-config.php’
Step 5: Installing WordPress
We are now ready to install WordPress and deploy it on our local server
Go to C:\xampp\htdocs and paste the extracted folder from Step 1 inside C:\xampp\htdocs.
In this tutorial, we renamed the extracted folder to ‘wp-test’ (Note: the name of the extracted folder will be the name of our WordPress site. If you didn’t rename the folder, the WordPress site will have the name ‘wordpress’)
Open a web browser.
To access our site, type localhost/foldername.
In this tutorial the foldername is ‘wp-test’. So we will type ‘localhost/wp-test’ in the address bar.
It will redirect to this page below. Pick a language and click ‘Continue’
If you chose to skip creating the ‘wp-config.php’ file a shown in Step 3. You will be redirected here to this page. You will be asked for your database credentials and information. To proceed, click ‘Let’s Go’
Fill in the fields. (The page will ask for the defined values found in ‘wp-config.php’. In particular, the values we edited.) Once done click ‘Submit’
We’re almost there! Click ‘Run the installation’
You will be redirected to this page. Fill in the details. Once done click ‘Install WordPress’
We’re done! We can now install WordPress on our local machines. We can now start working on our WordPress site.