🚀 Why this matters
Before writing a single line of code, you need a robust local environment. We will move away from XAMPP/MAMP and use industry-standard tools like LocalWP (for beginners/intermediates) and Docker (for advanced engineering).
1. Install LocalWP (Recommended)
LocalWP is the fastest way to spin up a WordPress site locally. It handles PHP versions, MySQL, and Nginx/Apache for you.
macOS & Windows Steps:
- Download LocalWP and install it.
- Open LocalWP and click the + button to create a new site.
- Choose "Create a new site" -> Continue.
- Name your site (e.g.,
wordpress-dev.local). - Choose Preferred environment (PHP 8.x, Nginx, MySQL 8.0).
- Set up your WordPress username and password.
- Click Add Site.
🎉 You now have a running WordPress site at http://wordpress-dev.local.
⚠️ Production Parity Note:
LocalWP uses MySQL by default. However, our enterprise stack (Module 4 & 5) uses PostgreSQL via the `pg4wp` driver.
For this "Crash Course" and basic theme development, MySQL is fine. But if you want strict production parity locally, you should use Docker or Lando to spin up a WordPress + PostgreSQL environment. We will cover the PostgreSQL migration in Module 4.
For this "Crash Course" and basic theme development, MySQL is fine. But if you want strict production parity locally, you should use Docker or Lando to spin up a WordPress + PostgreSQL environment. We will cover the PostgreSQL migration in Module 4.
2. Install VS Code & Extensions
Visual Studio Code is the industry standard editor.
- Download VS Code.
- Install these essential extensions:
- PHP Intelephense (Ben Mewburn) - For code completion.
- WordPress Snippets - For common WP functions.
- Prettier - For formatting CSS/JS.
3. Install Node.js & Composer
Modern WordPress development (Bedrock, Sage, Block Editor) requires these tools.
macOS (using Homebrew):
# Install Homebrew if you haven't
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
# Install Node.js (LTS)
brew install node
# Install Composer
brew install composer
Windows:
- Download and install Node.js (LTS).
- Download and install Composer Setup.exe.
- Restart your terminal (PowerShell or Git Bash).
Verify Installation:
node -v
# v18.x.x or higher
composer -v
# Composer version 2.x.x
Common Setup Issues
- Port Conflicts: If LocalWP can't start, check if Skype or another app is using port 80. LocalWP has a "Router Mode" setting to fix this.
- SSL Errors: In LocalWP, click "Trust" next to the SSL certificate to enable HTTPS locally.