Automattic releases wp-now - a local development environment powered by WordPress Playground - 🏆 Managed Server

BLOG

June 6 2023

Automattic releases wp-now: a local development environment powered by WordPress Playground

Wp Now is the innovative local WordPress Development Environment compatible on all platforms to launch a WordPress environment in seconds.

For a developer, it is often frustrating to constantly have to manage configurations, install different libraries and deal with commercial licenses. What developers love is writing code, building things, and launching products that help people. In fact, for them the code is poetry.

wp-now is a new configuration-free development environment Automattic recently contributed to for the WordPress Playground. Although it is currently in its alpha stage, wp-now is already the fastest and easiest way to start a local WordPress site.

Automattic wants to help developers focus on what matters most, which is turning caffeine into lines of code and launching products quickly.

wp-now can be installed directly from npm. Works on all platforms (Mac, Linux and Windows). While it doesn't yet support custom domains or SSL, Automattic has plans for it. Contributors to wp-now are also considering auto-detecting when a file is changed and auto-updating the browser, importing a database from another WordPress site, and adding a deploy feature for SSH/SFTP hosting. among other features.

At WordPress.com, contributing to projects like WordPress Playground aligns with the company's mission to provide the best managed hosting platform for WordPress. Over the past year, the developer experience on WordPress.com has been enriched with tools like the WP-CLI, SSH access, and staging sites.


One of the aspects in which wp-now is optimized is the development of Block themes. Let's imagine a developer grappling with a new and challenging project: the creation of a block theme for a prestigious university.

The developer is tired of repeating the same steps over and over: download the latest version of WordPress, set up a new site, and keep track of their login details. He recalls a blog post announcing an innovative tool to explore: "Launch a local environment in seconds with wp-now." So he decides to give it a try since the only requirement is npm and he might finally stop using Docker.

After starting wp-now, a new website with the chosen theme automatically opens in your browser within seconds. He doesn't need to install the theme or enter his credentials, he's already logged in as an administrator.

After some development, he decides to test his theme using the latest WordPress release candidate:

wp-now start --wp=6.3-RC1

His site looks great on his computer, but the client asked to start using PHP 8.2 while WordPress is still at version 6.1. But that's no problem for wp-now:

wp-now start --php=8.2 --wp=6.1.3

At the end of a productive work day, go home with a sense of accomplishment. He realizes that this new tool is excellent for his product development and decides to share it with his colleagues. He can help them with their themes and plugins. As a bonus, it also makes it easy to contribute to WordPress.

Faster than Docker

Under the hood, wp-now uses WordPress Playground, which runs PHP via WebAssembly. Performance matters, so Automattic measured how wp-now compares to the local Docker-based development environment, wp-env.

In general, wp-now is several times faster to get started and just as fast to work:

Task wp-now wp-env
Download dependencies 10s 5m
Start Docker 0s 12s
Start environment 1.03s 2.35s
Load site home page 0.3s 0.17s
Load admin dashboard 0.34s 0.17s

While requests to the pages they tested took about twice as long in the wp-now environment, the absolute differences were in the order of 100-400ms, which shouldn't affect day-to-day development work much.

wp-now-load-time-1

Powered By WordPress Playground

wp-now is basically a NodeJS application that includes a built-in PHP server, powered by WordPress Playground.

When a user runs wp-now from a directory, wp-now creates an instance of php-wasm, downloads the selected version of WordPress, and mounts the necessary directories into a virtual file system (VFS). Next, they start a NodeJS express server which listens and routes all requests to the php-wasm. As a result, wp-now is able to easily autologin to WordPress, activate plugins and themes, and automatically configure the user's WordPress site.

wp-now relies on the SQLite Database Integration plugin for its database, but can also connect to an existing MySQL database. All project-specific files are kept in the user's home directory, inside the ~/.wp-now folder. Directories are created following this pattern: ~/.wp-now/wp-content/${ProjectFolderName}-${Pathhash}.

In the simplest terms, wp-now is a powerful tool that allows developers to work in a local environment without going through the hassles associated with setting up a WordPress site manually. This NodeJS application handles the technical details and provides a smooth user experience, allowing developers to focus on content creation and site design. With support for both SQLite and MySQL, wp-now offers flexibility in terms of data management, all while keeping your project files tidy and easily accessible.

Open to Contributions

