Elastic Search

Add the elasticsearch service under the services section in .docksal/docksal.yml:

  # Elastic Search
      file: ${HOME}/.docksal/stacks/services.yml
      service: elasticsearch

Apply new configuration with fin project start (fin p start).

Elastic Search will be exposed on a random port. Use fin project status to determine which port Elastic Search is exposed on, e.g.,

14:06:05 ~/Projects/drupal8
ยง fin ps
         Name                        Command                  State                     Ports              
drupal8_cli_1             /opt/startup.sh supervisord      Up (healthy)   22/tcp, 3000/tcp, 9000/tcp       
drupal8_db_1              /entrypoint.sh mysqld            Up   >3306/tcp          
drupal8_elasticsearch_1   /usr/local/bin/docker-entr ...   Up   >9200/tcp, 9300/tcp
drupal8_web_1             httpd-foreground   

In the example above, Elastic Search port 9200 is exposed on the host as 32770 and can be accessed at

Assigning a Static Port

To have a static port assigned, override the ELASTICSEARCH_PORT_MAPPING variable in .docksal/docksal-local.env:


In this case, the current project elastic search will be accessible at

Persistent Settings

If a settings value for elastic search such as max_map_count needs to be set and persist through project starts, you may need to make modifications for your environment.

Docker for Mac

Edit then git commit the following file:


Docker Machine (VirtualBox)

fin vm ssh
sudo touch /var/lib/boot2docker/bootlocal.sh
sudo chmod +x /var/lib/boot2docker/bootlocal.sh
echo 'sysctl -w vm.max_map_count=262144' | sudo tee -a /var/lib/boot2docker/bootlocal.sh