Sometimes it can be more convenient to work with WordPress on your local machine. However, if youâ€™re unfamiliar with how to install WordPress locally, you might be wondering whether itâ€™s something you can manage on your own.
The good news is that installing WordPress locally can be done in a few simple steps. Whether you want to test out new features, experiment with development projects, or build a WordPress site before pushing it live, a local WordPress install can help you do that.
Letâ€™s get started!
An Introduction to Installing WordPress Locally
Here at Kinsta, we have a staging environmentÂ that allows for easy development and testing. However, installing WordPress locally also has some advantages. For example, perhaps youâ€™re traveling and donâ€™t have access to Wi-Fi. If thatâ€™s the case, you may require a local install to continue working.
Additionally, when it comes to manipulating files and local editing, a local install can sometimes be faster. There is usually less setup involved to get it up and running.
When you want to install WordPress locally, you need to get a local AMP stack set up on your machine. In the case of WordPress, AMP stands for Apache, MySQL, PHP. These are the software needed to mimic what a managed WordPress hostÂ would be running for you on its web server.
There are a variety of methods you can use to do this. The most common options include WAMP, XAMPP, and MAMP. These are great tools and weâ€™ll walk you through each one.
However, they are designed to work with a variety of other software and tools and can have a bit of a learning curve. Therefore, weâ€™ll start by introducing you to DesktopServer, which was actually designed and optimized specifically for WordPress as a local AMP stack.
How to Install WordPress Locally With DesktopServer
DesktopServer is a great WordPress product by ServerPress, which can make installing WordPress locally a complete breeze:
ServerPress has both a free version and a premium version, the latter costing $99.95 per year. The premium version includes a few advanced capabilities, such as:
- Multisite support
- Importing and exporting third-party backups
- Deploying directly to your live site
- Bypassing any login plugins
You can choose which version fits you best depending on your needs. If you just need to do some quick testing, the free version works well.
Step 1: Download DesktopServer to Your Computer
To install WordPress locally, you will first need to download DesktopServerÂ from its website. There is both a Windows version and a Mac version. For this example, we will be using the Windows version.
On the website, click the Free DownloadÂ button in the top right-hand corner (or Buy PremiumÂ if thatâ€™s what you prefer):
This will automatically begin downloading the .zipÂ file to your computer.
Step 2: Launch the DesktopServer Installer
Once the file is done downloading, the next step is to launch the DesktopServerÂ installer. Before you do that, unzip the file you just downloaded. This may take a few minutes to complete.
Once thatâ€™s finished, click on Install DSL:
When you first launch the program, you will be prompted to restart with administrator privileges. Select Continue. Youâ€™ll then be prompted to accept the terms of services, and choose an option for your installation:
Leave New Desktop InstallationÂ selected, then click on Continue. The installation process will begin, which can take a bit of time.
When itâ€™s finished, it will present a popup letting you know that itâ€™s complete. It also tells you where in your computer directory you can find the application. When youâ€™re done, click on Finish.
Step 3: Enable Plugins and Start Apache and MySQL Services
Once the installation is complete, you can enable a multitude of different developer plugins:
Hereâ€™s a quick rundown of the developer plugins you can use when you install WordPress locally. We highly recommend the bypass login and DS-CLI plugins.
- Airplane mode:Â Control loading of external files when developing locally.
- Bypass login:Â Allows developer bypass of login credentials, via quick selection of any of the first 100 usernames in a combobox.
- Clean Import:Â Resets .htaccess, clears cache from third-party hosts
- Dreamweaver Support:Â Enables automatic Dreamweaver project file creation, and a WYSIWYG mode when working on template files and style.css.
- DS-CLI: This is an enhanced, cross-platform, command-line interface for professional developers. It lets you easily use CLI, Composer, Git, and PHPUnit. NodeJS and NPM are included to allow installation of GRUNT, Gulp, and other Node dependencies.
- DS-Deploy:Â Used to move a site from a local DesktopServer install to a live server.
- InnoDB Autoconvert:Â Convert a siteâ€™s tables to InnoDBÂ on Create, Copy, Move, and Import operations.
- Local Admin Color Bar:Â Changes the Admin bar color.
- Mailbox Viewer:Â Provides quick developer offline viewing of mail delivery services.
Keep in mind that some of these options are only available with the premium version. When youâ€™re done, select Next. Youâ€™ll then be asked if you want to start web and database services, so hit Next again.
Step 4: Create a New Development Site
When youâ€™re done enabling plugins and starting the web and database services, the next prompt will be to select Create a new development website:
This is where the program will install WordPress for you. Youâ€™ll have to pick your siteâ€™s name, which will also be its local address. We are calling ours â€œtestsiteâ€, so our development URL will be â€œtestsite.devâ€ on our local machine:
DesktopServer enables you to actually create different blueprints, making it almost like a pre-built template. In our case, however, we simply want a fresh install.
DesktopServer always has the latest version of WordPress as the default blueprint. This means you donâ€™t have to worry about manually downloading it from the repository and unzipping it.
By default, the siteâ€™s root is located in your My DocumentsÂ folder. If youâ€™re happy with this, you can leave it as is. However, for ease of organization, we changed ours to a folder we created in the root of our C: drive called â€œwordpressâ€.
When you are ready, click on Create. Youâ€™ll then see the URL of your local WordPress install. Click on that to finish up the installation.
Step 5: Install and Configure Your WordPress Site
When you click on the link we just mentioned, your local WordPress site will open in a browser tab:
After you choose your language, the next step is to give your site a title and choose a username (if you plan to make the site live later, donâ€™t use â€œadminâ€ as a username, which you can read more about in our WordPress security guide), a strong password, and your email address:
When youâ€™re done, select Install WordPress. Thatâ€™s it! You just installed WordPress locally and your site is up and running. You can now browse to your local install and test away.
In our case, weâ€™ll go to â€œtestsite.devâ€ in our browserâ€™s address bar. Since we selected the bypass login plugin feature during setup, there is a dropdown menu where we can select our admin and be automatically logged in. Obviously you wonâ€™t use this on a production site, but itâ€™s super handy for a dev environment.
Additional Tips for Using DesktopServer to Install WordPress Locally
To fix, this simply open up the command prompt as an administrator and run the following command within your WordPress directory folder:
attrib -s *.*
If you need more guidance or instruction on how to do this, you can learn more about the details on ServerPress.
To create additional WordPress sites or edit them, simply launch the DesktopServer.exeÂ file again. You can stop and restart services, create new sites, edit them, export and import them, etc. To access phpMyAdmin, you can click on the SitesÂ button on the bottom left:
Alternatively, you can enter â€œlocalhostâ€ into your browserâ€™s address bar. This will bring up the administrator interface on the localhost:
There, you can get the links to all of your WordPress sites, as well as dashboard links and phpMyAdmin links.
Another awesome feature is the ability to launch WP-CLIÂ (or DS-CLI) with a single click. If you selected the DS-CLI option during the setup process above, there will be a link for it within your dashboard. Simply click on it, and you can start firing up WP-CLI commands.
DesktopServer also includes an export feature, which allows you to export your WordPress site directly to a live site or .zipÂ file. Note that you will need the premium version for this.
How to Install WordPress Locally on Windows Using WAMP
If you want to install WordPress locally on a Windows computer, you can also do so with WampServer, also known as WAMP. WAMP is a software that bundles Apache web server, PHP, and MySQL specifically for Windows devices. Letâ€™s take a look at how to use it to install WordPress locally.
Step 1: Download and Install WAMP on Your Computer
The first step is to download and install the WAMP software to your computer. You can do this by visiting the WampServer websiteÂ and selecting Start Using WampServer:
This will automatically bring you to the downloads section of the site, where you will have two versions to choose from: WampServer 32 bit and WampServer 64 bit. Select the one that is recommended for your operating system.
If youâ€™re unsure whether your OS is 32 bit or 64 bit, you can discover this information by navigating toÂ Settings > About:
Under the Device specifications section, you will be able to find out your OS type.
Step 2: Run the Wampserver.exe File to Start the Installation
After you download the software, click on the wampserver.exeÂ file to run the installer. This may take a minute or two.
Also, make note of where this file downloaded to, as youâ€™ll need to revisit it later:
Youâ€™ll be prompted with a series of instructions on the screen to complete the installation process.
During this process, youâ€™ll be asked to define a web browser. You can always change this option to a browser you prefer by navigating to the Program FilesÂ of your computer.
Step 3: Create a New MySQL Database
The next step is to set up a blank MySQL database. After you launch WAMP, there will be a green icon in the bottom right-hand corner of your screen.
Click on the icon, followed by phpMyAdmin. This will automatically bring you to the login screen in your browser:
In the username field, input â€œrootâ€, leave the password field empty and then select the GoÂ button. Next, click on Databases:
Under the Create Databases section, you will need to name your new database. Next, click on Create. Thatâ€™s it. You now have your database set up.
Step 4: Install WordPress and Extract the Files
Once youâ€™re done creating your database, the next step is to install WordPress locally. To do this, visit WordPress.orgÂ and click on Get WordPress, followed by Download WordPress:
This will download a .zip file to your computer. The next step is to extract the files. Click on the folder, and select Extract All.
When thatâ€™s done, right-click on the folder and select Copy. Navigate back to the folder on your computer where you downloaded WAMP and paste the â€œwordpressâ€ folder into that directory.
At this point, you can also rename the â€œwordpressâ€ folder if you wish. The name of the folder will be the URL for your local WordPress install. For this tutorial, weâ€™ll rename ours to â€œmytestsiteâ€.
Step 5: Visit Your Local WordPress Site in Your Web Browser
Open your web browser and type into the search bar â€œhttp://localhost/mytestsite/â€. Of course, replace â€œmytestsiteâ€ with whatever you named your â€œwordpressâ€ folder.
The software will then present a series of prompts for you to set up your WordPress installation. Youâ€™ll select a language and review the database information (the same series of steps we discussed in the previous section). When youâ€™re done, click on Letâ€™s go!:
On the next screen, youâ€™ll enter your database information. The name will be what you called your database, the username is â€œrootâ€, and you can leave the password field empty.
Next, click on the Run the installationÂ button. Then you can name your site and create a username and password. When youâ€™re finished, selectÂ Install WordPress. When the software is done installing, it will show you a Success! message.
After that, you can click on Log In. This will bring you to the admin login page for your WordPress site.
Thatâ€™s it! You now have a local testing environment installed.
How to Install WordPress Locally on Mac Using MAMP
If youâ€™re looking for local server software to use for a Mac computer, you might consider MAMP. MAMP is short for Macintosh, Apache, MySQL, and PHP. Itâ€™s incredibly user-friendly and easy to use.
Step 1: Download and Install MAMP on Your Computer
As with the two previous sections, the first step is to download and install MAMP on your computer. You can do this from the official MAMP website:
Note that while you can download and use MAMP for free, there are also premium plansÂ available.
Step 2: Launch MAMP and Start Your Servers
Once itâ€™s done downloading, click on the mamp.pkgÂ file. An installation window will pop up. Select the Continue button to follow the series of prompts:
Next, navigate to Go > Applications on your computer and click on the MAMP folder:
Need a blazing-fast, secure, and developer-friendly hosting for your client sites? Kinsta is built with WordPress developers in mind and provides plenty of tools and a powerful dashboard. Check out our plans
Inside that folder, click on the MAMP elephant icon:
This will open a new window. Hit Start Servers:
Once the Apache and MySQL servers launch, MAMP will automatically open the WebStart page in your browser.
Step 3: Create Your Database and Update Your User Information
Now itâ€™s time to create a new database. On the WebStart page, select Tools > phpMyAdmin:
Once phpMyAdmin opens, click on theÂ Databases tab. Name your database, and then select Create:
Next, youâ€™ll need to update the MySQL database user credentials for the default account MAMP creates for you, as youâ€™ll need them to complete the WordPress installation process. Navigate back to the phpMyAdmin home screen, and click on the User AccountsÂ tab.
Then, click on Edit privilegesÂ for the account with the username mamp:
Select the Change passwordÂ tab, enter your preferred password, and hit Go:
You can then close phpMyAdmin.
Step 4: Install WordPress and Visit Your Site from Localhost
Now, visit the WordPress.org websiteÂ and download the latest version of WordPress. Then unzip the â€˜wordpressâ€™ folder once itâ€™s finished downloading. Right-click on the folder and select Copy.
Navigate back to Go > Applications > MAMPÂ on your computer, and open theÂ htdocsÂ folder:
Inside that folder, paste your WordPress folder that you just copied. We suggest renaming it to â€œmytestsiteâ€ or something similar:
Then, browse to â€œhttp://localhost/8888/mytestsiteâ€ in a new tab. It will prompt you to input your database credentials, as well as name your site:
Once you complete the WordPress installation prompts, youâ€™re all done! If you need more instructions on this step, you can refer to the previous section in this post.
How to Install WordPress Locally Using XAMPP
XAMPPÂ is another popular PHP development environment you can use to install WordPress locally. You can use it for Windows, macOS, or Linux. Here, weâ€™ll walk you through how to do it for Windows, although the process is largely the same for Mac users.
Step 1: Download and Install XAMPP on Your Computer
Visit the Apache FriendsÂ website, and next to the green Download button, select XAMPP for WindowsÂ (or whichever OS youâ€™re using):
The software will automatically download to your computer. When itâ€™s finished, click on the .exe file to launch the installer.
Note that for macOS, this will be aÂ .dmg file. Once you open it, click on the XAMPP icon and drag it to your Applications folder.
Step 2: Choose the Components You Want to Install
After running the installer, youâ€™ll be asked to choose the components to install. The most important ones to select are Apache, MySQL, PHP, andÂ phpMyAdmin:
You can uncheck the other components, as they are not necessary. When youâ€™re done, click on the NextÂ button and select which folder you want to install XAMPP on.
Click on the Next button again, ignore the Bitnami prompt, and select Next once again.
Step 3: Launch the XAMPP Control Panel and Test Your Server
On the final screen, choose to launch the XAMPP Control Panel. In the XAMPP Control Panel that opens, you can click the Start buttons next to both ApacheÂ and MySQL:
After you launch them, the status should turn to green. Now itâ€™s time to test your server. You can do this by entering â€œhttp://localhost/â€Â into your web browser. If it works, you have successfully added XAMPP to your computer.
Step 4: Download WordPress and Create a Database
The next step is to install WordPress on your computer. You can do this by going to WordPress.orgÂ and clicking onÂ Get WordPress.
When the package is finished downloading, extract the files, and then copy the folder. Next, navigate to the XAMPP folder on your computer, and locate and open the htdocs folder.
Next, create a new folder within the htdocsÂ folder. You can name it something along the lines of â€œmytestsiteâ€. Within that folder, paste the WordPress files.
Now itâ€™s time to create your database.
Navigate back to your XAMPP control panel and select AdminÂ next to MySQL. This will launch phpMyAdmin.
Click on Databases, then name your database and select CreateÂ (you can refer to previous sections if you need more guidance).
You can name your database whatever you want. However, we suggest keeping it simple and memorable, such as â€œtest_dbâ€.
Step 5: Install WordPress Locally By Visiting Your Site in Your Browser
To complete the process, you can visit â€œhttp://localhost/mytestsiteâ€Â in your browser. Remember to replace â€œmytestsiteâ€ with whatever you named your WordPress folder.
Youâ€™ll be prompted to select a language, name your site, and fill in your database details. Then you can log into your WordPress site and start using your local environment!
By setting up a WordPress local environment, you can test new features and develop your WordPress sites fully before taking them live. In fact, there are a variety of methods you can use to install WordPress locally on your computer.
In this article, we explained how you can do this on both Mac and Windows via a local server environment software DesktopServer, WAMP, MAMP, or XAMPP). Although the specific instructions vary depending on which tool you use, the process can be summarized in five main steps: