With the upcoming Neo4j 4.0 release, it was time to revisit deploying a Neo4j causal cluster via Docker. Our fantastic parter, GraphAware published a quickstart for deploying a cluster in Docker.
Docker is a tool designed to make it easy to create, deploy, and run applications by using containers. Containers allow developers to package an application with all of the components it needs and distribute it as an atomic, universal unit that can run on any host platform.
This docker-compose.yml file will start a three-core causal cluster.
- Download the docker-compose.yml
- Open a command shell in the same directory and execute:
docker-compose up
That’s it! After allowing each instance to come to life and to discover each other, the cluster is up and running.

Note: There are still some warnings that show up in the logs but these are items that are being worked on.
Neo4j 4.0 changes:
Some things that have changed and require your attention are using the advertised_address instead of listen_address for the clustering protocols.
NEO4J_causal__clustering_discovery__advertised__address=core2:5000
NEO4J_causal__clustering_transaction__advertised__address=core2:6000
NEO4J_causal__clustering_raft__advertised__address=core2:7000
When finished, the cluster can be shut down by opening a shell in the same directory as docker-compose.yml and executing:
docker-compose down