5.1. Server Installation

5.1.1. As a Windows service
5.1.2. Linux Service
5.1.3. Mac OSX Service
5.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

5.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+

5.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 neo4j-service status

    should indicate that the server is not running

  4. service neo4j-service start

    will start the server

    During installation you will be given the option to select the user Neo4j will run as. You will be asked to supply a username (defaulting to neo4j) and if that user is not present on the system it will be created as a system account and the $NEO4J_HOME/data directory will be chown'ed to that user.

    You are encouraged to create a dedicated user for running the service and for that reason it is suggested that you unpack the distribution package under /opt or your site specific optional packages directory.

    Finally, note that if you chose to create a new user account, on uninstall you will be prompted to remove it from the system.

5.1.3. Mac OSX 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.neo4j-server.plist

    needed to tell launchd about the "job"

  4. launchctl list | grep neo

    should reveal the launchd "wrapper.neo4j-server" job for running the Neo4j Server

  5. launchctl start wrapper.neo4j-server

    to start the Neo4j Server under launchd control

  6. ./bin/neo4j status

    should indicate that the server is running

5.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/