Running WordPress on your local machine can be a great idea if you want to learn it for free. XAMPP is a great tool for this particular need. In this post, I will show you how to install and run WordPress on your local machine (localhost) using XAMPP.
Before I continue, I want to let you know in advance that the WordPress development team already offers a free resource — WordPress Playground — that you can leverage to try WordPress.
You can even install plugins and themes in WordPress Playground (you can allow WordPress Playground to access your network via the settings panel to be able to install plugins and themes).
Still, running WordPress on your own platform is a better idea to learn WordPress to the fullest since you have absolute control over everything.
So, if you still want to install WordPress on your local machine, then read on.
Shortcuts โคต๏ธ
What is XAMPP?
XAMPP is a web development tool that allows you to run a web-based app or website on your local machine.
With this tool, you can have a web server and database server on your local machine.
XAMPP itself consists of Apache (web server), MariDB (database server), PHP (programming language) and Perl (Programming language).
That is why the app is called XAMPP.
The “X” letter on “XAMPP” represents the platforms it supports (Windows, macOS and Linux).
How to Install XAMPP
As mentioned above, XAMPP is available for Windows, macOS and Linux. You can download XAMPP on its official website.
Make sure to download the installation file according to the platform you use.

In this post, I will show you how to install XAMPP on macOS.
๐ก If you are a Windows user, you might need to disable Internet Information Services (IIS) to run XAMPP to avoid web server conflict.
Installing XAMPP on macOS
First thing first, you can download the installation file of XAMPP (the DMG file). Once downloaded, double-click the file.

A new window will show up after you double-click the DMG file of XAMPP. Double-click on the icon to run the installer.

In many cases, Mac users will see the following error message after double-clicking the installer icon.

To fix the above error, you can open System Settings and go to Privacy & Security. Scroll down to the Security section to find the blocked app (XAMPP installer). Click the Open Anyway button.

You will be asked to enter your Mac password after clicking the above button. Simply enter your password and click the OK button to continue.

Click the Next button on the XAMPP installer to continue the installation process.

On the next step, you will be asked to select the components you want to include on the installation. Simply click the Next button.

Confirm the installation by clicking another Next button.

Once the installation process is done, you can click the Finish button.

How to Run XAMPP
If you keep the Launch XAPP option checked when clicking the Finish button above, XAMPP will automatically run on your machine. However, the only app that runs is Apache by default.
To run MariaDB, you need to do it manually.
XAMPP comes with a handy app to run and stop Apache and MariaDB. To access the app, open Launchpad and click the XAMPP group. You can find the app from this group.

You will be asked to enter your Mac password every time you launch the app.
On the XAMPP app, you can go to the Manager Servers tab. Simply select the server app you want to stop/run and use the available buttons.

To check whether or not XAMPP is really running on your machine, you can open a web browser (Google Chrome, Firefox, Safari, etc.) and type localhost
on the address bar.
If you see the following page, then XAMPP is really running on your machine and you can proceed with the next steps to install WordPress.

Installing WordPress on Localhost with XAMPP
Once your XAMPP is ready, you can start to install WordPress. Before you start the installation process, make sure to run the web server (Apache) and database server (MariaDB).

A little information regarding the database. WordPress supports both MySQL and MariaDB.
MariaDB is a fork of MySQL which is developed and maintained by the original developers of MySQL.
Meanwhile, MySQL is currently owned and maintained by Oracle.
XAMPP was previously using MySQL as the database server before MariaDB existed. That’s why you will see the label of “MySQL Database” instead of “MariaDB Database” on the app manager above.
The actual database server that runs on your machine is MariaDB, not MySQL.

Step 1: Download WordPress
Once the web server and database server are ready, the next thing you need to do is to download WordPress.
You can download the latest version of WordPress on its official website. Hit the Download button to download the ZIP file of WordPress.

Step 2: Prepare the Database
Once the ZIP file of WordPress is downloaded, the next step is to prepare the database. You need a database for every website you want to create with WordPress.
Regarding the database itself, there are four items you need to prepare:
- Database name
- Database username
- Database password
- Database host
If you are a Windows user, you might be asked to set a database username and password during the XAMPP installation process.
XAMPP doesn’t ask Mac users to set the database and username password. So, how to figure them out?
Open the XAMPP app manager. Select the database server (MySQL) and click the Configure button.

