← Back to featured work

wp-local

A lightweight CLI for spinning up local WordPress sites — no Docker, no VMs, no overhead.

BashPHPWordPressCLI

wp-local came from a need for speed and simplicity when setting up local WordPress environments. Instead of Docker or heavy VMs, it leverages PHP's built-in web server and a local MySQL instance to create fresh installations in seconds.

I built it as a shell-based utility that automates the boring parts of local setup: downloading WP, creating databases, configuring wp-config.php, and setting up a unified router. It also provides advanced features like WP-CLI passthrough and one-click auto-login, all managed from a single command.

bash
# Install wp-local
$ curl -fsSL https://raw.githubusercontent.com/NaveenKharwar/wp-local/main/install.sh | bash
✔ Installation complete!

# Create a new site
$ wp-local new
Enter Site Name: myproject
Admin Username: admin
Admin Password: ••••••••
→ Setting up WordPress files...
→ Provisioning database...
✔ WordPress is ready!
[url] http://127.0.0.1:9000/myproject
[login] http://127.0.0.1:9000/myproject/?auto_login=xK9mPqR3...

# Start the server
$ wp-local start
Server running on http://127.0.0.1:9000

# Install a plugin via WP-CLI
$ wp-local wp myproject plugin install woocommerce --activate
✔ Plugin installed and activated.

Challenge

Local WordPress development often requires Docker or local server stacks, which can be resource-heavy or slow to start. The challenge was to build something zero-dependency that still feels like a modern developer tool, handling things like database generation and routing smoothly.

Approach

I chose Bash for the core implementation to ensure portability and zero startup time. I implemented a custom PHP router to handle path-based multisite routing on a single server instance. For the user experience, I focused on a simple command structure and automated environment checks to make setup frictionless. I also used Claude in a few places to help decide on better architectural patterns and UX details.

Highlights

  • Spins up fresh WordPress sites in seconds using PHP's built-in server.
  • Unified router allows running multiple sites on a single port via URL paths.
  • Built-in WP-CLI passthrough for remote management without directory switching.
  • One-click auto-login URLs for instant access to the WordPress admin.

Outcome

wp-local provides a middle ground between manual setup and heavy containers. It's the fastest way to spin up a quick test site, demo a feature, or work on a lightweight plugin without the overhead of Docker.