PHP / Magento Dev Blog

  • Publikacje
  • O autorze
  • Kontakt

DDEV – local Magento 2 in 10 minutes, comparison with XAMPP

by Henryk Tews / Tuesday, 11 December 2018 / Published in Środowiska

For years, setting up a local Magento 2 environment was a ritual of pain: XAMPP with manual vhost configuration, fighting PHP versions, unreproducible “works on my machine” problems. DDEV solves this elegantly – Docker underneath, simple YAML configuration on top.

What is DDEV?

DDEV is a Docker-based CLI tool that automates creating local development environments for popular platforms – including Magento 2. A few commands and you have a working environment with nginx, PHP-FPM, MySQL, Redis, and Elasticsearch at the right versions.

Requirements

  • Docker Desktop (macOS / Windows) or Docker Engine (Linux)
  • DDEV CLI
  • Composer
# Install DDEV on macOS via Homebrew
brew install ddev/ddev/ddev

# On Ubuntu/Debian
curl -fsSL https://raw.githubusercontent.com/ddev/ddev/master/scripts/install_ddev.sh | bash

ddev version

Initialising a Magento 2 project

mkdir magento2-dev && cd magento2-dev

ddev config --project-type=magento2 \
            --project-name=magento2-dev \
            --php-version=7.2 \
            --docroot=pub

ddev start

This creates .ddev/config.yaml:

name: magento2-dev
type: magento2
docroot: pub
php_version: "7.2"
webserver_type: nginx-fpm
mariadb_version: "10.2"

Installing Magento 2 via Composer

ddev composer create --repository=https://repo.magento.com/ \
    magento/project-community-edition:2.3.0 .

ddev exec bin/magento setup:install \
    --base-url=https://magento2-dev.ddev.site \
    --db-host=db --db-name=db --db-user=db --db-password=db \
    --admin-firstname=Admin --admin-lastname=User \
    --admin-email=admin@example.com \
    --admin-user=admin --admin-password=Admin123! \
    --language=en_US --currency=USD --timezone=America/Chicago \
    --use-rewrites=1 \
    --search-engine=elasticsearch6 \
    --elasticsearch-host=elasticsearch --elasticsearch-port=9200

Useful daily DDEV commands

Command What it does
ddev start Start the containers
ddev stop Stop the containers
ddev ssh Enter the web container
ddev exec <cmd> Run a command inside the container
ddev logs Show nginx/PHP logs
ddev xdebug on Enable Xdebug
ddev describe Show URL, ports, database credentials

What you gain vs XAMPP

With XAMPP you have one global PHP for all projects. With DDEV each project has its own container with its own PHP version, independent database, and separate nginx. Moving a project to another machine means copying the directory with .ddev/config.yaml and running ddev start.

Summary

DDEV is my default choice for local Magento 2 development. Works consistently on macOS, Linux, and Windows, integrates with PHPStorm, handles Xdebug with a single command, and does not require Docker knowledge to get started.

About Henryk Tews

What you can read next

Blackfire – DDEV setup, HTTP and CLI profiling, CI/CD assertions
OpenTelemetry – distributed tracing, auto-instrumentation, Jaeger in DDEV
Varnish – VCL, cache tagging, ESI, invalidation, DDEV setup

© 2026 Created by

TOP
Zarządzaj zgodą
Aby zapewnić jak najlepsze wrażenia, korzystamy z technologii, takich jak pliki cookie, do przechowywania i/lub uzyskiwania dostępu do informacji o urządzeniu. Zgoda na te technologie pozwoli nam przetwarzać dane, takie jak zachowanie podczas przeglądania lub unikalne identyfikatory na tej stronie. Brak wyrażenia zgody lub wycofanie zgody może niekorzystnie wpłynąć na niektóre cechy i funkcje.
Funkcjonalne Always active
Przechowywanie lub dostęp do danych technicznych jest ściśle konieczny do uzasadnionego celu umożliwienia korzystania z konkretnej usługi wyraźnie żądanej przez subskrybenta lub użytkownika, lub wyłącznie w celu przeprowadzenia transmisji komunikatu przez sieć łączności elektronicznej.
Preferencje
Przechowywanie lub dostęp techniczny jest niezbędny do uzasadnionego celu przechowywania preferencji, o które nie prosi subskrybent lub użytkownik.
Statystyka
Przechowywanie techniczne lub dostęp, który jest używany wyłącznie do celów statystycznych. Przechowywanie techniczne lub dostęp, który jest używany wyłącznie do anonimowych celów statystycznych. Bez wezwania do sądu, dobrowolnego podporządkowania się dostawcy usług internetowych lub dodatkowych zapisów od strony trzeciej, informacje przechowywane lub pobierane wyłącznie w tym celu zwykle nie mogą być wykorzystywane do identyfikacji użytkownika.
Marketing
Przechowywanie lub dostęp techniczny jest wymagany do tworzenia profili użytkowników w celu wysyłania reklam lub śledzenia użytkownika na stronie internetowej lub na kilku stronach internetowych w podobnych celach marketingowych.
  • Manage options
  • Manage services
  • Manage {vendor_count} vendors
  • Read more about these purposes
Zobacz preferencje
  • {title}
  • {title}
  • {title}