How DDEV Works¶
The easiest way to think about how DDEV works is to think of it as a set of little networked computers (docker containers). You can think of them as being in a different network world than your workstation computer, but reachable from there.
- The
ddev-webservercontainer (one per project) runsnginxorapacheandphp-fpmfor a single site, so it does all the basic work of a PHP-interpreting webserver. - The
ddev-dbservercontainer (one per project) handles MariaDB/MySQL/Postgresql database management. It can be reached from the webserver by the hostnamedbor with the more explicit nameddev-<projectname>-db. - The optional
dbacontainer runs PhpMyAdmin for projects with MySQL or MariaDB. - Additional add-on services may be there for a given project, for example
solrorelasticsearchormemcached.
Although it's not common usage, different projects can communicate with each other as described in the FAQ
Now for the two oddball containers, which are global (there is only one of each).
- The
ddev-routercontainer is a "reverse proxy". It takes incoming HTTP/S requests and looks up the hostname in the incoming URL and routes it to the correct project'sddev-webserver. Depending on the project's configuration withadditional_hostnamesandadditional_fqdnsit can route many different URLs to a single project'sddev-webserver. If like most people you use the named URLs (likehttps://something.ddev.site) then your request goes through the router. When you use the127.0.0.1URLs, the requests go directly to theddev-webserver. - The
ddev-ssh-agentcontainer runs anssh-agentinside the docker network so that after you do addev auth sshall the different projects can use your ssh keys for outgoing requests (like private composer access or scp from a remote host).
Here's a basic diagram of how it works inside the docker network:
Last update: July 7, 2022