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-webserver
container (one per project) runsnginx
orapache
andphp-fpm
for a single site, so it does all the basic work of a PHP-interpreting webserver. - The
ddev-dbserver
container (one per project) handles MariaDB/MySQL/Postgresql database management. It can be reached from the webserver by the hostnamedb
or with the more explicit nameddev-<projectname>-db
. - The optional
dba
container runs PhpMyAdmin for projects with MySQL or MariaDB. - Additional add-on services may be there for a given project, for example
solr
orelasticsearch
ormemcached
.
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-router
container 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_hostnames
andadditional_fqdns
it 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.1
URLs, the requests go directly to theddev-webserver
. - The
ddev-ssh-agent
container runs anssh-agent
inside the docker network so that after you do addev auth ssh
all 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