Don’t forget to save any new path commands into .zshrc so the terminal session persists.
- Open the Terminal app
- Install homebrew
- You might be asked if you want to install the Xcode Command Line Tools, confirm.
- Install git by typing
brew install git
- Install Docker on Apple Silicon
- Install node via
brew install node@20
, your preference.- I install node via nvm, but it’s not necessary
- Install Node by using nvm ( I use node 20.x at the moment )
- Open a terminal session
brew install nvm
- Run
nvm install 20
- Run
nvm use 20
- Run
nvm alias default 20
, so every shell session uses this version of node by default
- Install npm via
brew install npm@10
- Switch to npm v10.x via
npm install npm@10 -g
- Make sure you copy path commands to your .zshrc file
- Switch to npm v10.x via
- Clone the GitHub repository with the wordpress-develop environment.
- Open a terminal session
cd ~
git clone https://github.com/WordPress/wordpress-develop.git
cd ./wordpress-develop
- Open the Docker app in your computer and ignore the welcome screen that tells you to create a container
- Install
docker-compose.override.yml
usingcurl -o ./docker-compose.override.yml https://gist.githubusercontent.com/afragen/a10d0475b71bfb79745df52ed3300924/raw/docker-compose.override.yml
- Install
custom-php-config.ini
usingcurl -o ../custom-php-config.ini https://gist.githubusercontent.com/afragen/a10d0475b71bfb79745df52ed3300924/raw/custom-php-config.ini
- Now type these commands in the terminal
npm install
npm run build:dev
npm run env:start
npm run env:install
- You should be able to access the development version of WordPress at localhost:8889. You can access it with username admin and password password
- Additional commands
–npm run env:stop
–npm run env:reset
Shortcuts
Initialize
- Open a terminal session
cd ./wordpress-develop
- Open Docker.app
rm -rf node_modules && npm install && npm run build:dev && npm run env:start && npm run env:install
May need to re-run npm run env:install
if it stalls or errors at end. This is because MySQL may not be ready yet.
Cleanup
npm run env:stop && npm run env:reset && rm -rf node_modules
- Quit Docker Desktop when done.
Run individual tests
npm run test:php -- --filter Tests_Admin_IncludesWpUpgrader
npm run test:php -- --group admin
Testing patches
npm run grunt patch:#####
where#####
is the trac ticket numbernpm run grunt patch:https://github.com/WordPress/wordpress-develop/pull/###
where###
is the PR on GitHub
Don’t commit package-lock.json
with your PR to core or you will have issues.