Local Lightning for WordPress Development

When it comes to local WordPress development, I’ve been split between two different tools: Laravel Valet and Local by Flywheel. Valet is really fast, however Local just works. Well, meet Local Lightning. It’s a completely remade version of Local by Flywheel which runs super fast and just works.

Goodbye virtualization, hello native software

Local by Flywheel was slow due it’s reliance on virtualization. In fact, all of my complaints using Local came back to this one fact. Well, not anymore. The new Local Lightning is built using native software packages. This means no more virtual machine getting in the way. This results in massive performance improvements.

It’s in beta yet stable enough to start using

I believe the beta status is primarily due to the fact that there is no upgrade path from Local by Flywheel to Local Lightning. That means you have to manually export and import each WordPress site between the 2 versions of Local.

Workaround fix for WP-CLI

I’m a heavy WP-CLI user. With the old version of Local it wasn’t possible to use WP-CLI directly. Instead it needed to be used within Local’s custom SSH wrapper which was annoying. With the new version, it’s totally possible to use WP-CLI directly from the regular command line.

That said I did initially run into a roadblock where WP-CLI commands resulted with: Error: Error establishing a database connection.. I suspect this maybe a bug. I was able to workaround it by adjusting DB_HOST within wp-config.php from localhost to The ending port number is randomly generated by local. Refer to the database tab for each site’s settings.

Back using Local, no more tweaking Valet with WSL.

This post originally started out as few suggestions for modifying Nginx for Valet with WSL. However after using Local Lightning for the past few weeks I decided to just scrap Valet for local development. Valet is pretty amazing however its intended focus is for Laravel not WordPress. Local Lightning is just focused on WordPress and is easy enough that anyone can start using it immediately.