Running WordPress on your device

Why would a WordPress user need to run a local site?

Available tools to run a local site on your computer:

Transcript

Introduction

In this lesson, we will explore the reasons why you should run a local site. A local environment is crucial for building, testing, and experimenting with your website safely and efficiently. In this lesson, we will define a local testing environment, identify the benefits of using a local environment, and explore three options for setting up a development site. But what is a local testing environment? A local testing environment is a setup on your computer that mirrors your live website but runs entirely offline. It acts as a buffer between your live site and the changes you’re working on. It allows you to create, test, and refine websites without needing a live hosting service or risking your main website. It is like a test zone, where you can work freely and make changes without any cost or risk to your live site.

Benefits

What are the benefits of using a local environment? Number one, it costs nothing; you can use it for free. Secondly, you can use it to experiment. You can build your site in a safe environment before uploading it to a web host or test changes without affecting your live website. Number three, it allows you to have a backup plan. If you encounter issues on your live site, having a local copy means you can quickly revert to a previous stable version, minimizing downtime. Fourthly, it can be a learning space. You can practice your WordPress skills in a risk-free environment.

Tools

Setting up a local WordPress site can be simplified by using tools such as DevKinsta, WordPress Studio and WordPress Playground. You can also explore other options, such as XAMPP, Docker, or MAMP.

Studio

The first local environment we’ll look at is Studio, a quick, lightweight and shareable WordPress development environment. After downloading and installing Studio, you can set up a new site. To create a new site, click Add Site at the bottom left, name it appropriately, and select a directory path for its files. And then click on Add Site. Below Customize, you can easily access the Site Editor, Patterns, Navigation, and other areas. So I will go ahead and open the Site Editor and now I will be able to achieve the same outcome as with Local. I can test my skills, explore new features, import a site onto my test site, or export my test site to a production site.

WordPress Playground

The last option is a different approach using WordPress Playground. WordPress Playground is a browser-based tool that allows you to run WordPress directly on your web browser, eliminating the need to install software. It is a platform that lets you run WordPress instantly on any device without a host. It creates temporary environments that are discarded after use. It’s a place to build, experiment and test. You can start using Playground instantly by navigating to playground.wordpress.net in your browser. Or you can customize your setup by using the query API in the URL by adding ?networking=yes after ‘.net.’ This will allow you to install and activate plugins and themes.

You may decide to build your site from scratch, and then, when you select the hamburger menu, you can download the site as a zip and export it to your production site. Or, if you want to import a site, click on Restore from zip, which will allow you to replace the current WordPress Playground site with a previously exported one. You can also tweak the URL to automatically install specific plugins or themes on your site.

To automatically install and activate a plugin, for example, you add ?plugin= and then followed by the plugin slug. Let’s go ahead and install the WooCommerce plugin. The plugin slug is the last part of the plugin’s WordPress.org URL. Let’s visit WooCommerce and double-check that we’ve used the correct slug. Then, we can return to Playground, and when we hit Enter, the plugin will automatically install and activate. Now you can test and explore using the plugin. To automatically install and activate a theme, we write ?theme= and then the theme slug. In this case, ‘twentytwentythree.’ Then, it will be ready to use in a few seconds. You can also install multiple plugins and themes simultaneously by adding the & sign between the slugs. So, in this example, you will notice that I’ve added the Twenty Twenty-Three theme, the WooCommerce plugin, and the Contact Form 7 plugin.

By default, changes made in Playground are temporary and will be lost once you close the tab. To make changes persistent, use the settings button in the Playground interface to enable browser storage. This allows your changes to be saved even after refreshing the page. As we will see, the ability to store your site locally on your device is still in beta. Finally, it is also worth mentioning that you can quickly load a language pack to WordPress Playground via the URL. Merely type ?language= and then the WordPress Locale Code—for example, es_ES for Spanish in Spain. Then, the test website will load in the language you selected.

DevKinsta

The last option worth exploring is DevKinsta. When you click on more information, you will find installation instructions. Please note, you will need to install Docker as part of the installation process.

Conclusion

Utilizing a local testing environment is essential for various WordPress tasks, such as building a site before hosting it, experimenting with new themes and plugins, troubleshooting issues, or honing your WordPress skills.

This is a preview lesson

Register or sign in to take this lesson.

Suggestions

Found a typo, grammar error or outdated screenshot? Contact us.