Public | Automated Build

Last pushed: 2 years ago
Short Description
Neo4j 2 Use
Full Description

Neo4j Community Edition 2.2.1

This repository contains a Docker image of the latest version (2.2.1) of the Neo4j community server. This Docker image of Neo4j provides instructions on how to map a Docker data volume to an already existing data/graph.db store file located on your host machine.

What is Neo4j?

Sponsored by Neo Technology, Neo4j is an open-source NoSQL graph database implemented in Java and Scala. With development starting in 2003, it has been publicly available since 2007. The source code and issue tracking are available on GitHub, with support readily available on Stack Overflow and the Neo4j Google group. Limited only by hardware, Neo4j is used today by hundreds of thousands of users in almost all industries. Use cases include matchmaking, network management, software analytics, scientific research, routing, organizational and project management, recommendations, social networks, and more.

Build Docker Image

To build the source from the Dockerfile as an image:

docker build -t kbastani/docker-neo4j .

Pull Docker Image

This image is automatically built and is available from the Docker registry. Use the following pull command to download the image to your local Docker server.

docker pull kbastani/docker-neo4j

Start Neo4j Container

To run the Neo4j image inside a container after either building it or pulling it, run the following docker command.

docker run -d -p 7474:7474 -v /Users/<user>/path/to/neo4j/data:/opt/data --name graphdb kbastani/docker-neo4j

Make sure to replace the <user> with the user directory that contains your Neo4j graph.db data store files.

Keep in mind that store upgrades are not enabled in the Neo4j configuration by default. The data store version of your Neo4j files on your host machine must be equal to the latest release of Neo4j at the time of building this image.

The /path/to/neo4j/data should be the relative path from your host machine's user home directory to neo4j-community-#.#.#/data directory that has the graph.db database you want to mount to the docker container as a volume.


If you're using boot2docker on Mac OS X then you'll need to do the following steps to access the Neo4j browser on the host machine.

Add a route to the container

$ sudo route add -net $(boot2docker ip 2> /dev/null)

This command adds a route from the graphdb container's IP (internal), to the VirtualBox boot2docker VM server IP (external).

Now we need to get the internal IP of the container. Run the following command:

$ docker inspect --format="{{.NetworkSettings.IPAddress}}" graphdb

Now that we know what the internal IP address is of the graphdb container, we can access it from the browser or via curl.

$ curl
  "management" : "",
  "data" : ""

Add a host name

All that is left now is to map the container's IP to a host name on the host machine. I've chosen graphdb, however, you're free to map it to whatever host name you'd prefer (except for localhost).

echo graphdb | sudo tee -a /etc/hosts

The Neo4j server container is now accessible on your host machine with the following URL.

Docker Pull Command
Source Repository