MacOs Installation Guide

1. Install Docker Desktop

2. Install Git (CLI)

  • Easiest: open Terminal and run xcode-select --install (installs Apple’s Command-Line Tools, which include Git).

  • Verify with git --version → you should see git 2.x or newer.

  • Prefer Homebrew? brew install git works too.

3. Clone the WordPress Pete Docker project

# Create (or jump into) a workspace directory
mkdir -p ~/Sites && cd ~/Sites

# Grab the stack
git clone https://github.com/peterconsuegra/wp-pete-docker.git
cd wp-pete-docker

4. Create your environment file

cp .env.example.development .env

5. Build & start the stack

docker compose up --build
  • Wait until the docker compose up --build command finishes; the prompt will return when all containers are healthy.

  • Make sure your browser uses HTTP (not HTTPS).

  • Open http://pete.petelocal.net/ — you should see WordPress’s setup screen.

Develop inside the Docker Container

  • Install Visual Studio Code

    • Download the latest macOS build from https://code.visualstudio.com.

    • Drag Visual Studio Code.app into Applications, then launch it once so Gatekeeper trusts the app.

  • Add the “Dev Containers” extension

    • In VS Code press ⇧⌘X (Extensions) → search “Dev Containers”Install (Microsoft).

    • This extension replaces the old Remote-Containers name; it lets VS Code attach to running Docker containers.

  • Start Docker & pick your container

    • Ensure Docker Desktop is running and WordPress Pete containers are up (docker ps in Terminal should list them).

    • In VS Code click the green >< status button (lower-left) → Dev Containers: Attach to Running Container… → select the container you want to hack on (e.g. wordpresspete_php_1).

  • Open the project inside the container

    • After VS Code reloads in “container mode”, press ⌘O (or File → Open…)

    • Browse to /var/www/html – this is the shared volume that holds all WordPress & Laravel projects.

Docker Compose workflow cheatsheet (macOS)

TaskCommand (inside your project folder)When / Why you use it
WordPress Pete Docker project routecd /opt/wp-pete-dockerBrowse to the project dir
Start or re-build the stackcd /opt/wp-pete-docker && docker compose up --build Builds images if they changed and launches every service in the foreground. Hit Ctrl +C to stop.
Open a shell in a container

docker compose exec php

docker compose exec apache

docker compose exec mysql

Inspect logs, run WP-CLI / Artisan, edit files quickly.
Re-build after editing a Dockerfiledocker compose build --no-cache apache
docker compose build --no-cache php
docker compose build --no-cache mysql
Forces a clean image rebuild for wordpress, apache, or php after you tweak their Dockerfile.
Reset phpMyAdminbash docker compose down docker volume rm wp-pete-docker_pma_data Drops the pma_data volume so phpMyAdmin is regenerated on next up.
Delete all volumes (nuke-and-pave)bash docker compose down -v Stops containers and removes every named/anonymous volume—irreversible.
Restart Apache inside its containerbash docker compose exec apache bash -c "apache2ctl restart" Applies v-host changes without recreating the whole stack.
Where Apache keeps v-hosts /etc/apache2/sites-available – staging configs /etc/apache2/sites-enabled – live symlinksEdit a file in sites-available, then run apache2ctl graceful (from inside the container).
Enter MySQL as rootdocker compose exec mysql -u root -p (password = MYSQL_ROOT_PASSWORD in .env)Handy for one-off queries or importing .sql dumps.
Trigger graceful Apache reload from PHP / CIbash curl -sf -H "X-Reload-Secret: $APACHE_RELOAD_SECRET" http://apache/internal-reload Lets a deploy script tell Apache to reload configs without restarting the container.