Local setup
Prerequisites
Section titled “Prerequisites”- Docker Desktop
- WP-CLI (
brew install wp-cli) - Composer (
brew install composer) - Node 20+ (for any JS build steps)
1. Clone and install
Section titled “1. Clone and install”git clone git@github.com:your-org/ENV_NAME.gitcd ENV_NAMEcomposer install2. Environment config
Section titled “2. Environment config”cp .env.example .envEdit .env and set at minimum:
DB_NAME=ENV_NAMEDB_USER=rootDB_PASSWORD=rootDB_HOST=127.0.0.1WP_HOME=http://ENV_NAME.test3. Start Docker
Section titled “3. Start Docker”docker compose up -dThis starts:
- nginx on port 80
- php-fpm (PHP 8.2)
- mysql on port 3306
- redis on port 6379
4. Import the database
Section titled “4. Import the database”Ask a teammate for the latest dev database dump, then:
wp db import dev-dump.sql5. Add local hostname
Section titled “5. Add local hostname”echo "127.0.0.1 ENV_NAME.test" | sudo tee -a /etc/hostsVisit http://ENV_NAME.test — you should see the site. WP admin is at http://ENV_NAME.test/wp/wp-admin.
Useful WP-CLI commands
Section titled “Useful WP-CLI commands”wp cache flush # clear Redis object cachewp cron event run --due-now # run pending cron jobs manuallywp search-replace 'https://ENV_NAME.com' 'http://ENV_NAME.test' --all-tables