Local WordPress Development on Linux

I recently switched to a Linux laptop and have been pleasantly surprised with how well my development tools have continued to work. Linux might not be for everyone, however I do think it’s ready for a broader audience of technical folks, not just Linux enthusiasts. If you’re a WordPress developer and curious about what a web development setup on Linux looks like, then checkout out my setup. It might surprise you.

Welcome home to Linux.

Coming from Windows with WSL, moving to Linux feels great. Most of the arbitrary paths like /mnt/c/Users/austi/ were replaced with clean /home/austin/. As Jason Evangelho on the Linux For Everyone YouTube channel often says, “Welcome home”. Truly, many web development tools are at home on Linux and in fact just work out of box. Here are the apps I use every day.

This is identical to what I was using on my MacBook Pro.

Local with native terminal WP-CLI support.

Local has an option to open a shell, which opens a terminal window with all of the environment variables needed to use WP-CLI. If you want to use your native terminal, simply change the line in wp-config.php from define( 'DB_HOST', 'localhost' ); to include the socket address that is listed in Local, like this.

define( 'DB_HOST', 'localhost:/home/austin/.config/Local/run/qOuHwXSc1/mysql/mysqld.sock' );

If you don’t you’ll see an error Error establishing a database connection. as shown here.

A solid solution for WordPress development.

You can see my WordPress setup is pretty basic. If you’re already spending most of your day in the command line then I highly encourage that you to give Linux a try. An easy way to do that is to install Pop!_OS from System76 on a spare windows computer with the dual boot option.