Additional Service Configurations for ddev¶
DDEV-Local 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 named "dev" with the solr configuration you define.
- Copy docker-compose.solr.yaml to the .ddev folder for your project.
- Solr version can be changed by updating this line
docker-compose.solr.yamlfile, but the recipe here assumes solr:8 and it may not work with other versions. Acquia and Pantheon.io hosting seem to require versions from 3 to 7, and you'll want to see the contributed recipes for older versions of solr.
- Create the folder path .ddev/solr/conf.
* If needed, you may copy/extract the Solr configuration files for your project into
.ddev/solr/conf. Ensure that the configuration files are present before running
ddev restartif your project is already running.
Drupal8-specific extra steps¶
- Enable the Search API Solr Search Defaults module
- Add a solr server at
* Use the "standard" Solr connector
* Use the "http" protocol
* The "solr host" should be
ddev-<projectname>-solrNOT the default "localhost", because it does not run in the same container as the webserver. (Note that just using "solr" will often work, and used to be recommended, but it can be ambiguous if there are more than one projects running with a solr service.)
* The "solr core" should be named "dev" unless you customize the docker-compose.solr.yaml
* Under "Advanced server configuration" set the "solr.install.dir" to
- Download the config.zip provided on /admin/config/search/search-api/server/dev
- Unzip the config.zip into .ddev/solr/conf. For example,
cd .ddev/solr/conf && unzip ~/Downloads/solr_8.x-config.zip
- In order for changes to take effect you must stop the project, remove the Solr volume, and start it again. So run
docker volume rm ddev-<projectname>_solrif your project is called "myproject" then you would run
ddev stop && docker volume rm ddev-myproject_solr && ddev restart. (If you have installed solr-configupdate.sh as described below, then you need only
Updating Apache Solr configuration on an existing Solr core¶
The default solr-precreate script provided in docker-solr and used in the
entrypoint in docker-compose.solr.yaml does not have the capability to update core configuration after the core has been created. It just copies mounted config into the core, where it would otherwise live forever. However, a simple optional script executed on startup can re-copy config into place. Here's the technique:
- Copy solr-configupdate.sh to .ddev/solr. This simple script is mounted into the container and updates config from .ddev/solr/conf on
cd .ddev/solr && rm -rf solr-configupdate.sh && curl -O https://raw.githubusercontent.com/drud/ddev/master/pkg/servicetest/testdata/TestServices/solr-configupdate.sh && chmod +x solr-configupdate.sh
- Make sure solr-configupdate.sh is executable:
chmod +x .ddev/solr/solr-configupdate.sh
- You can now copy/edit/update the solr configuration files for your project in .ddev/solr/conf and when you
ddev restartthe solr configuration will be live.
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 ddev-<projectname>-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
Additional services in ddev-contrib (MongoDB, PostgresSQL, etc)¶
The ddev-contrib repository has a wealth of additional examples and instructions:
- ElasticHQ:See ElasticHQ.
- Elasticsearch: See Elasticsearch.
- Headless Chrome: See Headless Chrome for Behat Testing
- MongoDB: See MongoDB.
- Old PHP Versions to Run Old Sites: See Old PHP Versions
- PostgresSQL: See PostgresSQL.
- RabbitMQ: See RabbitMQ
- Redis: See redis.
- Redis Commander: See redis commander
- TYPO3 Solr Integration: See TYPO3 Solr
Your PRs to integrate other services are welcome at ddev-contrib.