23.2. Server Installation

Deployment Scenarios

As a developer, you may wish to download Neo4j and run it locally on your desktop computer. We recommend this as an easy way to discover Neo4j.

As a systems administrator, you may wish to install Neo4j using a packaging system so you can ensure that a cluster of machines have identical installs. See the section called “Linux Packages” for more information on this.

For information on High Availability, please refer to Chapter 25, High Availability.

Prerequisites

With the exception of our Windows Installer, you’ll need a Java Virtual Machine installed on your computer. We recommend that you install OpenJDK 7 or Oracle Java 7.

Windows

Windows Installer

  1. Download the version that you want from http://neo4j.com/download/.

    • Select the appropriate version and architecture for your platform.
  2. Double-click the downloaded installer file.
  3. Follow the prompts.
[Note]Note

The installer will prompt to be granted Administrator privileges. Newer versions of Windows come with a SmartScreen feature that may prevent the installer from running — you can make it run anyway by clicking "More info" on the "Windows protected your PC" screen.

Windows Console Application

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

    • Select the appropriate Zip distribution.
  2. Right-click the downloaded file, click Extract All.

    • Refer to the top-level extracted directory as: NEO4J_HOME
  3. Double-click on %NEO4J_HOME%\bin\Neo4j.bat
  4. Stop the server by typing Ctrl-C in the console that got opened.
[Note]Note

Some users have reported problems on Windows when using the ZoneAlarm firewall. If you are having problems getting large responses from the server, or if the web interface does not work, try disabling ZoneAlarm. Contact ZoneAlarm support to get information on how to resolve this.

Linux

Linux Packages

After installation you may have to do some platform specific configuration and performance tuning. For that, refer to Section 24.12, “Linux Performance Guide”.

Unix Console Application

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

    • Select the appropriate tar.gz distribution for your platform.
  2. Extract the contents of the archive, using: tar -xf <filename>

    • Refer to the top-level extracted directory as: NEO4J_HOME
  3. Change directory to: $NEO4J_HOME

    • Run: ./bin/neo4j console
  4. Stop the server by typing Ctrl-C in the console.

Linux Service

The neo4j command can also be used with start, stop, restart or status instead of console. By using these actions, you can create a Neo4j service. See the neo4j man page for further details.

[Caution]Caution

This approach to running Neo4j as a server is deprecated. We strongly advise you to run Neo4j from a package where feasible.

You can build your own init.d script. See for instance the Linux Standard Base specification on system initialization, or one of the many samples and tutorials.

Mac OSX

Running Neo4j from the Terminal

The server can be started in the background from the terminal with the command neo4j start, and then stopped again with neo4j stop. The server can also be started in the foreground with neo4j console — then it’s log output will be printed to the terminal.

The neo4j-shell command can be used to interact with Neo4j from the command line using Cypher. It will automatically connect to any server that is running on localhost with the default port, otherwise it will show a help message. You can alternatively start the shell with an embedded Neo4j instance, by using the -path path/to/data argument — note that only a single instance of Neo4j can access the database files at a time.

OSX Service

Use the standard OSX system tools to create a service based on the neo4j command.

A note on Java on OS X Mavericks

Unlike previous versions, OS X Mavericks does not come with Java pre-installed. You might encounter that the first time you run Neo4j, where OS X will trigger a popup offering you to install Java SE 6.

Java SE 6 is incompatible with Neo4j 2.2.0-M02, so we strongly advise you to skip installing Java SE 6 if you have no other uses for it. Instead, for Neo4j 2.2.0-M02 we recommend you install Java SE 7 from Oracle (http://www.oracle.com/technetwork/java/javase/downloads/index.html) as that is what we support for production use.

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.

For how to set this up, see the section called “Alternative setup: Creating a local cluster for testing”. Just use the Neo4j edition of your choice, follow the guide and remember to not set the servers to run in HA mode.