Words by Adam WardAugust 31, 2017
There are multiple tools and processes for developing locally with WordPress. In this post I will compare some of the most popular methods, what the advantages are of using virtual machines (VM’s) and our preferred setup at Atomic Smash.
In the WordPress Codex, it’s recommended to use an Apache or Nginx server running PHP version 7 or greater and either a MySQL 5.6 or greater or MariaDB 10.0 or greater database.
There are quite a few solutions out there, some more complicated than others to setup and they each have their own awesome and not so awesome features!
Before we run through a list of great tools for local development, I just want to explain or clear up any confusion you may have around Virtual Machines – if you already know, feel free to skip on!
A Virtual Machine (VM) is an isolated ‘virtual’ computer on your computer. It can run an entirely different OS if you want or replicate a server environment. You can destroy it whenever you want and configure it however you want but it this will not effect your actual computer.
Setting up a server environment on your computer can be quick and simple but very often means your local development server many differ to your production server. Essentially, your computer is not designed to be just a server, which means you shouldn’t really use it to replicate a server environment. To set up a VM on your machine, I would recommend using Virtual Box, there’s a big community of people using it’s a pretty seamless setup.
Many Developers start out using MAMP. It’s quick to setup and works very well with WordPress. MAMP allows you to use Apache or Nginx and specify what version of PHP and MySQL you want to use in your project. MAMP Pro is a premium upgrade and comes with some very useful extras such as virtual hosts, which allows you to set up multiple development urls for your projects and dynamic DNS, which enables you connect your local server to the internet and share your work on an accessible domain.
Flywheel offer a WordPress hosting and management service and ‘Local’ is their app for local WordPress development. Local is a great solution for both experienced and newbie Developers. The process from downloading the app to setting up a WordPress site took less than 10 minutes and require less configuration than MAMP. The GUI is also very slick and a real pleasure to use.
Cons (hard to find any!)
Scotch Box is a configured Vagrant box from the people at Scotch.io. Vagrant can be hard to get your head around as a less experienced Developer but Scotch Box is designed to be as easy as possible. There are a few prerequisites, you’ll need Virtual Box and Vagrant installed.
From the creators of the PHP framework, Laravel, Homestead is also a pre-packaged Vagrant box, perfect for local development. Although it was create with Laravel in mind, Homestead work’s perfectly for local WordPress development and is actually our choice at Atomic Smash.
The best guide for getting started with Homestead is over on the Laravel Site. After installation you simply map your local sites folder to a clone on the Homestead virtual machine and then you’re ready to go!
Getting a good local development workflow, that works seamlessly can be a tricky task but having a process you can rely on saves a lot of time each time you come to start on a new project. If you’re new to WordPress and setting up a local development environment, I would recommend using Local by Flywheel. I was very impressed with how quick the setup is and the fact it uses a virtual machine. If you want to improve your command line skills I would recommend using Homestead, as mentioned before, we use it at Atomic Smash and have found it to be the best and most reliable solution so far.
The list above is reflective of tools I have personally used, of course there a lot of other solutions I haven’t mentioned in this post, Varying Vagrant Vagrants (VVV) is also very popular amongst WordPress developers as is Valet by Laravel, which is another one worth exploring.