docs/getting-started/development-environment.md
There are some specific software requirements you will need to consider when developing WooCommerce extensions. The necessary software includes:
Most WordPress hosting environments do not include Node and Composer by default, so when distributing extensions and themes, it’s important to include all built assets.
Note: A POSIX compliant operating system (e.g., Linux, macOS) is assumed. If you're working on a Windows machine, the recommended approach is to use WSL (available since Windows 10).
In addition to the software shared above, you'll also want to have some way of setting up a local development server stack. There are a number of different tools available for this, each with a certain set of functionality and limitations. We recommend choosing from the options below that fit your preferred workflow best.
For easy local development environments, we recommend WordPress Studio, the local development environment supported by the WordPress.com team. Studio includes the ability to manage multiple local website environments, as well as integrations with your code editor and terminal. Studio also features a WordPress-specific AI Assistant, easy imports from WordPress backups, Blueprint support, free public preview sites, and two-way sync with sites hosted on WordPress.com or Pressable.
wp-env is a command-line utility maintained by the WordPress community that allows you to set up and run custom WordPress environments with Docker and JSON manifests. The repository includes a .wp-env.json file specifically for contributing to WooCommerce core.
Below is a collection of tools to help you manage your environment that are not WordPress-specific.
Regardless of the tool you choose for managing your development environment, you should make sure it meets the server recommendations for WooCommerce as well as the requirements for running WordPress.
When developing for WooCommerce, it's helpful to install a development version of WooCommerce Core.
If installing WooCommerce through the traditional WordPress dashboard, you can also install the WooCommerce Beta Tester extension to change the version, including access to upcoming betas and release candidates. The WooCommerce Beta tester is available through the Woo Marketplace.
You can also work directly against the trunk or upcoming release branch of WooCommerce Core in your development environment by:
plugin/woocommerce directory to your wp-content/plugins directoryYou can clone the WooCommerce Core repository locally using the following CLI command:
cd /your/server/wp-content/plugins
git clone https://github.com/woocommerce/woocommerce.git
cd woocommerce
It is recommended to install and activate Node using Node Version Manager (or nvm). You can install nvm using the following CLI command:
nvm install
You can learn more about how to install and utilize nvm in the nvm GitHub repository.
To install WooCommerce dependencies, use the following CLI command:
pnpm install --frozen-lockfile
Use the following CLI command to compile the JavaScript and CSS that WooCommerce needs to operate:
pnpm build
Note: If you try to run WooCommerce on your server without generating the compiled assets, you may experience errors and other unwanted side-effects.
To load the WooCommerce plugin into your local development environment, you can create a symbolic link from the WooCommerce plugin in your cloned repository to your local WordPress development environment.
ln -s woocommerce/plugins/woocommerce /path-to-local/wp-content/plugins
woocommerce.zip assetAlternatively, you can generate a woocommerce.zip file with the following command:
pnpm build:zip
A woocommerce.zip file may be helpful if you’d like to upload a modified version of WooCommerce to a separate test environment.