A new window will show up after you click the above Configure button. Click the Open Conf File button to open the database configuration file.

Confirm you want to manually edit the configuration file by clicking the Yes button on the appearing dialog and you should be presented with the configuration file of the database server.
Here, you can find the database username and password. If you want it, you can replace the default username and password with your own preference.

Creating a New Database
You already know the username and password of your database. Next, you need to create a new database which you can use on the installation process of WordPress later on.
To do so, open a web browser and type localhost/phpmyadmin
on the address bar and you will be presented with the PhpMyAdmin dashboard.
To create a new database, first, click the Databases menu on the menu bar. Enter your database name and click the Create button.

๐ก Use lowercase for database name. Use underscore to add space.
You don’t need to add any table to your database since you want to use it to install WordPress.
WordPress will populate your database with its tables during the installation process.
So, your database is now ready. From what you have done above, should get the following details:
- Database username: mysql (unless you replace it)
- Database password: your_password (unless you replace it)
- Database host: localhost
- Database name: your defined database
Step 3: Start the Installation
Now, it’s the time to start the actual installation process.
First, go to the XAMPP folder. Here are the paths on each platform:
- macOS: /Applications/XAMPP
- Windows: C:\XAMPP
- Linux: /opt/lampp/etc/httpd
On the XAMPP folder, you will find a folder called htdocs. Get in to this folder and paste the ZIP file of WordPress. Unzip it here.

Open your web browser and type localhost/wordpress
on the address bar. You should see the following page. Click the Let’s go! button to continue.

Enter the database details according to what you have set earlier above. On the Table Prefix field, you can leave it default. Click on the Submit button to continue.

On the next step, click the Run the installation button.

Give your site a title and set a username, password and email for your website. Since you want to run your website locally, you can ignore the last option (search engine visibility).
Click the Install WordPress button to continue.

You are all set.
Click the Login In link on the next page to login to the WordPress dashboard. You can use the username and password you have just specified above to login to your WordPress dashboard.

๐ก You can type localhost/wordpress/wp-admin
on the browser address bar to login to your WordPress dashboard.
Summary
If you want to learn web development with WordPress, then starting from the local environment can be a smart idea as you don’t need to spend money on domain and hosting.
Although WordPress already provides WordPress Playground, a platform where you can try WordPress instantly, running WordPress on localhost allows you to learn WordPress to the fullest as you can access files, make some configurations and so on.
I also used this path the early days I learned WordPress.
When you are ready, you can build a real, live WordPress website on a web hosting of your choice.
By the way, I have curated some of the best web hosting services to run WordPress.
Some Questions Related to Running WordPress Locally
There are at least two common questions regarding running WordPress on localhost. The first one is about plugin and theme installation.
And the second one is related to the XAMPP alternative.
Can I Install Plugins and Themes when I Run WordPress Locally?
Yes. You can. As long as your computer is connected to the internet, you can install both plugins and themes available on the WordPress repository. You can also run them smoothly without any issue.
If, for a certain reason, you can’t install a plugin or theme, you can install it manually. To do so, download the ZIP file of the plugin/theme you want to install. Unzip it and then copy and paste the unzipped folder to the following folders:
- For plugin: wp-content/plugins
- For theme: wp-content/themes

Once the folder of the plugin/theme you want to install is in place, you can then activate the plugin or theme from the WordPress dashboard.
To activate a plugin, you can go to Plugins -> Installed Plugins. While to activate a theme, you can go to Appearance -> Themes.
Is There an Alternative to XAMPP to Run WordPress Locally?
There are some local development tools you can use to run WordPress on localhost.
If you are a Mac user, I even recommend you to not use XAMPP as it is not stable enough. Instead, I recommend you use MAMP.
Same as XAMPP, MAMP can also be used for free. MAMP also consists of Apache, MySQL and PHP.
Apart from macOS, MAMP is also available for Windows.
If you are a Linux user, I recommend you install Apache and MySQL manually instead of using XAMPP.
Here are some XAMPP alternatives you can use to install and run WordPress on localhost:
- MAMP (macOS and Window)
- WampServer (Windows)
- EasyPHP (Windows)
Whichever the tool you use, don’t forget to have fun with WordPress.
And whenever you are ready, you can start your live WordPress blog and make money sharing your knowledge.