Developing your WordPress site in a local environment before creating a live site is a good practice for web developers. Local by Flywheel is a great tool for a local WordPress development, especially for WordPress beginners. In this article, I will share how to create a local WordPress development site, step by step.
Benefits Of Local WordPress Development
Developing websites locally is extremely useful for many reasons.
- You can have it as a staging environment to build your site locally before moving it to a live server. Making changes every time directly in the live server can sometimes break your site and cause issues. So building it first in the local server and then moving it to live would be of great benefit for both you and your users.
- Being a WordPress developer, a local development environment is extremely helpful for us to test our themes and plugins before releasing a new version. It would be useful for you too.
- It also helps us in Troubleshooting when we receive an issue or bug from our customers.
- Internet connection is another lifesaver in having a local development environment. Since you can work on it without being connected to the computer, you can keep working even when your internet connection is lost.
LOCAL BY FLYWHEEL:
Local by Flywheel is one such development environment developed explicitly for WordPress.
Though there are many other popular tools like MAMP, WAMP, XAMPP, Local by Flywheel has many advantages compared to them.
Having used MAMP, XAMPP and Local by Flywheel for more than 3 years, I can assure you that Flywheel is way better and easier compared to them.
ADVANTAGES OF LOCAL BY FLYWHEEL OVER MAMP/XAMPP:
- Setup: You can setup up a website is using flywheel in just a few clicks while it takes many processes in XAMPP like downloading WordPress, editing the config.php file, copying the WordPress file to htdocs, etc.. Local by Flywheel does all this heavy lifting for you and gives you the site ready in just a few clicks.
- Livelinks: You can give the livelinks of your site to the clients that they can view your site as you are developing it, that they can give feedback on your local server which is pretty awesome. This is not possible using XAMPP or MAMP.
- Blueprints: You can set up blueprints that will save much of your time if you are typically building a site with the same basic setup.
- It offers a variety of server environments you can choose while creating your site.
- Local by Flywheel allows you to test your sites locally with SSL without the hassle.
- Setting up multiple WordPress websites is just a click away.
Installing Local by Flywheel:
Local by Flywheel is available for both Windows and Mac, and free for download. The current version is 5.2.1. (Jan 2020).
You can download it for free here.
You would be asked for a few details to download it. Once downloaded, you could start the set-up.
The setup will include installing the Virtual Box, Host Machine and Local Image. Just select the “Let’s Go” button and they will install all of this in a few mins.
When done, Local by Flywheel is now ready for you to create a new site.
Creating a New Site:
Before creating a new site you can set preferences for your sites. These preferences would be used anytime a new website is created through this program. You could find the preferences in the top menu option provided by Local by Flywheel.
In these preferences, you can set a default environment, admin username, password, domain suffix, sites path, and much more advanced options. Having set the preferences for your site, let’s dive into creating a new site.
Steps to be followed in creating a new site:
Setting up a new site involves three steps in Local by Flywheel.
- Create a new site by clicking on the “Create a new site” button.
- Provide a name for your site. You could set the local site domain, Local site path from the advanced option.
- If you are going to create a site from the blueprint, select the blueprint or leave it to “Don’t use a blueprint” option.
- Once done, click continues and it will take you to choose your server environment.
- You can either use their preferred option which usually mirrors their own web hosting or you can choose your custom setup.
- In custom setup, you will be able to choose which versions of PHP and MySQL to use on your site, as well as the type of server. We recommend using the latest versions of the tools in question, along with whichever web server you prefer.
- Once done, you would be asked to provide a WordPress username, password, and email. If you have already set this in the preferences area, those details would appear automatically.
- If you are creating a multisite, select the advanced options and give ‘Yes’ to the WordPress multisite. You can also choose whether it is a sub-directory or subdomain.
- Once done, click the “Add Site”. The installation will happen in few mins and yes, your site is up and running now. Hurrah!
Site Setup view:
The first thing that you would see after creating the site is your site setup view.
From here, you can start or stop your site (you can see this option in the top-right), can view the site, can log in to your admin dashboard and much more.
So what’s next? Let’s look at some more features of Local by Flywheel.
Local by Flywheel enables you to save any of your WordPress sites as ‘blueprints’ for later use.
For example, if you set up a testing site using the Neve WordPress theme and installed the All In One SEO Pack plugin as well, you could use the blueprint option to replicate this exact setup later on.
It’s a simple feature, but it can save you a lot of time if you prefer to set up your testing environments just so.
All you need to do is find the site you want to save on your list of local environments, right-click on it, and select the Save as Blueprint option:
The option to save a website like a blueprint.
The application will ask you to provide a name for your blueprint and decide which version of PHP and which webserver to use.
Choose your preferred settings and click on ‘Save Blueprint’.
To put a blueprint into action, click on the ‘+’ sign in the bottom left corner of the application and choose the ‘Add Site’ from the Blueprint option.
Select which blueprint to use, and the program will do the rest. You can review and delete your existing blueprints at any time under Settings > Blueprints.
Adding SSL to your Local WordPress Website:
This can be useful if you are debugging a website that has SSL enabled in live production or if you are building a website with making it SSL complaint when it goes into production.
To enable SSL for your Local WordPress website, all you have to do is go to the SSL tab of the installation and click on the ‘Trust’ button.
It will ask for your admin password and turn the domain into trusted. You can now view the HTTPS version of the local domain.
Clones and Exports:
You can clone your local WordPress sites with a single click to create full backups (files, databases and server configuration).
Further, you can export and import local WordPress sites easily. Exporting and importing sites restores all files, databases, configuration, and local settings. You can choose to exclude files from your exports simply by picking them out. Cloning and Exports would save a lot of time.
When you’ve worked for some time on a local site, but it’s not ready for production, you might want to share it with a client or see how it renders on a phone. How can you do that?
Instead of moving it to a testing server, Local by Flywheel has a nifty “Live link” option courtesy of ngrok. Enabling this will give you a live URL to use from any device.
The downside is your link will self-destruct after a certain period – namely, the time when you shut down Local by Flywheel.
That’s fine for getting quick feedback, but not so great if your colleague or client gets back to you in a week! Every time you re-enable the live link, you’ll get a different URL.