2.4. Windows installation

This section describes how to install Neo4j on Windows with a desktop installer, or from a ZIP archive.

Neo4j can be run as a desktop or console application, or as a Windows service.

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

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.

If you install Neo4j using the windows installer and you already have an existing instance of Neo4j the installer will select a new install directory by default. If you specify the same directory it will ask if you want to upgrade. This should proceed without issue although some users have reported a JRE is damaged error. If you see this error simply install Neo4j into a different location.

2.4.2. 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.
  3. Change directory to top-level extracted directory.

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

2.4.3. Windows service

Neo4j can also be run as a Windows service. Install the service with bin\neo4j install-service and start it with bin\neo4j start. Other commands available are stop, restart, status and uninstall-service.

2.4.4. Windows PowerShell module

The Neo4j PowerShell module allows administrators to:

  • install, start and stop Neo4j Windows® Services
  • and start tools, such as Neo4j Shell and Neo4j Import.

The PowerShell module is installed as part of the ZIP file distributions of Neo4j.

2.4.4.1. System requirements

  • Requires PowerShell v2.0 or above.
  • Supported on either 32 or 64 bit operating systems.

2.4.4.2. Managing Neo4j on Windows

On Windows it is sometimes necessary to Unblock a downloaded zip file before you can import its contents as a module. If you right-click on the zip file and choose "Properties" you will get a dialog. Bottom-right on that dialog you will find an "Unblock" button. Click that. Then you should be able to import the module.

Running scripts has to be enabled on the system. This can for example be achieved by executing the following from an elevated PowerShell prompt:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned

For more information see About execution policies.

The powershell module will display a warning if it detects that you do not have administrative rights.

2.4.4.3. How do I import the module?

The module file is located in the bin directory of your Neo4j installation, i.e. where you unzipped the downloaded file. For example, if Neo4j was installed in C:\Neo4j then the module would be imported like this:

Import-Module C:\Neo4j\bin\Neo4j-Management.psd1

This will add the module to the current session.

Once the module has been imported you can start an interactive console version of a Neo4j Server like this:

Invoke-Neo4j console

To stop the server, issue Ctrl-C in the console window that was created by the command.

2.4.4.4. How do I get help about the module?

Once the module is imported you can query the available commands like this:

Get-Command -Module Neo4j-Management

The output should be similar to the following:

CommandType     Name                                Version    Source
-----------     ----                                -------    ------
Function        Invoke-Neo4j                        3.3.1      Neo4j-Management
Function        Invoke-Neo4jAdmin                   3.3.1      Neo4j-Management
Function        Invoke-Neo4jBackup                  3.3.1      Neo4j-Management
Function        Invoke-Neo4jImport                  3.3.1      Neo4j-Management
Function        Invoke-Neo4jShell                   3.3.1      Neo4j-Management

The module also supports the standard PowerShell help commands.

Get-Help Invoke-Neo4j

To see examples for a command, do like this:

Get-Help Invoke-Neo4j -examples

2.4.4.5. Example usage

  • List of available commands:

    Invoke-Neo4j
  • Current status of the Neo4j service:

    Invoke-Neo4j status
  • Install the service with verbose output:

    Invoke-Neo4j install-service -Verbose
  • Available commands for administrative tasks:

    Invoke-Neo4jAdmin

2.4.4.6. Common PowerShell parameters

The module commands support the common PowerShell parameter of Verbose.