Additional Service Configurations for ddev
ddev projects can be extended to provide additional services. This is achieved by adding docker-compose files to a project's .ddev directory that defines the added service(s). This page provides configurations for services that are ready to be added to your project with minimal setup.
If you need a service not provided here, see Defining an additional service with Docker Compose
This recipe adds an Apache Solr container to a project. It will set up a solr core with the solr configuration you define.
- Copy docker-compose.solr.yaml to the .ddev folder for your project.
- You can change the Solr version by changing the
imagevalue in docker-compose.solr.yaml, for example:
image: solr:6.6. The most obvious official solr image tags are at hub.docker.com.
- Create the folder path .ddev/solr/conf.
- Copy the Solr configuration files for your project to
.ddev/solr/conf. e.g. if using Drupal Search API Solr, you would copy the
web/modules/contrib/search_api_solr/solr-conf-templates/6.x/contents from the module code base into
- Ensure that the configuration files are present before running
- Add the following post-start hook to your config.yaml; this turns on ping for the "dev" core. The curl command can also be done as a one-time configuration from within the web container.
hooks: post-start: - exec: curl --fail -s 'http://solr:8983/solr/dev/admin/ping?action=enable'
Drupal8-specific extra steps:
- Enable the Search API Solr Search Defaults module and edit the server settings at
- Change the "Solr core" field from the default "d8" to "dev" and under Advanced Server Configuration change the solr.install.dir setting to
- Go to the view tab and download the updated config.zip file.
- Stop the project with
- Remove the original configuration files from
.ddev/solr/conf and copy in the updated files extracted from config.zip.
- In order for changes to take effect you must remove the Solr volume by running
docker volume rm ddev-PROJECT-NAME_solrdata e.g. if your project is called "myproject" then you would run
docker volume rm ddev-myproject_solrdata.
- Now you can start the project
Updating Apache Solr configuration
ddev stopto remove your application's containers (note: if you do not use the destructive option, the index will be untouched).
- copy the new solr configuration files for your project to .ddev/solr/conf as described in Installation, above.
ddev startto rebuild and restart the containers.
- An excellent way to automate the updating of the solr config uses a solr-init.sh script mounted into the solr container's
Interacting with Apache Solr
- The Solr admin interface will be accessible at:
http://<projectname>.ddev.site:8983/solr/For example, if the project is named "myproject" the hostname will be:
- To access the Solr container from the web container use:
- A Solr core is automatically created with the name "dev"; it can be accessed (from inside the web container) at the URL:
http://solr:8983/solr/devor from the host at
This recipe adds a Memcached 1.5 container to a project. The default configuration allocates 128 MB of RAM for the Memcached instance; to change that or other command line arguments, edit the
command array within the docker-compose file.
- Copy docker-compose.memcached.yaml to the .ddev folder for your project.
Interacting with Memcached
- The Memcached instance will listen on TCP port 11211 (the Memcached default).
- Configure your application to access Memcached on the host:port
- To reach the Memcached admin interface, run
ddev sshto connect to the web container, then use
telnetto connect to the Memcached container on port 11211, i.e.
nc memcached 11211. You can then run commands such as
statsto see usage information.
Beanstalk (Work Queue)
This recipe adds a Beanstalk container to a project.
- Copy docker-compose.beanstalk.yaml to the .ddev folder for your project.
Interacting with the Beanstalk Queue
- The Beanstalk instance will listen on TCP port 11300 (the beanstalkd default).
- Configure your application to access Beanstalk on the host:port