Setup WordPress on localhost

In this article, we are going to learn how to setup WordPress on the localhost. if you want to learn how to create your own WordPress theme then you definitely need this article. If you want to create a WordPress theme then you need to first create that theme on localhost.

setup WordPress

Once you understand how to work with the localhost you can move to the host platform to upload your WordPress theme. Now let me first show you how to set up WordPress on the localhost.

Downloading WordPress

The first thing you need is to download the WordPress software. So just head on to WordPress.org to download WordPress.

Once you download it. extract it and place the htdocs in the XAMPP server. As you know, The use of XAMPP is to test the clients or your website before uploading it to the remote web server. This XAMPP server software gives you a suitable environment for testing MYSQL, PHP, Apache and Perl projects on the local computer.

Your htdocs folder would something look like this. You just need to extract the WordPress zip and place it in the htdocs folder in the XAMPP server.

Creating Database

Now once you place the WordPress folder in the htdocs folder in the XAMPP server. You need to create a database to store all the data of WordPress. This database will store you all data, for instance, your articles, tags, categories, users and much more. WordPress CMS works with a database so you cannot create a WordPress theme without a database. So let’s create it using PHP admin.

To create a database open a new tab in the browser and open PHPMyAdmin.

http://localhost/phpmyadmin/

once you open this URL on the new tab. you will see something like this.

Now just click on the new database and create a new database. That’s upon you which name you want to specify to it. I will choose tuition.

Now you have your WordPress database. You need to specify which database you want to install WordPress. So we just need to edit the WordPress file and tell the WordPress to use the tuition database. So we are going to tell WordPress “hey, WordPress please use tuition database to store all my data”.

Open the WordPress folder in the htdocs folder. You can find the config file of WordPress. just open it.

wp-config.sample.php

now you just need to change the DB_NAME, DB_USER, AND DB_PASSWORD fields.

So just change it.

You can notice, I had just changed the DB_NAME to tuition, DB_USER to root and DB_PASSWORD to ” (empty). ( note: if you want, you can choose own username and password to this database).

Now rename the file so WordPress will not ask you to specify database name again while the installation.

So we will change the filename wp-config.sample.php to wp-config.php.

Installation Wizard

Now let’s start installing WordPress on the localhost. Open up a new tab in the URL type http://localhost/wordpress

WordPress will ask you to choose the language you want.

Choose language and click on continue.

Then it will ask you to choose site name, username, password, email. Fill this information depending on your needs. Don’t worry you change it later.

press install WordPress. Done. You have successfully installed WordPress on your local system. The next window will ask you to log in as an administrator.

click on log in.

Specify username and password which you had created when you specify site name and click on log in.

That’s it. When you successfully log in. You will get your WordPress dashboard.

Done!

You have successfully installed WordPress CMS on your local computer. Now you can create your own theme, plugins, and widget for your theme.