Warden

Warden is a Docker-based PHP development environment suitable for Magento 2.

Usage

See Warden documentation.

warden env start
warden env stop
warden shell

Troubleshooting

Error creating php-fpm

Solution — Change the Docker MacOS settings. Uncheck experimental “Use Docker Compose V2 release candidate” feature. Reference

Warden and Valet conflict

Valet and Warden both try to use port 53 for dnsmasq. Running both on the same computer requires a few changes.

Cannot start service dnsmasq: Ports are not available: port is already allocated

Option 1: Worked

# Switch to Valet
warden env stop
valet start

# Switch to Warden
valet stop
warden env start
warden svc restart dnsmasq

Option 2: Did Not Work

Not sure why this doesn’t work as suggested. Maybe something with ports.

Configure Warden to use a different port: Reference

Override Warden’s dnsmasq port (once)

Edit /usr/local/opt/warden/docker/docker-compose.yml to change the port from 53 to 5053.

dnsmasq:
  container_name: dnsmasq
  image: jpillora/dnsmasq
  ports:
    # - "127.0.0.1:53:53/udp"
    - "127.0.0.1:5053:53/udp" # GravDept: changed to ":5053:53" to avoid Valet conflict.
Override host resolver to use port (every time)
  1. Run valet stop
  2. Run sudo nano /etc/resolver/test
  3. Comment/uncomment the port line:
nameserver 127.0.0.1
# GravDept:
# Comment for Valet usage.
# Uncomment for Warden usage.
port 5053
  1. Restart Valet or Warden