Access Apache Solr admin over HTTPS in DDEV

By Kevin , November 29th, 2023

I have seen some chatter lately about folks asking how to access the Solr admin interface over HTTPS instead of HTTP connection in DDEV. Enabling this is a simple change to the docker-compose.solr.yaml file in the .ddev directory.

In the file, make the following changes under the environment section:

    environment:
      # This defines the host name the service should be accessible from. This
      # will be solr.sitename.ddev.site.
      - VIRTUAL_HOST=solr.$DDEV_HOSTNAME
      # HTTP_EXPOSE exposes http traffic from the container port 8983
      # to the host port 8983 vid ddev-router reverse proxy.
      - HTTP_EXPOSE=8983:8983
      - HTTPS_EXPOSE=443:8983

Once you have made the changes, restart your DDEV project. The Solr admin is then accessible over HTTPS on a subdomain:

Image
solr admin

You can see that the Solr admin is now accessible at solr.SITENAME.ddev.site over HTTPS.

This technique should work for other add on services for DDEV through either overriding environment variables or following Docker conventions for networking.

Note that ddev describe won't list this subdomain, but it will be accessible in the browser. This may be a change we propose in the future so it is clear when services are available from a DDEV subdomain to end users running that command.