WordPress is one of the most popular environments for building websites in the world, and one of the reasons it’s so great is because it’s incredibly flexible and you can manipulate it however you want.
In this article, we’ll talk about installing WordPress locally on your computer (Windows and Mac) and some benefits you might have for doing it.
Why Install WordPress Locally
Many developers and average users have WordPress installed locally — some for business reasons, some for private reasons. In general, a local WordPress setup can be extremely beneficial on multiple levels. Here are some of the best pros.
Learn and Develop Your Skills
If you want to become a pro at developing websites on WordPress, you must practice using it to learn about its features. For beginner WordPress developers, using it offline is the best option as you can make any necessary changes frequently, without worrying about how it affects the site.
Test New Features At Your Convenience
A live environment is not suitable for testing new features, because it can have a negative impact on the reputation of your site, as well as your business. So, you’re better off testing them locally and you will get a clearer idea of the themes, plugins, and other features.
Work Freely In Your Isolated Dev Environment
Your isolated dev environment is your playground to play with fresh codes, new features, etc. You can use all your creativity to implement new ideas without any risk of affecting a live project. As a result, you get to enjoy great flexibility in the locally running WordPress.
Get High Performance At Low Cost
As all the stages are running without an internet connection, you will get a much faster experience than you would online. And, using all the free software will save you a lot of money. Therefore, a local WordPress environment is also a financially convenient option.
Test New Updates
A local WordPress environment allows you to test new updates from features before applying them on your live site. This will give you a clearer idea about the latest security patches and the convenience of using updated interfaces.
How To Install WordPress Locally with XAMPP (Windows)
WordPress is used for complete website development involving a variety of things like designing, developing, testing, and hosting. And, all these require heavy technologies like a web server, PHP, and a database (preferably MySQL). Consequently, to create a suitable environment for installing WordPress on your local machine, you need to complete the following steps:
- Setting up the installation environment
- Downloading a stable WordPress version
- Installing WordPress on your localhost
Windows is always reliable for providing a suitable environment to install and use the most popular technologies. WordPress is no exception and can be installed easily on Windows using the following steps:
Step 1: Download and Set Up XAMPP
WordPress needs the proper environment to run locally, and that requires setting up a server on your device. You can do that by installing XAMPP or WAMP (local server builders) on your machine. Using XAMPP is comparatively easy and advantageous so, here is a guide on installing that.
XAMPP is an app that hosts web servers for your website. You’ll be opening this app every time you want to launch your WordPress site locally. On the Apache website, navigate to the “Download” section and select the version that works best with the latest PHP version. PHP is the language used in the back end of most websites.
After the download is complete, run it to install XAMPP on your system.
After this screen, you will be prompted which features you want to install, and by default, all of them will be selected — regardless of what you need, there’s no harm in having all of them so feel free to proceed with the installation until it’s completed.
Also, at some point of installation, your Windows Defender might ask you if you want to allow access to XAMPP to slip past firewall rules and communicate on your private and public networks — make sure to allow access. Don’t worry about why XAMPP asks for these permissions, it just needs to do so because hosting a web server for your website requires accessing network features.
Step 2: Start required services
After the installation is finished, launch the XAMPP control panel to set the required status for Apache and MySQL.
Make sure to “Start” these two services to install WordPress locally. If the background color of Apache and MySQL changes to green, that means the modules are working properly.
Step 3: Download and Install WordPress
Even though this process is fairly simple, we’re going to break it down into separate steps so you can follow the process closely.
Step 3.1.: Download WordPress
Once you’ve finished setting up the webserver and database through XAMPP, download the WordPress setup from the official website.
Step 3.2.: Move and extract the downloaded file
When the download is finished, move the zip file to the /htdocs folder in the XAMPP directory. Unzip it there and navigate to the project directory.
- Confirm the Apache and MySQL services in the XAMPP control panel are properly set and normally running.
- Rename the “wordpress” folder to the name of your new website.
Step 3.3.: Create a database in the phpMyAdmin portal
Now, for creating the database of your new WordPress site, visit the phpMyAdmin portal. Though this depends on your port configuration, most likely you will get the portal on the following URL.
After opening the phpMyAdmin portal, go to New, name the database however you want, and then click Create. This will create the database your WordPress website will use.
Once you are done with creating the database, you will have to create a new User.
Step 3.4.: Create a new User
Go to the “User accounts” tab and click on “Add new user”.
A new window will open where you get basic information about the new user.
For this tutorial, the credentials we chose are:
Make sure to set the Host name to Local as we’re installing WordPress locally.
Below, you will need to grant permissions to the new user — make sure to click on “Check all” under “Global privileges”
After that, on the bottom of the page click “Go” — your new user should be created successfully.
Step 3.5.: Launch WordPress Installation
Now you can proceed with installing WordPress. Before you do so, don’t forget to rename the folder you extracted (from the zip file you downloaded from WordPress) to the actual name of your website.
For this guide, we decided to name the folder “newwpsite”.
Launch the WordPress installation setup by visiting the following URL in your web browser.
There you will get the option to select your preferred language. Select it and click “Continue”.
Important note: In the “wordpress” folder or “newwpsite folder” (that’s how we named it) there is no wp-config.php file, only wp-config-sample.php if you’re choosing other installation methods. This method doesn’t involve editing the wp-config-sample.php file and making wp-config.php — WordPress installation should create it by itself.
Step 3.6.: Enter credentials
After you select the language you will be using, A prompt will appear asking for the information you previously created — Database Name, Username, and Password.
Since you are installing WordPress locally, Database Host can remain “localhost”.
Table Prefix is by default “wp_” and should be left like that.
Step 3.7.: Run the Installation and set up your login information
After you submit it, you should be able to run the installation successfully.
In case you didn’t enter proper information in the credentials section, you will face an error message, and will not be able to proceed to installation — doublecheck all information from previous steps to troubleshoot possible errors.
After you click Run the Installation, WordPress will have more information to enter for a successful installation.
This information is not related to the information you entered in phpMyAdmin so choose your WordPress login credentials and the name of your website. As the note in the installation guide suggests: you can always change these later.
Click on Install WordPress after filling in all necessary information.
Now you will see the page with the success message for WordPress installation and the button to launch the WordPress dashboard login page.
This will take you to the end of installing WordPress on your local Windows machine.
How To Install WordPress Locally with MAMP (Mac)
When it comes to performance, hardly anyone can ignore macOS. For Mac installation, we’ll be using a program called MAMP. It works similarly to XAMPP, except that it’s simpler and has fewer customizations available. If you want to try using XAMPP instead, you can still follow the process below as the installation process is very similar between both apps.
Step 1: Download and Set Up MAMP
Similar to windows, WordPress needs a server to run locally on Mac. And, that’s where MAMP will get a local server and database ready for you.
So, go to the MAMP official website and download the setup for macOS.
After the download is finished, proceed with running the installation wizard. It may ask you to install the pro version. However, the free version is good enough for your purpose. So, click on the grey folder to begin installing the free version.
Once the installation is complete, which will look like this:
Simply open the MAMP controller and start the server.
When the server is up and running smoothly, click “Open WebStart page”. It will launch phpMyAdmin.
Step 2: Download and Install WordPress
The official website to download WordPress provides a specific setup file for Mac. You can download it from there.
When the download is finished, proceed with unzipping the file and placing the folder inside the MAMP document root folder. It is a useful idea to name the folder as the name of the WordPress site.
Now, from the MAMP control panel, create the database using phpMyAdmin. The good news is that phpMyAdmin works the same in Mac and Windows. Next, you can proceed with adding the name of the database and navigating to the wp-config.php file to add database credentials.
Now, visit the following URL to run the WordPress installation wizard.
Select the language and the rest of the steps are the same as Windows installation. Follow the steps and you are ready to use WordPress on your Mac PC.
How To Install WordPress Locally Using Local (Windows and Mac)
You have already seen methods of installing WordPress locally on Windows and Mac using XAMPP and MAMP local servers. Now it’s time for you to know about the simplest method of building a WordPress site on your local machine using “Local”. It is pretty much the same for both Windows and Mac.
Step 1: Install and Set Up Local On Your Machine
Though the local servers provide a nice dev environment, they can be a bit of a hassle. On the other hand, localwp.com is the easiest, most efficient local WordPress development tool. You can start the short and straightforward journey by installing “Local” from localwp.com according to the OS you use. You have to enter your name and email ID so that you can be contacted for future products and updates.
When the download is complete, run the installer file. Then you will be redirected to a start-up screen. Just click the “Let’s Go!” button there.
A few programs will be installed in order to run Local smoothly. You have to agree to the terms & conditions and click “Next” whenever prompted during the installation process.
When the installation is complete, you will find yourself on the Local dashboard.
LocalWP offers a wide range of choices — by selecting the cloud icon, you can connect to managed WordPress hosting services and make copies of existing sites or push local sites live.
Using the “Options” menu in the top-left corner, you can configure various settings and preferences. For now, we’ll focus on creating your first local site.
Step 2: Create Your Local WordPress Site
Now when you click “CREATE A NEW SITE” on the Local dashboard, you will be asked to set a name for your site.
Consider setting a unique and descriptive name for your site. It will help you to maintain multiple local sites in the future.
The “Advanced Options” tab allows you to set some optional settings and configurations.
This tab allows you to set a domain and path for your site. You don’t need to worry about choosing a domain name and suffix. Whatever domain name and suffix you choose, Local will modify your hosts file to make it work. Here the choice is
Though Local will automatically create a directory to store your site’s files, you can set it to your preferred folder.
When you are done with entering your site’s name, continue to the next screen.
This page provides you with two options. One is selecting Preferred to set up your local site with a recommended set of tools. Another is Custom, in which you can choose to set specific configurations for your environment.
Preferred is the better option for beginners. And, Custom is a more advanced option that is most suitable for developers, because it allows you to set more specific requirements. However, remember that choosing the Custom option will exempt you from connecting your site to Flywheel (if you want to publish it). You will need to download some additional files for that.
Whatever option you choose, now you move to the last step.
On this page, you can set a WordPress username, a strong & secure password, and an admin email address. In the “Advanced Options” tab, you can select if you want to make it a multisite setup. When you are done with entering the credentials, hit the “Add Site” button.
Within a few seconds, your site will get listed in the dashboard. You can see all of its information there.
This page confirms that your site is ready and you can click the Admin button to log into your site and work on it. Additionally, this dashboard will always allow you to make changes to your local site’s setup or domain.
Finally, your fully-featured WordPress site is now ready. It is open for doing any experiment with installing plugins, adding custom themes, breaking the site, fixing it again, etc. Conduct all your creative experiments here without any fear of hampering a live site.
After Action Report — Run WordPress Locally To Simplify Your Development Workflow
We went through the relatively simple processes of installing and running WordPress on your Windows or Mac PC. Being able to use such an amazing tool locally on your device is indeed a great opportunity for you to learn a lot.
If you followed the steps carefully, we’re certain you installed WordPress successfully on your machine. Any questions about the process? Let us know in the comments below! 💬
Categories: WordPress, Server Management
One thought on “How To Install & Run WordPress Locally on Windows or Mac”
Any plans on making a plugin for LocalWP to install local site directly to RunClound? That would make the migration much easier.