Prev |  | Next

## 22.2. Server Installation

### 22.2.1. 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.

- For Windows, see Section 22.2.3, “Windows”.
- For Unix/Linux, see Section 22.2.4, “Linux”.
- For OSX, see Section 22.2.5, “Mac OSX”.

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 24, High Availability.

### 22.2.2. Prerequisites

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

### 22.2.3. Windows

#### Windows Installer

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

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

| 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://www.neo4j.org/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.

#### As a Windows service

1. Download the latest release from http://www.neo4j.org/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`

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\Neo4jInstaller.bat install`

To uninstall, run `bin\Neo4jInstaller.bat remove` as Administrator.

To query the status of the service, run: `bin\Neo4jInstaller.bat status`

To start the service from the command prompt, run: `sc start Neo4j-Server`

To stop the service from the command prompt, run: `sc stop Neo4j-Server`

You can also start and stop Neo4j from the Windows Service Manager.

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

### 22.2.4. Linux

#### Linux Packages

For Debian packages, see the instructions at http://debian.neo4j.org.

#### Unix Console Application

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

   - Select the appropriate tar.gz distribution for your platform.

2. Extract the contents of the archive, using: `tar -cf <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

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-installer install`

   If asked, enter your password to gain super-user privileges.

3. `sudo service neo4j-service status`

   This should indicate that the server is not running.

4. `sudo service neo4j-service start`

   This will start the server.

5. `sudo service neo4j-service stop`

   This will stop 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.

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

To remove the server from the set of startup services, the proper commands are:

1. `cd $NEO4J_HOME`
2. `sudo ./bin/neo4j-installer remove`

This will stop the server, if running, and remove it.

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

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

You can alternatively 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.

### 22.2.5. Mac OSX

#### OSX via Homebrew

Using Homebrew (see http://brew.sh/), to install the latest stable version of Neo4j Server, issue the following command:

    brew install neo4j && neo4j start

This will get a Neo4j instance running on http://localhost:7474. The installation files will reside in `ls /usr/local/Cellar/neo4j/community-{NEO4J_VERSION}/libexec/`— to tweak settings and symlink the database directory if desired.

After the installation, Neo4j can run either as a service or from a terminal.

#### 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

Neo4j can be installed as a Mac launchd job:

1. `cd $NEO4J_HOME`
2. `./bin/neo4j-installer install`

3. `launchctl list | grep neo`

   This should reveal the launchd "org.neo4j.server.7474" job for running the Neo4j Server.

4. `launchctl list | grep neo4j`

   This should indicate that the server is running.

5. `launchctl stop org.neo4j.server`

   This should stop the server.

6. `launchctl start org.neo4j.server`

   This should start the server again.

To remove the launchctl service, issue the following command:

`./bin/neo4j-installer remove`

#### 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.0, so we strongly advise you to skip installing Java SE 6 if you have no other uses for it. Instead, for Neo4j 2.0 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.

### 22.2.6. 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 Section 24.6.3, “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.

Copyright © 2014 Neo Technology

Prev | Up | Next
| Home |