XAMPP is a simple solution to install WordPress on localhost with Apache, PHP, and MySQL already integrated. If you want to set up a WordPress website on Windows for development and testing purposes, XAMPP will help you do that quickly and easily.
Step 1. Download and setup install Xampp
Visit the XAMPP home page and select the version compatible with your computer. Be sure to choose the correct Xampp (PHP) version based on the requirements for setting up WordPress.
Once you have completed the download, launch the file “xampp-windows-x64-xx.exe” and proceed by clicking “Next” until you reach the “Finish” button.
During the installation process, you have the option to deselect certain features such as Filezilla, Mercury Mail Server, Tomcat, Perl, and Webalizer if you do not plan on utilizing them.
Note: By default, XAMPP will be installed on your C
drive, but you can choose a different partition during setup. In this case, I opted to install XAMPP on the F
drive.
Step 2. Start xampp and create a database
Launch XAMPP, start the Apache and MySQL services, and then enter “127.0.0.1/phpmyadmin” into your web browser.
Click New and create a new database.
Step 3. Download WordPress source code
Visit the official wordpress.org website to download the latest WordPress release zip file. After extracting the zip, you’ll have a folder containing the WordPress source code. Copy this extracted “wordpress” folder into the “htdocs” directory of your XAMPP installation, typically located at C:\xampp\htdocs
.
Step 4. Configure domain on Xampp localhost
While you can start the WordPress installation process by accessing the web interface at “127.0.0.1/wordpress”, for a better experience, it’s recommended to set up a virtual host or local domain. This makes installing WordPress on XAMPP easier and more professional.
Now, open and edit the file “C:\XAMPP\apache\conf\httpd.conf“, and add the following content to the bottom.
<VirtualHost *:80> ServerName arriveddev.com ServerAlias arriveddev.com DocumentRoot "C:/xampp/htdocs/wordpress" </VirtualHost>
You can manually set up a domain name (fake domain) to run your WordPress website by specifying the ServerName and ServerAlias, while also defining the DocumentRoot to point to the directory containing the WordPress source code.
Next, open and edit the file located at “C:\Windows\System32\drivers\etc\hosts” and add the following information to the end. The domain “arriveddev.com” should match the one specified in the “httpd.conf” file.
127.0.0.1 arriveddev.com
To facilitate the installation process for WordPress on localhost, you can adjust the essential read/write/edit permissions for the host file by either directly editing it or by copying it to the desktop and then pasting it into the “C:\Windows\System32\drivers\etc” directory. As demonstrated below, I’ve included the necessary write permission to the file
Step 5. Install Wordpress on XAMPP
To continue, reopen Xampp, restart Apache, and navigate to the URL “arriveddev.com” using your web browser. Then, initiate the process of establishing the initial database for your website.
- The database name is the name created in step 3
- The username here is User Mysql, on localhost just leave it as the root
- Password is blank
- Database Host: Localhost
- The prefix should be left as the default
Next enter all the information and install Wordpress on Xampp.
In there:
- Website Name: Is your website title or tagline
- Username: Is the name to log in to the admin page /wp-admin
After installation is complete, you can log in to the admin with the created user/pass and through this post, I have a website:
- Admin URL: https://arriveddev.com/wp-admin/
- Frontend page URL: https://arriveddev.com/
To sum up, these straightforward instructions provide a clear path for setting up WordPress on your local machine using XAMPP on Windows 10/11. This enables you to experiment, develop, and test websites locally before making them live, ensuring a smooth and efficient workflow.