4.1. Server Installation

4.1.1. As a Windows service
4.1.2. Linux Service
4.1.3. Macintosh Service
4.1.4. Multiple Server instances on one machine

Neo4j can be installed as a server, running either as a headless application or system service.

  1. Download the latest release from http://neo4j.com/download

    • select the appropriate version for your platform
  2. Extract the contents of the archive

    • refer to the top-level extracted directory as NEO4J-HOME
  3. Use the scripts in the bin directory

    • for Linux/MacOS, run $NEO4J_HOME/bin/neo4j start
    • for Windows, double-click on %NEO4J_HOME%\bin\Neo4j.bat
  4. Refer to the packaged information in the doc directory for details

4.1.1. As a Windows service

With administrative rights, Neo4j can be installed as a Windows service.

  1. Click Start → All Programs → Accessories
  2. Right click Command Prompt → Run as Administrator
  3. Provide authorization and/or the Administrator password
  4. Navigate to %NEO4J_HOME%
  5. Run bin\Neo4j.bat install

To uninstall, run bin\Neo4j.bat remove as Administrator.

To query the status of the service, run bin\Neo4j.bat query

To start/stop the service from the command prompt, run bin\Neo4j.bat +action+

4.1.2. Linux Service

Neo4j can participate in the normal system startup and shutdown process. The following procedure should work on most popular Linux distributions:

  1. cd $NEO4J_HOME
  2. sudo ./bin/neo4j install

    • if asked, enter your password to gain super-user privileges
  3. service neo4jd status

    • should indicate that the server is not running
  4. service neo4jd start

    • will start the server

4.1.3. Macintosh Service

Neo4j can be installed as a Mac launchd job:

  1. cd $NEO4J_HOME
  2. sudo ./bin/neo4j install

    • if asked, enter your password to gain super-user privileges
  3. launchctl load ~/Library/LaunchAgents/wrapper.neo4jd.plist

    • needed to tell launchd about the "job"
  4. launchctl list | grep neo

    • should reveal the launchd "wrapper.neo4jd" job for running the Neo4j Server
  5. launchctl start wrapper.neo4jd

    • to start the Neo4j Server under launchd control
  6. ./bin/neo4j status

    • should indicate that the server is running

4.1.4. Multiple Server instances on one machine

Neo4j can be set up to run as several instances on one machine, providing for instance several databases for development. To configure, install two instances of the Neo4j Server in two different directories. Before running the Windows install or startup, change in conf/neo4j-wrapper.conf

# Name of the service for the first instance
wrapper.name=neo4j_1

and for the second instance

# Name of the service for the second instance
wrapper.name=neo4j_2

in order not to get name clashes installing and starting the instances as services.

Also, the port numbers for the web administration and the servers should be changed to non-clashing values in conf/neo4j-server.properties:

Server 1 (port 7474):

org.neo4j.server.webserver.port=7474

org.neo4j.server.webadmin.data.uri=http://localhost:7474/db/data/

org.neo4j.server.webadmin.management.uri=http://localhost:7474/db/manage/

Server 2 (port 7475):

org.neo4j.server.webserver.port=7475

org.neo4j.server.webadmin.data.uri=http://localhost:7475/db/data/

org.neo4j.server.webadmin.management.uri=http://localhost:7475/db/manage/