In this article, we are going to show you how to install WordPress locally on your computer and make the website live. When you install WordPress locally on your computer, all your website files will be downloaded on your computer, which means only you will be able to see and access your website.
Why do we need to work on WordPress locally?
Test updates, plugins, and themes: You can test new WordPress updates, plugins, and themes locally on your computer. It works on a local hard drive, so if anything goes wrong, then it is not a problem. Once your site is ready, you can publish it online.
Cheaper: Installing WordPress locally on your computer means you need not buy a hosting or a domain to build your website. So building your site is free of cost.
Good for learning WordPress: As building a site locally on WordPress is free of cost, it is good for people who want to learn WordPress and try it.
Needs no internet: Working for developing your website on WordPress needs no internet as you are working on localhost. Thus your files run faster than working on a live site. Moreover, you can work on your website from anywhere around the world by just caring for your computer.
Prerequisite tools and software
There is a lot of software using which you can work on WordPress locally, but here we are going to use ‘XAMPP’ (cross-platform, Apache, MySQL, PHP, Perl) for the same. WordPress is made by using PHP. We need XAMPP to run PHP. XAMPP acts as a server for WordPress. We will also be using wordpress.org to install WordPress and a site ‘phpmyadmin’ to create a database for our website.
- Go to your browser and search for XAMPP.
- Download the suitable version to your computer.
Setting up your local WordPress development environment:
Once XAMPP is installed on your PC, let’s start its setup.
- Open the installed XAMPP file and enter the file address where you wish to install it.
- Go to the XAMPP control panel and make sure that MySQL and APACHE are running.
Installing WordPress locally
- Go to WordPress.org and install WordPress on your computer.
- Copy the WordPress zip file from your downloads.
- Now go to the XAMPP folder installed on your computer and open a folder named ‘ht docs’ in it. Make a new folder and paste the WordPress zip file there.
- Now we need to create a database for WordPress.Search for localhost/phpmyadmin in your browser. This is a MySQL dashboard. Now click on ‘database’ in the main menu bar and create a new database for your website. Make sure that the name you gave to the folder created in the ‘ht docs’, is the same name you give to the database created.
- Now go to the browser and search for localhost/(the name of your project). Your WordPress is started to setup.
- Fill in the details asked, and you are all set to start building your website.
Steps to export local WordPress site to your server:
Once your website is ready, you need to move it from your localhost to a live and running website on Google. To do so, you need to buy a hosting and a domain. There are a lot of web hosting companies like GoDaddy, Hostinger, Bluehost, etc., from where you can buy hosting and a domain.
Here we are going to use GoDaddy to host my website.
So let’s start.
- Go to GoDaddy and buy a hosting and a domain.
- Then install WordPress as your hosting site. As you install WordPress, your site goes live. But this is a new default website created by WordPress. We need to move our local site to this live site to take our local website live.
- Now we are going to download a Plugin named ‘All-in-one WP Migration’ on both the live and local sites. So go to Plugins and search for ‘All-in-one WP Migration’ and install it on both sites.
- Now go to our local website and then click on the All-in-one WP Migration Plugin and then click on export. Click on File and download it. Now our local website is downloaded as a file on our computer.
- Go to our live website and click on the All-in-one WP Migration Plugin and then click on import. Import the same downloaded File from our computer and click on proceed to start the import.
- Refresh your live website to see the update.
- If you want to log in to your live WordPress site, just add ‘/login’ to the site address. Type your localhost username and password, and then you can easily make changes to your live site.