Installing wp-env
First install docker-compose
(this script doesn't work with docker compose
):
# On Debian or derivatives
$ sudo apt install docker-compose -y
Then install wp-env
$ cd ~/path/to/myplugin
# Install and use the latest LTS node
$ nvm install --lts
$ nvm use lts/*
# Install wp-env as a global node LTS package
$ npm install --global @wordpress/env
# Now you can use it anytime
$ wp-env start
WordPress development site started at http://localhost:8888/
WordPress test site started at http://localhost:8889/
MySQL is listening on port 32773
MySQL for automated testing is listening on port 32772
The information is based on the official wp-env announcement