DDEV
"DDEV is an open source tool for launching local [PHP, Python, NodeJS, etc] development environments in minutes. These environments can be extended, version controlled, and shared, so you can take advantage of a Docker workflow without Docker experience or bespoke configuration. Projects can be changed, powered down, or removed just as easily as they’re started."
GitHub | Docs
Terminology:
- host os (windows/macosx/linux)
- docker os (linux vm)
- containers (linux)
General flow of ddev tech stack
[ddev, on host os] -> [docker compose -> docker, in linux vm] -> [containers, linux, managed by docker]
Install DDEV and related tools
Follow the install steps for your OS
https://ddev.readthedocs.io/en/stable/
Before running any external shell or powershell scripts, read the install script for your OS.
Prerequisites:
Windows
- Recommended: use wsl2 and docker desktop, docker ce inside wsl (do your work mostly in windows)
- Alternative: use wsl2, docker ce inside wsl (do your work mostly in wsl/linux)
- Alternative: use virtual box, docker ce inside virtual box (do your work mostly in virtual box/linux)
Windows ides can access files in wsl2, but ide operations will be slower due to the different filesystems. Within wsl, for performance, do not reference files by /mnt/c/home/dev, instead use the linux file system, eg /home/dev or ~/
Install, update wsl
https://learn.microsoft.com/en-us/windows/wsl/install
https://learn.microsoft.com/en-us/windows/wsl/basic-commands
The ddev install uses chocolatey, a package manager for windows https://community.chocolatey.org/
Tip: Before installing ddev, you may want to change the default chocolatey tools install directory.
By default chocolatey installs itself to C:\ProgramData\chocolatey and installs tools to C:\tools\ (not great)
In an admin powershell, run:
[System.Environment]::SetEnvironmentVariable('ChocolateyToolsLocation','C:\ProgramData\ChocolateyTools', 'User')
Installing docker desktop may require a logout/reboot.
Ensure docker desktop is using wsl2, launch docker desktop
configure gear icon -> general -> use wsl2 based engine; resources -> wsl integration
You shouldn't need to directly access docker desktop when using ddev.
MacOSX
- Recommended: use colima, docker ce inside colima linux os (do your work mostly in macosx)
- Alternative: use docker desktop, docker ce inside docker desktop linux os (do your work mostly in macosx)
- Alternative: use virtual box, docker ce inside virtual box (do your work mostly in virtual box/linux)
You shouldn't need to directly use colima when using ddev.
Linux
- Recommended: docker ce
- Alternative: use docker desktop
DDEV Configuration
local config
a local config file can be used to merge with the main ddev config in .ddev/config.yaml
examples:
.ddev/config.local.yaml
hooks:
post-start: