When you’re building out a WordPress website you’re going to have a few different options for building and deploying your website.
You can either build and make changes to your site live (not recommended), use a staging server, or setup your own local development environment.
Setting up a solid local WordPress development environment can be a crucial part of your workflow, and give you an easy and stress-free development experience. Below you’ll learn what a local development environment is, why using one is beneficial, and how to set it up yourself.
What Is a Local Development Environment?
A local development environment allows you to setup a server environment on your own machine, instead of using the server environment provided by your hosting company.
This allows you to customize your site without worry that’ll it’ll break, and make all kinds of changes, before pushing your site online. The helps to eliminate any risk when building your site and can make the development process much less stressful.
Even though you’re not working on your site live, your site will look like it’s live in your browser. Your browser will simply be referencing the files stored locally on your computer, but no one else will be able to access or view your site.
To setup a local development environment you’ll need a few additional tools. Depending on your need, you have a variety of tools available to help create your local environment, like Desktop Server, Local by Flywheel, and WP Stagecoach.
Why You Should Use a Local Development Environment
One huge advantage of developing your site locally on your computer is that you can work on your site without being connected to the internet. If you have slow wifi, or you’re traveling, you can continue to work without having to endlessly search for a wifi signal.
Your site will also be secure and free from prying eyes until you’ve actually completed the project. Plus, you won’t run into any server performance issues or spend endless time waiting for your site to refresh. The performance of your site will simply depend upon your local machine.
A local development environment will allow you to maintain high levels of security while testing your site and let you ensure there are no bugs or fixes that require your attention.
However, if you do need to show progress on a site you’re building, then you may want to opt for a staging environment, which allows you to host your site on a live server, while it’s still shielded from the general web.
This gives you more flexibility in showcasing your work, while still being able to access your site from any computer or location and improving the security.
How to Setup a Local WordPress Development Environment
If you’re sold on creating your own local WordPress development environment, then you’ll need a few tools to help you get started. There is no perfect solution for setting up your local environment, so it’s important to choose the tools that are the best fit for your needs.
The steps below will help you set up your local server environment, with the minimum amount of technical requirements possible.
1. Choose a Local Server Environment
Using the right tools will speed up the time it takes to set up your local development environment. There are numerous options to choose from, but the tools below are the easiest and most commonly used:
MAMP will give you a complete local environment for developing your WordPress site. This solution will bundle everything you need to get your server up and running together, so you don’t have to bring multiple tools together. It’s available for both Mac and Windows.
XAMPP is a great open-source tool that’ll work across Mac, Linux, and Windows machines. Plus, it’s one of the easier options to set up and use. Once you’ve installed the tool you can quickly install the WordPress software stack, which will allow you to start building your WordPress site immediately.
2. Pick a Text Editor
If you’re an experienced developer, then you probably already have a preferred text editing tool to edit your code. But, if not, then you’ll want to find a solid text editor.
A text editor that’s built for developers will help to increase your programming efficiency and avoid making errors in your work.
Some commonly used solutions that are geared towards WordPress development include:
- PhpStorm – This editor supports WordPress development right out of the box, and will atomically detect if you’re building a site in WordPress.
- Atom – This is a relatively new open source editor that easy to use, has an active community, and has a number of WordPress-specific add-ons.
- NetBeans – This is a full-function editor that’s been around since the 90s. It includes impressive features like a built-in debugger and numerous WordPress add-ons.
- Sublime Text – This editor is very lightweight, fast, and a pleasure to use, while coming equipped with WordPress development add-ons.
- Coda – This is a Mac-only editor that’s very lightweight and includes WordPress-specific plugins.
3. Select a Development-Oriented Browser
Most modern web browsers are equipped with developer tools that allow you to test and debug your site directly from the browser window. Two of the most commonly used development-oriented browsers include Chrome and Firefox.
Chrome allows you to enable developer tools right within the browser settings, while Firefox even offers its own browser built for developers called Firefox Developer Edition.
4. Install the Right Tools and Plugins
Before you start building your site you’ll want to enable WordPress debugging features. This will allow you to find any glaring errors or bugs and fix them before you push your site live.
To enable debugging you’ll need to locate your wp-config.php file and add the following piece of code (which will turn on the debugging feature):
define( 'WP_DEBUG', true ); define( 'WP_DEBUG_DISPLAY', false ); define( 'WP_DEBUG_LOG', true );
You can also install a plugin like Log Viewer, which will allow you to view and clear your debug log.
Other tools and plugins you might want to install include WP-CLI, which will streamline the development experience or Query Monitor, which acts as a comprehensive debugging plugin.
5. Start Building Your Site!
With your local development environment created, WordPress installed, and the right tools and plugins active it’s time to start building your site.
Setting up a local WordPress development environment might seem like a lot of work, but developing a site on your local machine can become a crucial part of your development workflow. It’ll not only make you more efficient, but you’ll be able to build a site without the worry that something will break.
If you’re looking for a high-performance managed WordPress host to host your site once you’ve built it in your local development environment, we hope you consider Pressable.
Zach has 12+ years of experience with WordPress, from creating and maintaining client sites, to providing support and developing documentation. A knack for problem-solving and providing solutions led Zach to pursue a job with Automattic providing customer support in 2015 working with WooCommerce support, and now Zach has recently joined our team here at Pressable. Outside of work, Zach enjoys spending time with his family, playing and watching sports, and working on projects around the house.