After installing a complete localhost, now we can proceed to install WordPress on localhost to create a website on our virtual host network.
Before installing, you should create a separate folder in the folder “C:\\xampp\htdocs” for easy management, you can add a virtual domain name if you like.
Contents
STEPS TO INSTALL WORDPRESS ON LOCALHOST
Step 1. Download the source code from the WordPress.org website
First, download the latest version of the WordPress source code at https://wordpress.org/latest.zip .
Then you unzip it, you will get a folder named ” wordpress “. Maybe this wordpress folder will be nested in another folder named wordpress-x (x here is the version number), but in general you will get a folder named wordpress as shown below.

Go ahead, go to the wordpress folder. You will see there are some folders named wp-admin, wp-includes, wp-content and some files named index.php, wp-config-sample.php , etc. All these files and folders, we call it the WordPress source code.

WordPress source files and folders.
Step 2. Copy WordPress source code to Localhost
Now copy all these files and folders to your website folder in localhost (eg C:\xampp\htdocs\thachpham ). That means you only copy the source code files and folders. Do not copy the whole wordpress folder because we need to install WordPress on the domain http://localhost/thachpham. If you copy the wordpress folder into it, your website will have a path of http://localhost/thachpham/wordpress/ .

Step 3. Create a new database
To run WordPress , your localhost must have a database using MySQL so that it can store soft data there such as posts, settings, etc. on the website.
How to create a database on localhost I have detailed instructions here , you can check it out.
Step 4. Run the website to install
Once the copy is done, open the XAMPP control panel and start Apache and MySQL. Then access the website with the path http://localhost/thachpham
At this point, it will display a menu to select the language to install WordPress, select English and press Continue .

In the next step, it will remind you that you have not changed the wp-config-sample.php file to wp-config.php and declare the database information there. Click Let ‘s Go and let it do the work for you.

+ Enter database information
Always remember that on localhost:
User Name of the database is always root.
The password is blank (there is still a way to set it up but it is not necessary) and the Database Host is always localhost .
Table Prefix means the prefix of the database containing WordPress data, by default it will be wp_, we can change it to anything but must have _ after it.
When finished entering the database information, press the Submit button to do the next step. If the next step it appears as shown below, it means that you have entered the correct database information. Click the Run the install button to start the installation.
In this installation step, you will need to set up important information for the website such as the name of the website, admin account name and password, etc. After entering, press the Install WordPress button.

And if it shows the word Success, you have successfully installed wordpress, click on the Log in button to log in to the WordPress admin panel.
+ WordPress admin page interface

And here, I need you to understand that, if you access the main domain name like http://localhost/thachpham , it will show the homepage of the WordPress website like this.

If you want to access the WordPress Admin page, add /wp-admin to the path to http://localhost/thachpham/wp-admin .
EPILOGUE
Through this article, you have learned through how to successfully install WordPress on localhost environment. Continue reading the following articles to learn how to use and administer WordPress!
Source: Thach Pham.


