MacOs Installation Guide
1. Install Docker Desktop
Download the Apple Silicon or Intel dmg from https://www.docker.com/products/docker-desktop
Drag Docker Desktop.app into Applications and launch it once.
Wait for the ? whale icon to turn solid → “Docker Desktop is running”.
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)
Task | Command (inside your project folder) | When / Why you use it |
---|---|---|
WordPress Pete Docker project route | cd /opt/wp-pete-docker | Browse to the project dir |
Start or re-build the stack | cd /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 |
| Inspect logs, run WP-CLI / Artisan, edit files quickly. |
Re-build after editing a Dockerfile | docker 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 phpMyAdmin | bash 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 container | bash 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 symlinks | Edit a file in sites-available , then run apache2ctl graceful (from inside the container). |
Enter MySQL as root | docker 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 / CI | bash 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. |