3.1. Introduction

An introduction to how Neo4j runs in a Docker container.

The Neo4j Docker image, and instructions on how to start using it, can be found here: https://hub.docker.com/_/neo4j/.

3.1.1. Ports

By default, the Docker image exposes three ports for remote access:

  • 7474 for HTTP.
  • 7473 for HTTPS.
  • 7687 for Bolt.

Note that when Docker is used, Neo4j is configured automatically to allow remote access to the HTTP, HTTPS, and Bolt services. This is different than the default Neo4j configuration, where the HTTP, HTTPS, and Bolt services do not allow remote connections. For more information on configuring connections, see Section 4.7, “Configure connectors”.

3.1.2. Volumes

The Docker image also exposes the following volumes. Directories on the host can be mounted using the --volume option. See Section 4.2, “File locations” for details about the directories used by default in different Neo4j distributions.

  • /conf
  • /data
  • /import
  • /logs
  • /metrics
  • /plugins
  • /ssl

It is often desirable to keep database and logs outside of the container. The following command will start a container with ports for Bolt and HTTP published, and with the /data and /logs volumes mapped to directories on the host.

docker run \
    --publish=7474:7474 --publish=7687:7687 \
    --volume=$HOME/neo4j/data:/data \
    --volume=$HOME/neo4j/logs:/logs \
    neo4j:3.5

Point your browser at http://localhost:7474 on Linux or http://$(docker-machine ip default):7474 on OS X.

All the volumes in this documentation are stored under $HOME in order to work on OS X where $HOME is automatically mounted into the machine VM. On Linux the volumes can be stored anywhere.

By default Neo4j requires authentication and requires you to login with neo4j/neo4j at the first connection and set a new password. You can set the password for the Docker container directly by specifying --env NEO4J_AUTH=neo4j/<password> in your run directive. Alternatively, you can disable authentication by specifying --env NEO4J_AUTH=none instead.

3.1.3. Running Neo4j as a non-root user

For security reasons Neo4j will run as the neo4j user inside the container. You can specify which user to run as by invoking docker with the --user argument. For example, the following would run Neo4j as your current user:

docker run \
    --publish=7474:7474 --publish=7687:7687 \
    --volume=$HOME/neo4j/data:/data \
    --volume=$HOME/neo4j/logs:/logs \
    --user="$(id -u):$(id -g)" \
    neo4j:3.5

3.1.4. Neo4j editions

Tags are available for both Community Edition and Enterprise Edition. Version-specific Enterprise Edition tags have an -enterprise suffix, for example: neo4j:3.5.3-enterprise. Community Edition tags have no suffix, for example neo4j:3.5.3. The latest Neo4j Enterprise Edition release is available as neo4j:enterprise.

3.1.4.1. Neo4j Enterprise Edition license

In order to use Neo4j Enterprise Edition you must accept the license agreement.

© Network Engine for Objects in Lund AB. 2018. All Rights Reserved. Use of this Software without a proper commercial license with Neo4j, Inc. or its affiliates is prohibited.

Email inquiries can be directed to: licensing@neo4j.com

More information is also available at: https://neo4j.com/licensing/

To accept the license agreement set the environment variable NEO4J_ACCEPT_LICENSE_AGREEMENT=yes.

To do this you can use the following docker argument:

--env=NEO4J_ACCEPT_LICENSE_AGREEMENT=yes