Installing WordPress Locally
· 2 min read
Setting up WordPress on a local machine allows you to test and develop in a private environment before going live. Here’s a step-by-step guide.
Prerequisites
- Download XAMPP or MAMP:
- Download WordPress:
Go to wordpress.org and download the latest version.
Step 1: Install XAMPP or MAMP
- Run the installer and follow the prompts to install.
- Start the Apache and MySQL services from the XAMPP/MAMP control panel.
Step 2: Create a Local Database
- Open a browser and go to http://localhost/phpmyadmin.
- Click on Databases.
- Enter a database name (e.g.,
wordpress_db
) and click Create.
Step 3: Setup WordPress Files
- Unzip the WordPress download.
- Move the WordPress folder to:
- For XAMPP:
C:/xampp/htdocs/wordpress
- For MAMP:
/Applications/MAMP/htdocs/wordpress
- For XAMPP:
Step 4: Configure WordPress
- Open
http://localhost/wordpress
in your browser. - Select your language and proceed.
- Fill out the database details:
- Database Name: The name you created (e.g.,
wordpress_db
) - Username:
root
- Password: (Leave blank for XAMPP, use
root
for MAMP) - Database Host:
localhost
- Database Name: The name you created (e.g.,
- Click Submit and then Run the installation.
Step 5: Complete the Installation
- Enter your Site Title, Username, Password, and Email.
- Click Install WordPress.
Step 6: Access Your Local Site
To view your site, open http://localhost/wordpress
in a browser. For admin access, go to http://localhost/wordpress/wp-admin
.
Troubleshooting Tips
- If XAMPP/MAMP doesn’t start, make sure no other programs are using port 80 (Apache) or port 3306 (MySQL).
- If you encounter a blank screen, try renaming the
wp-config-sample.php
file towp-config.php
and manually enter your database details.