Docker Installation for All Platforms
Docker Installation for All Platforms
Docker provides a consistent ZAP experience across all platforms while simplifying deployment and scaling. The official ZAP Docker images support various use cases from GUI access to headless automation. Docker installation eliminates platform-specific issues and ensures reproducible environments for security testing.
# Running ZAP with GUI support (Linux)
docker run -u zap -p 8080:8080 -p 8090:8090 \
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
-e DISPLAY=$DISPLAY \
--network host \
zaproxy/zap-stable zap.sh
# Headless ZAP for automation
docker run -u zap -p 8080:8080 \
zaproxy/zap-stable zap.sh -daemon \
-host 0.0.0.0 -port 8080 \
-config api.addrs.addr.name=.* \
-config api.addrs.addr.regex=true
# Running weekly release with persistent data
docker run -u zap -p 8080:8080 \
-v $(pwd)/zap-data:/zap/wrk:rw \
zaproxy/zap-weekly zap.sh
Docker Compose configurations enable complex testing environments with ZAP integrated alongside target applications. This approach proves valuable for development teams wanting consistent security testing environments. Volume mounting allows persistent storage of scan data and configurations across container restarts.