Community contributions are invaluable in improving wp-now and WordPress Playground. Developers and users can help and contribute by sharing their ideas, expressing their opinion on which features are most useful for them, reporting issues, or even creating pull requests for the WordPress Playground Tools GitHub repository. The wp-now team is driven by user feedback – they invite everyone to ask questions and share their ideas.

Here are some future ideas the team is considering:

  • Create a template theme/plugin with the wp-now create function.
  • Automatic detection when a file is changed and automatic browser update.
  • Use wp-now playground to launch a WordPress site without any files.
  • Import the database from another WordPress site, whether it's on your computer or hosted externally.
  • Add the deploy feature to help developers deploy to any SSH/SFTP hosting.
  • Support custom domains.

If users want to build wp-now from its source code, they can follow the steps for contributing. Additionally, you can join the conversation in the #meta-playground channel on Making WordPress Slack.

Do you have doubts? Don't know where to start? Contact us!

We have all the answers to your questions to help you make the right choice.

Chat with us

Chat directly with our presales support.

0256569681

Contact us by phone during office hours 9:30 - 19:30

Contact us online

Open a request directly in the contact area.

INFORMATION

Managed Server Srl is a leading Italian player in providing advanced GNU/Linux system solutions oriented towards high performance. With a low-cost and predictable subscription model, we ensure that our customers have access to advanced technologies in hosting, dedicated servers and cloud services. In addition to this, we offer systems consultancy on Linux systems and specialized maintenance in DBMS, IT Security, Cloud and much more. We stand out for our expertise in hosting leading Open Source CMS such as WordPress, WooCommerce, Drupal, Prestashop, Joomla, OpenCart and Magento, supported by a high-level support and consultancy service suitable for Public Administration, SMEs and any size.

Red Hat, Inc. owns the rights to Red Hat®, RHEL®, RedHat Linux®, and CentOS®; AlmaLinux™ is a trademark of AlmaLinux OS Foundation; Rocky Linux® is a registered trademark of the Rocky Linux Foundation; SUSE® is a registered trademark of SUSE LLC; Canonical Ltd. owns the rights to Ubuntu®; Software in the Public Interest, Inc. holds the rights to Debian®; Linus Torvalds holds the rights to Linux®; FreeBSD® is a registered trademark of The FreeBSD Foundation; NetBSD® is a registered trademark of The NetBSD Foundation; OpenBSD® is a registered trademark of Theo de Raadt. Oracle Corporation owns the rights to Oracle®, MySQL®, and MyRocks®; Percona® is a registered trademark of Percona LLC; MariaDB® is a registered trademark of MariaDB Corporation Ab; REDIS® is a registered trademark of Redis Labs Ltd. F5 Networks, Inc. owns the rights to NGINX® and NGINX Plus®; Varnish® is a registered trademark of Varnish Software AB. Adobe Inc. holds the rights to Magento®; PrestaShop® is a registered trademark of PrestaShop SA; OpenCart® is a registered trademark of OpenCart Limited. Automattic Inc. owns the rights to WordPress®, WooCommerce®, and JetPack®; Open Source Matters, Inc. owns the rights to Joomla®; Dries Buytaert holds the rights to Drupal®. Amazon Web Services, Inc. holds the rights to AWS®; Google LLC holds the rights to Google Cloud™ and Chrome™; Microsoft Corporation holds the rights to Microsoft®, Azure®, and Internet Explorer®; Mozilla Foundation owns the rights to Firefox®. Apache® is a registered trademark of The Apache Software Foundation; PHP® is a registered trademark of the PHP Group. CloudFlare® is a registered trademark of Cloudflare, Inc.; NETSCOUT® is a registered trademark of NETSCOUT Systems Inc.; ElasticSearch®, LogStash®, and Kibana® are registered trademarks of Elastic NV Hetzner Online GmbH owns the rights to Hetzner®; OVHcloud is a registered trademark of OVH Groupe SAS; cPanel®, LLC owns the rights to cPanel®; Plesk® is a registered trademark of Plesk International GmbH; Facebook, Inc. owns the rights to Facebook®. This site is not affiliated, sponsored or otherwise associated with any of the entities mentioned above and does not represent any of these entities in any way. All rights to the brands and product names mentioned are the property of their respective copyright holders. Any other trademarks mentioned belong to their registrants. MANAGED SERVER® is a trademark registered at European level by MANAGED SERVER SRL, Via Enzo Ferrari, 9, 62012 Civitanova Marche (MC), Italy.

Back to top