Have you tried Flywheel? Learn moreJoin the best designers and creative agencies in the world. Learn more

×
How to set up a local WordPress development environment

How to set up a local WordPress development environment

When you’re building out a WordPress site, it can be tempting to start making changes whenever and wherever you want, right on the live site. One little CSS tweak to the button styles won’t hurt anything, right?

Even simple changes can be risky, however, which is why a certain golden rule of WordPress development exists: When you’re developing WordPress sites, even if you’re just making a minor code change, you should never, ever make changes directly on a live site.

Whether you’re a seasoned WordPress pro or a brand new beginner, you’ve probably heard this rule once or twice, and for good reason. One wrong line of code can bring the entire thing crashing down (queue a frustrating white screen), and then you’re stuck at square one.

That’s why it’s much smarter and safer to develop WordPress sites locally on your machine.

What is a local development environment?

The key word here is “local.” With a local development environment, you can set up a server on your own machine and store your site’s files locally, instead of externally (such as through a hosting company). This means that you can tinker with the code to your heart’s desire, because nothing is actually live – it’s just on your personal machine. A local development environment eliminates the risk of breaking a production site while giving you a super speedy way to test changes.

While a local development site isn’t actually live, it looks live in your browser. Because the files are stored locally on your machine, the browser has everything it needs to render the site, and even allow you into the WordPress admin to make changes. This also means that you don’t need WiFi to work on your site. That’s right – with a local development environment, you can work on WordPress sites anywhere, anytime, as long as you have your machine. And because the files are all stored locally, any changes you make will update instantly. There’s no need to mess with SFTP and wait for servers to communicate; it all just updates automatically, allowing you to work quickly and efficiently.

If you’re building WordPress sites, using a local development environment is a best-practice solution for developing customizations or simply testing out new themes or plugins (both of which should never be done on a production site). Now, let’s get your environment set up!

How to set up a local WordPress environment with Local by Flywheel

local-wordpress-development-environment-by-flywheel

In the past, setting up a local WordPress environment was kind of a pain, but today it’s easier than ever thanks to Local by Flywheel. It’s a fuss-free (and cost-free) local development app that will improve your workflow and make it a total breeze to develop WordPress sites from anywhere in the world. Let’s get it set up!

1. Download and install Local by Flywheel

To get started, download Local by Flywheel. There’s the free version, and if you’re interested, you can sign up for the beta version of Local Pro. It’s available for both Mac and Windows users.

Once you download the ZIP file, open it to install Local by Flywheel on your machine.

2. Set up Local by Flywheel

The first time you open Local by Flywheel, it has to do just a hair of set up to spin up the local servers.

Don’t worry, this doesn’t take too long. You’ll be up and running in no time!

3. Spin up your first site

Now the fun begins! To whip up your first local WordPress site, click the button to “Create a new site.” Then, all you need to do is choose a few settings.

local-by-flywheel-site-name

For each stage of site creation, you can choose to view the Advanced settings or just breeze through with the basics. First you’ll type a site name – you can name it whever you like!

Note: If you dig into those Advanced Option, we recommend keeping the .dev ending of the Site Domain, as it tells your computer to open that site with an internal IP address. Totally optional, though!

local-by-flywheel-environment

Next you’ll choose the environment, which includes the PHP version, Web Server, and MySQL version. If you’re a Flywheel customer (or want to be one day!) stick with the Preferred option – that’ll make migrating the local site to Flywheel super smooth. If you’re looking for some other option, go ahead and select the Custom option. This will allow you to custom build your site with whatever environment you need!

local-by-flywheel-wordpress

Last, there are a few WordPress-specific options to take care of. The basics are to set up your WordPress username and password, which you’ll use to log into the WordPress dashboard. You can also change your WordPress email, which is mostly for testing purposes, but you’re welcome to use a real email address if you’d like. (We recommend inserting a real one if you plan to take the site live!) Last, if you dive into the Advanced Options, you can choose if it’s a WordPress Multisite (and which type).

Once you’re happy with your settings, click “Create New Site.” Local by Flywheel will then spin up a separate server on your machine for your site to locally live on. This takes just a moment, as it has to configure the server and the database. Then, you’re set!

4. Start testing and experimenting

Once your site is all set up, you’ll see the site dashboard where you can make changes or experiment with your site.

local-by-flywheel-dashboard

Want to see your local WordPress site? Simply click the “View Site” button. It’ll open a new tab in your browser with your local WordPress site.

local-wordpress-development-environment-view-site

Ready to jump into the WordPress dashboard? You can either add in the good old /wp-admin onto the URL (just like any live WordPress site) or you can click the “Admin” button from the Local by Flywheel site dashboard. Then enter the same WordPress Admin Username and Password you declared during the setup process.

local-wordpress-development-environment-login

If you’re ready to do some DIY customizations in a child theme, you can easily access your local site files by clicking the arrow next to the Path Name. This will open a Finder window, allowing you to quickly navigate to whatever file you’re searching for.

And that’s it – with Local by Flywheel, it’s seriously that easy to spin up local WordPress sites and start developing!

The benefits of using Local by Flywheel for WordPress development

We’ve mentioned a few of the benefits of local WordPress development (such as a secure way to experiment with WordPress sites) but Local by Flywheel takes the brownie points a few steps further:

  • Live Links: Show off your latest work! Create shareable URLs to demo your local WordPress sites to clients, collaborators, friends, or adoring fans.
  • Hassle-free local SSL support: Any site created via Local by Flywheel will automatically have a self-signed certificate created. Green padlock achieved.
  • SSH / WP-CLI access: Local by Flywheel offers simple root SSH access to individual sites, so you can tinker around if your heart desires.
  • Flexible environment options: Hot-swap between NGINX or Apache 2.4, or switch between PHP versions. Everything will stay up and running!

We think local WordPress development is so important to a designer’s workflow, and we are so excited to present Local by Flywheel as a fuss-free way to spin up local WordPress sites quickly and easily. Our super-simple application makes spinning up local WordPress sites a breeze so you can focus on building, not fixing.

local-by-flywheel-cta

Want to learn more about Local by Flywheel? Download it for free and sign up for the beta release of Local Pro here!

25 Comments

Join the discussion

Share this article:
Get more great content in your inbox

More articles

Build WordPress sites faster. Try Flywheel free today! Try Flywheel